mailautoconf/README.MD

102 lines
5.2 KiB
Markdown
Raw Permalink Normal View History

2021-08-11 21:04:39 +02:00
# MailAutoConf - a simple, configurable autodiscover/autoconfig service for distributed and self-hosted services.
2021-08-16 21:49:31 +02:00
## New GoLang version - please make sure you update your ini files to yaml!
2021-08-18 22:27:30 +02:00
Github : https://github.com/pswilde/mailautoconf
2021-08-18 22:30:19 +02:00
<a href="https://www.buymeacoffee.com/pswilde" target="_blank">
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-blue.png" height="60" width="217" alt="Buy Me A Coffee" style="height: 30px !important;width: 106px !important;" >
</a>
2021-08-18 22:30:41 +02:00
## What is MailAutoConf?
2021-08-11 21:04:39 +02:00
MailAutoConf is autodiscover/autoconfig web server for self-hosted mail services
which do not have their own autodiscover service.
## What does MailAutoConf do?
2021-08-11 21:39:44 +02:00
MailAutoConf is currently in _very_ early stages, but it does generate valid
2021-08-11 21:04:39 +02:00
autoconfig XML files (/mail/config-v1.1.xml) compatible with many mail clients
i.e. Thunderbird, Evolution, etc.
Theoretically, anything that can read the standard autoconfig XML file -
https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat, should
be able to auto-configure using this service.
## Installation
2021-08-16 21:20:30 +02:00
MailAutoConf runs its own webserver on port 8010.
2021-08-11 21:04:39 +02:00
You will need to supply a volume for the configuration file and port forwarding.
```
2021-08-11 21:05:21 +02:00
podman run -dt \
--name mailautoconf \
2021-08-16 21:20:30 +02:00
-v ./config:/mailautoconf/config \
-p 8010:8010 \
2021-08-13 11:56:53 +02:00
pswilde/mailautoconf
2021-08-11 21:04:39 +02:00
```
You will need a reverse proxy server to publish to the outside world and handle SSL encryption.
For example, in nginx:
```
server {
2021-08-11 21:12:27 +02:00
listen 443 ssl;
server_name autoconfig.example.com;
2021-08-11 21:13:20 +02:00
ssl_certificate /path/to/certificate.file;
ssl_certificate_key /path/to/certificate.key
2021-08-11 21:12:27 +02:00
location / {
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2021-08-11 21:13:39 +02:00
proxy_pass http://localhost:8010/;
proxy_redirect http://localhsot:8010/ /;
2021-08-11 21:12:27 +02:00
proxy_read_timeout 60s;
}
}
2021-08-11 21:11:14 +02:00
```
2021-08-16 21:20:30 +02:00
First run will create sample.yaml files in the config directory. Copy these to config.yaml and services.yaml and configure them to your needs.
2021-08-11 21:29:09 +02:00
MailAutoConf will handle all the URLs it's able to deal with, i.e. /mail/config-v1.1.xml, /Autodiscover/Autodiscover.xml automatically.
## DNS config
You will need to configure DNS records for your domain.
I would recommend setting up an A record for autoconfig.your.domain to point
directly to your MailAutoConf's instance which will work for Thunderbird and
Evolution clients.
Then, if Outlook Autodiscover is required (currently not implemented), configure
a SRV record to redirect to the autoconfig.your.domain A record. i.e.
```
Type TTL P M Port Target
SRV _autodiscover._tcp.your.domain 3600 10 10 443 autoconfig.your.domain
2021-08-11 21:29:31 +02:00
```
2021-08-10 11:57:43 +02:00
## Compatibility
2021-08-18 17:00:39 +02:00
MailAutoConf has been tested and confirmed working (for IMAP and SMTP) with the following software packages
- [x] Thunderbird (v78 and probably earlier versions too)
- [x] Evolution Mail (v3.40.3 and probably earlier versions too)
- [x] Nextcloud Mail app
- [ ] Other Mail Clients are likely supported if they support /mail/config-v1.1.xml
2021-08-16 21:20:30 +02:00
2021-08-11 21:32:13 +02:00
2021-08-11 21:04:39 +02:00
## Future plans
MailAutoConf is currently in _very_ early stages, with a _very_ limited set of features.
2021-08-11 21:22:03 +02:00
My hope for MailAutoConf is to run as an autoconfig service which provides Calendar and AddressBook locations as well.
Calendar and AddressBook is in the autoconfig XML documentation, but currently not implemented. MailAutoConf can generate the correct information for Calendar and AddressBook into the autoconfig XML file, though no clients currently use it.
2021-08-10 11:57:43 +02:00
2021-08-11 21:32:13 +02:00
## TODO:
2021-08-11 21:30:01 +02:00
- [x] /mail/config-v1.1.xml file for Thunderbird and Evolution mail clients.
2021-08-11 21:32:13 +02:00
- [ ] Add more code commenting, it's pretty terrible right now.
- [ ] Refactor the autoconfig and autodiscover XML files, they've been copied and bodged together and could look so much better.
2021-08-11 21:22:49 +02:00
- [ ] Autodiscover.xml for Outlook clients - currently does generate, but untested.
- [ ] Autodiscover.json for more modern Outlook clients - this is currently undocumented. I have implemented some features of it but it is currently not working.
- [ ] Calendars and Address Book - does generate into mail/config-v1.1.xml, but no actual clients support it yet.
- [ ] Additional, custom services. For example, Nextcloud - instead of having to type in your Nextcloud instance URL, you can just enter your email address associated with you Nextcloud account and it looks up the URL from autoconfig - wouldn't that be nice?
- [ ] Probably loads of stuff I haven't thought of yet.
2021-08-10 11:57:43 +02:00
## When will it be ready for production?
2021-08-18 17:00:39 +02:00
It works for non-Microsoft email clients now (see Compatibility above).
Outlook's autodiscover is a troublesome little blighter, MailAutoConf does generate a valid Autodiscover.xml, but modern Outlook clients use an Autodiscover.json file now which isn't documented anywhere. I'm working on this and hope to get Outlook Compatibility as soon as possible.
Then it's down to Autoconfiguration of Calendars and AddressBooks... but that's down to the email client developers really...
2021-08-10 11:57:43 +02:00
If you feel you may be able to help, or ideas on features and their implementation, notice any bugs, or just want to say hi. Please do so and submit a pull request if required.
Thanks for reading!