Automx on FreeBSD with virtual mail setup
Christian Rößner
c at roessner-network-solutions.com
Wed Apr 11 18:25:50 CEST 2018
Hi David,
> I'm running FreeBSD 11.1 and have a virtual email system set up. It
> runs Postfix, Dovecot, and MySQL among other things. To that i'd now
> like to add Automx.
>
> I've got the FreeBSD automx port installed, and I've got the dns
> propagated for my domain(s) so that's good.
>
> I am uncertain now of how to set up the MySQL database and tables, can
> I integrate automx in to my existing virtual mail database or do I
> have to make another db?
You can integrate it. It simply depends on the fields you have in the tables and what queries you want to do within automx.
Example:
----------------------------------------------------------------------
[automx]
provider = example.test
debug = yes
logfile = /var/log/automx/automx.log
domains = *
memcache = 127.0.0.1:11211
memcache_ttl = 86400
client_error_limit = 5
rate_limit_exception_networks = 127.0.0.0/8, ::1/128
[DEFAULT]
action = settings
account_type = email
account_name = Your company
account_name_short = Company
[global]
backend = sql
host = mysql://user:pass@server/databasename
query = SELECT displayname, mailaddr FROM mail WHERE mailaddr='%s';
result_attrs = displayname, mailaddr
display_name = ${displayname}
imap = yes
imap_server = mail.example.test
imap_port = 143
imap_encryption = starttls
imap_auth = plaintext
imap_auth_identity = ${mailaddr}
smtp = yes
smtp_server = mail.example.test
smtp_port = 587
smtp_encryption = starttls
smtp_auth = plaintext
smtp_auth_identity = ${mailaddr}
smtp_default = yes
----------------------------------------------------------------------
I have not tested this example, but I think it should work. Concerning Python2 or Python3: If you use automx from the Github master, it should run under each Python version beginning with 2.7 (maybe 2.6; not sure).
I have no Apache anymore, so I can not help you with this. I use uwsgi with nginx. Here is the config stuff from Gentoo-Linux:
Example for Python 3:
----------------------------------------------------------------------
UWSGI_SOCKET=127.0.0.1:9100
UWSGI_THREADS=1
UWSGI_PROGRAM=
UWSGI_XML_CONFIG=
UWSGI_PROCESSES=4
UWSGI_LOG_FILE="/var/log/automx/uwsgi.log"
UWSGI_CHROOT=
UWSGI_DIR=
UWSGI_USER=automx
UWSGI_GROUP=automx
UWSGI_EMPEROR_PATH=
UWSGI_EMPEROR_GROUP=
UWSGI_EXTRA_OPTIONS="--plugin python35 --python-path /usr/local/lib64/python3.4 --module automx_wsgi"
----------------------------------------------------------------------
And here are the settings for nginx:
Example:
----------------------------------------------------------------------
...
# automx
location ^~ /automx {
include /etc/nginx/mime.types;
types {
text/html de en;
}
try_files $uri $uri/ index.html.$lang;
index index.html.$lang;
access_log /var/log/nginx/access_ssl-automx.log main;
error_log /var/log/nginx/error_ssl-automx.log info;
}
# automx - autodiscover
location ~ /autodiscover/autodiscover.xml {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9100;
}
# automx - iOS mobileconfig
location = /mobileconfig {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9100;
}
...
----------------------------------------------------------------------
For autodiscover you need SSL and then you can add something like this:
Example:
----------------------------------------------------------------------
...
# automx - autodiscover
location /autodiscover/autodiscover.xml {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9100;
}
...
----------------------------------------------------------------------
Hope that is a good starting point for you. Once again sorry for the delay. I am very busy...
Best regards
Christian
--
Rößner-Network-Solutions
Erlenwiese 14, 36304 Alsfeld
T: +49 6631 78823400, F: +49 6631 78823409, M: +49 171 9905345
USt-IdNr.: DE225643613, https://roessner-network-solutions.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1629 bytes
Desc: not available
URL: <https://mail.sys4.de/pipermail/automx-users/attachments/20180411/d2904193/attachment-0001.p7s>
More information about the automx-users
mailing list