Giter Club home page Giter Club logo

automx's Introduction

automx's People

Contributors

5nafu avatar bwurst avatar chicobico avatar controlcde avatar croessner avatar cstrotm avatar fh-sys4 avatar hannob avatar kriztov avatar mschiff avatar patrickbenkoetter avatar rseichter avatar tvollmer-at-is24 avatar wreiner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

automx's Issues

Problem with non-ascii accents from MySQL

Hi,
I have noticed that when using MySQL backend, the AutoMX throws an error while getting display name (for account_name) with non-ascii characters (utf8), such as accents in a language (á, ř, č, ž, ...)

2018-08-10 07:37:47,041 ERROR: data.configure(): 'ascii' codec can't decode byte 0xe1 in position 15: ordinal not in range(128)
autodiscover.domain.com [pid: 6075|app: 0|req: 3/4] 192.168.0.254 () {42 vars in 621 bytes} [Fri Aug 10 07:37:47 2018] POST /mobileconfig => generated 0 bytes in 15 msecs (HTTP/1.1 500) 3 headers in 185 bytes (1 switches on core 0)

Is there a way around it? I would like to keep the accents in the DB.

Mobileconfig inserts b in front of user name, mail address and password fields

Hi there, I stumbled upon another issue with mobileconfig.

When I generate a mobileconfig file, automx inserts b in front of the user name, mail address and password fields in the generated profile.

I attached a screenshot with this message.

The (anonymized to example.com) log file:
2016-03-29 19:53:44,241 DEBUG: --------------- BEGIN environ ---------------
2016-03-29 19:53:44,242 DEBUG: wsgi.multiprocess: True
2016-03-29 19:53:44,245 DEBUG: HTTP_REFERER: https://example.com/apple/
2016-03-29 19:53:44,245 DEBUG: REQUEST_METHOD: POST
2016-03-29 19:53:44,245 DEBUG: PATH_INFO: /mobileconfig
2016-03-29 19:53:44,246 DEBUG: HTTP_ORIGIN: https://example.com
2016-03-29 19:53:44,246 DEBUG: SERVER_PROTOCOL: HTTP/2.0
2016-03-29 19:53:44,246 DEBUG: QUERY_STRING:
2016-03-29 19:53:44,246 DEBUG: CONTENT_LENGTH: 89
2016-03-29 19:53:44,246 DEBUG: HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17
2016-03-29 19:53:44,246 DEBUG: HTTP_COOKIE: PHPSESSID=pt7o5bl7avm8hnqe4b05mgqbr0; ga=GA1.2.1772994614.1454855543
2016-03-29 19:53:44,246 DEBUG: SERVER_NAME: example.com
2016-03-29 19:53:44,247 DEBUG: REMOTE_ADDR: 2001:470:7805:0:d913:691b:4be:dd81
2016-03-29 19:53:44,247 DEBUG: wsgi.url_scheme: https
2016-03-29 19:53:44,247 DEBUG: SERVER_PORT: 443
2016-03-29 19:53:44,247 DEBUG: uwsgi.node: vps
2016-03-29 19:53:44,247 DEBUG: DOCUMENT_ROOT: /home/example.com/mailadmin
2016-03-29 19:53:44,247 DEBUG: HTTP_CONTENT_LENGTH: 89
2016-03-29 19:53:44,247 DEBUG: wsgi.input: <uwsgi.Input object at 0x7fc6a5a16288>
2016-03-29 19:53:44,248 DEBUG: HTTP_HOST: example.com
2016-03-29 19:53:44,248 DEBUG: HTTPS: on
2016-03-29 19:53:44,248 DEBUG: wsgi.multithread: False
2016-03-29 19:53:44,248 DEBUG: HTTP_CONTENT_TYPE: application/x-www-form-urlencoded
2016-03-29 19:53:44,248 DEBUG: REQUEST_URI: /mobileconfig
2016-03-29 19:53:44,248 DEBUG: HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,
/
;q=0.8
2016-03-29 19:53:44,248 DEBUG: wsgi.version: (1, 0)
2016-03-29 19:53:44,249 DEBUG: wsgi.run_once: False
2016-03-29 19:53:44,249 DEBUG: wsgi.errors: <open file 'wsgi_errors', mode 'w' at 0x7fc6a59f75d0>
2016-03-29 19:53:44,249 DEBUG: REMOTE_PORT: 51300
2016-03-29 19:53:44,249 DEBUG: HTTP_ACCEPT_LANGUAGE: nl-nl
2016-03-29 19:53:44,249 DEBUG: uwsgi.version: 2.0.7-debian
2016-03-29 19:53:44,249 DEBUG: CONTENT_TYPE: application/x-www-form-urlencoded
2016-03-29 19:53:44,249 DEBUG: wsgi.file_wrapper:
2016-03-29 19:53:44,249 DEBUG: HTTP_ACCEPT_ENCODING: gzip, deflate
2016-03-29 19:53:44,250 DEBUG: --------------- END environ ---------------
2016-03-29 19:53:44,250 DEBUG: Request POST (raw)
_mobileconfig=true&emailaddress=hanstest%40example.com&cn=Test+User&password=testpassword
2016-03-29 19:53:44,251 DEBUG: {u'_mobileconfig': [u'true'], u'password': [u'testpassword'], u'emailaddress': [u'[email protected]'], u'cn': [u'Test User']}
2016-03-29 19:53:44,251 DEBUG: Requesting mobileconfig configuration
2016-03-29 19:53:44,251 DEBUG: Entering data.configure()
2016-03-29 19:53:44,252 DEBUG: NOT FOUND 2001:470:7805:0:d913:691b:4be:dd81, 127.0.0.0/8
2016-03-29 19:53:44,252 DEBUG: NOT FOUND 2001:470:7805:0:d913:691b:4be:dd81, ::1/128
2016-03-29 19:53:44,253 DEBUG: NOT TRUSTED 2001:470:7805:0:d913:691b:4be:dd81
2016-03-29 19:53:44,256 DEBUG: STATIC OrderedDict([(u'smtp_server', 'example.com'), (u'smtp_port', '587'), (u'smtp_encryption', u'starttls'), (u'smtp_auth', u'cleartext'), (u'smtp_auth_identity', u'[email protected]'), (u'smtp_refresh_ttl', '6'), (u'smtp_default', u'Yes')])
2016-03-29 19:53:44,256 DEBUG: STATIC OrderedDict([(u'imap_server', 'example.com'), (u'imap_port', '143'), (u'imap_encryption', u'starttls'), (u'imap_auth', u'cleartext'), (u'imap_auth_identity', u'[email protected]'), (u'imap_refresh_ttl', '6')])
2016-03-29 19:53:44,257 DEBUG: Entering view()
2016-03-29 19:53:44,282 WARNING: openssl: unable to write 'random state'

Google didn't help me with this one, unfortunately. Any hints?
automx

config parser fails for domains

The config parser apparently gets confused for the domains setting if there is no whitespace after a comma. I'm not totally sure but it seems that the entries after a comma w/o whitespace are not recognized anymore.
I guess the code should be more lenient or it should be mentioned in the documentation.

Unable to retrieve full name from LDAP

I'm having trouble configuring automx (current version) to pull a user's full name out of an LDAP server. I'm able to set the parameters for automx to successfully connect to the server (or, at least, not get any error message in the debug log). But from the automx.conf manpage, it looks like I should just be able to specify the LDAP field in the automx.conf file and it will be included. So, following one of the few configuration examples I found that sounded like it should do what I needed, I added display_name = ${displayName} to automx.conf. The resulting .mobileconfig file had just ${displayName}--no variable expansion at all.

Looking more closely at that thread, I saw that they'd escaped the variable, so I changed it to display_name = \${displayName}. Same result.

Then I suspected that my LDAP implementation used different field names, so I requested a user dump:

[root@neth-automx ~]# ldapsearch -xLLL -H ldaps://localhost -b 'dc=directory,dc=nh' '(uid=ginger)'
dn: uid=ginger,ou=People,dc=directory,dc=nh
uidNumber: 1002
gidNumber: 1000
uid: ginger
shadowMax: 99999
shadowWarning: 7
shadowMin: 0
loginShell: /usr/libexec/openssh/sftp-server
homeDirectory: /var/lib/nethserver/home/ginger
shadowInactive: -1
shadowExpire: -1
gecos: Ginger Rogers
shadowLastChange: 17677
shadowFlag: -1
cn: Ginger Rogers
sn: ginger
objectClass: posixAccount
objectClass: shadowAccount
objectClass: inetOrgPerson
mail: [email protected]

This makes it look like the relevant field would be cn, so I changed automx.conf to read display_name = \${cn}. The result was as above--now the resulting .mobileconfig file had ${cn} in the display name field.

It seems there's no variable expansion going on at all, which makes me suspect I'm missing something pretty fundamental. Any suggestions what it might be?

Error 500 accessing https://autodiscover.my.domain.pt/autodiscover/autodiscover.xml

Impacted versions
0.10.2

Distribution: Centos
Codename: Centos 7
Arch: 64 Bits
Database: None
Steps to reproduce
Configuration of automx with NGINX

Full trace using - current behaviour
Accessing https://autodiscover.my.domain.pt/autodiscover/autodiscover.xml

2018-06-20 01:41:25,049 DEBUG: HTTP_HOST: autodiscover.my.domain.pt
2018-06-20 01:41:25,049 DEBUG: HTTPS: on
2018-06-20 01:41:25,049 DEBUG: wsgi.multithread: False
2018-06-20 01:41:25,049 DEBUG: HTTP_UPGRADE_INSECURE_REQUESTS: 1
2018-06-20 01:41:25,049 DEBUG: HTTP_CACHE_CONTROL: max-age=0
2018-06-20 01:41:25,049 DEBUG: REQUEST_URI: /autodiscover/autodiscover.xml
2018-06-20 01:41:25,050 DEBUG: HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
2018-06-20 01:41:25,050 DEBUG: wsgi.version: (1, 0)
2018-06-20 01:41:25,050 DEBUG: wsgi.run_once: False
2018-06-20 01:41:25,050 DEBUG: wsgi.errors: <open file 'wsgi_errors', mode 'w' at 0x7f093c948660>
2018-06-20 01:41:25,050 DEBUG: REMOTE_PORT: 57450
2018-06-20 01:41:25,051 DEBUG: HTTP_ACCEPT_LANGUAGE: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7
2018-06-20 01:41:25,051 DEBUG: REQUEST_SCHEME: https
2018-06-20 01:41:25,051 DEBUG: UWSGI_APPID: utodiscover.my.domain.pt|
2018-06-20 01:41:25,051 DEBUG: uwsgi.version: 2.0.16
2018-06-20 01:41:25,051 DEBUG: CONTENT_TYPE:
2018-06-20 01:41:25,051 DEBUG: wsgi.file_wrapper:
2018-06-20 01:41:25,052 DEBUG: HTTP_ACCEPT_ENCODING: gzip, deflate, br
2018-06-20 01:41:25,052 DEBUG: --------------- END environ ---------------
2018-06-20 01:41:25,052 DEBUG: Request GET: QUERY_STRING:
2018-06-20 01:41:25,052 WARNING: Error in autoconfig request!

Expected behavior
Should return configuration of Outlook

MySQL backend doesn't work on CentOS 7/httpd 2.4

First I must say that AutoMX actually works as expected.

However, when I try to use MySQL lookups literally no lookup is happening. AutoMX doesn't even connect to the database eventhough sqlalchemy is installed. MySQL general log and bin logs doesn't even have any mysql logins logged (also no failed logins), so I have to guess that this is a bug/incompatiblity.

Is this already known?

The following versions are installed (automx trunk):
python -V
Python 2.7.5

pip show sqlalchemy
Name: SQLAlchemy
Version: 1.0.6
Location: /usr/lib64/python2.7/site-packages
Requires:

Exception occurred processing WSGI script

When using a Outlook 2016 client i get the following error in the apache2 log:

mod_wsgi (pid=25508): Exception occurred processing WSGI script '/usr/lib/automx/automx_wsgi.py'.
Traceback (most recent call last):
  File "/usr/lib/automx/automx_wsgi.py", line 126, in application
    tree = etree.parse(fd)
  File "src/lxml/lxml.etree.pyx", line 3427, in lxml.etree.parse (src/lxml/lxml.etree.c:81110)
  File "src/lxml/parser.pxi", line 1828, in lxml.etree._parseDocument (src/lxml/lxml.etree.c:118065)
  File "src/lxml/parser.pxi", line 1843, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:118275)
ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.

When checking the automx log i see that the header of the client request <?xml version="1.0" encoding="UTF-8"?> doesn't match the replace string in the automx_wsgi.py file.

[Mobileconfig] openssl: unable to write 'random state'

First of all, thanks for automx!

Everything works, except the signing of the profiles generated by mobileconfig.
It doesn't include the certificate path, only the leaf cert, because of an error: "openssl: unable to write 'random state'".
I use this (up to date) Github source, and OpenSSL 1.0.2g.

I also tried to run automx as root for one minute, but then the same error (so it's not a permissions issue I think). I already removed all the .rnd files on the system to be sure.. still that error.

See the attached (anonymized to example.com) log file. I hope you can point me in the right direction. 😃 Thnx!
automxlog.txt

Self containing install

I do not know enough of the Python standards and best practices to know if what I did is blasphemy, but here it goes.

I wanted to have a self containing installation of automx, so without copying files throughout the system. To achieve this, I just added two lines to automx_wsgi.py. This will add the current directory to the search path for libraries so we do not have to copy the automx libraries to the system wide install (or virtualenv).

import sys,os
sys.path.append(os.path.dirname(os.path.realpath(__file__)))

Now I can just make a script alias to automx/src/automx_wsgi.py directly. The only thing I have to copy is the automx.conf.

Anyways, adding these two lines does not break any existing installation and does help new installations. But once again, I know nothing of standards for Python.

Good stuff!

macro in [service]server

Is it possible to rewrite the servers (imap/pop3/smtp servers) based on macros or variables?

I would like to be able to rewrite the servers to reflect the domain name of the email address. [email protected] would give smtp.bar.og, [email protected] would return smtp.example.com

Outlook and certificate for vhost

Hi,

wouldn't it be another option (which does not require a certificate with lots of SubjAltNames) to add

_autodiscover._tcp       IN SRV     1 100 443 EXAMPLE.COM.

This way the user doesn't get a warning message that the certificate is invalid/doesn't match the server name or is just unencrypted, however, the user gets a messagebox asking if it's ok to retrieve the configuration fom example.com (which might be ok, becasue the user knows his provider's name). And no wildcard domain name entry is needed.

Documentation: Configuration for Lighttpd

Here my working config for lighttpd on FreeBSD 11

uwsgi-server options with socket:

/usr/local/bin/uwsgi -w /usr/local/share/automx/automx_wsgi.py --wsgi-file /usr/local/share/automx/automx_wsgi.py --pidfile /var/run/uwsgi-automx.pid -s /var/run/uwsgi-automx.sock --chmod-socket=660 --chown-socket=www:www -d /var/log/uwsgi-automx.log --uid www --gid www

Options in /etc/rc.conf:

uwsgi_enable="YES"
uwsgi_socket_owner="www:www"
uwsgi_profiles="automx"
uwsgi_automx_enable="YES"
uwsgi_automx_uid="www"
uwsgi_automx_gid="www"
uwsgi_automx_socket="/var/run/uwsgi-automx.sock"
uwsgi_automx_flags="-w /usr/local/share/automx/automx_wsgi.py --wsgi-file /usr/local/share/automx/automx_wsgi.py"

Lighttpd version > 1.4.42
lighty config:

server.modules += ( "mod_scgi" )
scgi.protocol = "uwsgi"
$HTTP["url"] =~ "^/mail" {
        scgi.server = ( "config-v1.1.xml" => ( "localhost" => (  "socket" => "/var/run/uwsgi-automx.sock", "check-local" => "disable" )))
        }
$SERVER["socket"] == "1.2.3.4:443" {
   ssl.engine                  = "enable"
   ssl.pemfile                 =  config + "certs/server.pem"
server.document-root = server_root + "/lighttpd-dist"
$HTTP["url"] =~ "^/autodiscover" {
        scgi.server = ( "autodiscover.xml" => ( "localhost" => (  "socket" => "/var/run/uwsgi-automx.sock", "check-local" => "disable" )))
        }
$HTTP["url"] =~ "^/mobileconfig" {
        scgi.server = ( "" => ( "localhost" => (  "socket" => "/var/run/uwsgi-automx.sock", "check-local" => "disable" )))
        }
}

automx.conf:

[automx]
provider = mailserver.tld
domains = *

debug = yes
logfile = /var/log/automx/automx.log

client_error_limit = 20
rate_limit_exception_networks = 127.0.0.0/8, ::1/128

[DEFAULT]
account_type = email
account_name = ${display_name} (${email})
account_name_short =

[global]
backend = sql
action = settings
host = postgresql+psycopg2://user:password@host/db
query = SELECT name AS display_name, email, mx FROM table WHERE email='%s'
result_attrs = display_name, email, mx

sign_mobileconfig = yes
sign_cert = /usr/local/etc/letsencrypt/live/domain.tld/fullchain.pem
sign_key =  /usr/local/etc/letsencrypt/live/domain.tld/privkey.pem

smtp = yes
smtp_server = ${mx}
smtp_port = 587
smtp_encryption = starttls
smtp_auth = plaintext
smtp_auth_identity = ${email}
smtp_refresh_ttl = 6
smtp_default = yes

...

Autodetect MX with Fallback automx_script

Thank you for your nice tool.
On our mailserver it´s necessary that automx dynamically detects the MX-Record from the requested domain to return the perfect configuration.
I´ve build a small automx-script for this problem.

Maybe it´s interesting for the automx repository as example script!?

The script takes the first argument and detects the primary MX-Record.
The second argument is used as fallback if the MX detection gets an timeout or other exception.

#!/usr/bin/python

import dns.resolver
import re
import sys

domain = str(sys.argv[1])

try:
    mx_objects = dns.resolver.query(domain,'MX')
except:
    print str(sys.argv[2])
    sys.exit(0)

mx_server = {}

for server in mx_objects:
    mx_server[server.preference] = server.exchange

primary_mx_server = re.sub('\.$', '', mx_server[sorted(mx_server)[0]].to_text())

print primary_mx_server

Autocinfig for mozilla thunderbird

Hi, Help me plz, my apache2 config is :

<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com
        ServerName  mydomain.com
        ServerAlias autodiscover.mydomain.com   
        ServerAdmin webmaster@localhost
        <IfModule mod_wsgi.c>
                WSGIScriptAliasMatch \
                        (?i)^/.+/(autodiscover|config-v1.1).xml \
                        /usr/lib/automx/automx_wsgi.py
                <Directory "/usr/lib/automx">
                        Order allow,deny
                        Allow from all
                        Require all granted
                </Directory>
        </IfModule>
    DocumentRoot /var/www/html

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

And when i try test i got 404 ( Outlook is good.

Testing Autoconfig ...
Connecting to http://autoconfig.mydomain.com/mail/[email protected] ...

  HTTP/1.1 404 Not Found
  Date: Fri, 26 Feb 2016 08:01:13 GMT
  Server: Apache
  Content-Length: 291
  Keep-Alive: timeout=5, max=100
  Connection: Keep-Alive
  Content-Type: text/html; charset=iso-8859-1

Testing Autodiscover (Microsoft Outlook(tm)) ...
Connecting to https://autodiscover.mydomain.com/autodiscover/autodiscover.xml ...

  HTTP/1.1 200 OK
  Date: Fri, 26 Feb 2016 08:01:13 GMT
  Server: Apache
  Strict-Transport-Security: max-age=15768000
  Content-Length: 1367
  Vary: Accept-Encoding
  Keep-Alive: timeout=5, max=100
  Connection: Keep-Alive
  Content-Type: text/xml

Python Error

I'm using a Centos 7 Host. I followed your INSTALL doc.
The following python packages are installed but it still complains about missing modules:

python-2.7.5-34.el7.x86_64
python2-boto-2.39.0-1.el7.noarch
python2-crypto-2.6.1-9.el7.x86_64
python2-ecdsa-0.13-4.el7.noarch
python2-paramiko-1.16.1-1.el7.noarch
python2-rsa-3.4.1-1.el7.noarch
python-backports-1.0-8.el7.x86_64
python-backports-ssl_match_hostname-3.4.0.2-4.el7.noarch
python-chardet-2.2.1-1.el7_1.noarch
python-configobj-4.7.2-7.el7.noarch
python-dateutil-1.5-7.el7.noarch
python-decorator-3.4.0-3.el7.noarch
python-GnuPGInterface-0.3.2-11.el7.noarch
python-iniparse-0.4-9.el7.noarch
python-ipaddr-2.1.9-5.el7.noarch
python-IPy-0.75-6.el7.noarch
python-javapackages-3.4.1-11.el7.noarch
python-kitchen-1.1.1-5.el7.noarch
python-libs-2.7.5-34.el7.x86_64
python-lockfile-0.9.1-4.el7.centos.noarch
python-lxml-3.2.1-4.el7.x86_64
python-memcached-1.48-4.el7.noarch
python-perf-3.10.0-327.18.2.el7.x86_64
python-pyasn1-0.1.6-2.el7.noarch
python-pycurl-7.19.0-17.el7.x86_64
python-pyudev-0.15-7.el7_2.1.noarch
python-requests-2.6.0-1.el7_1.noarch
python-setuptools-0.9.8-4.el7.noarch
python-six-1.9.0-2.el7.noarch
python-slip-0.4.0-2.el7.noarch
python-slip-dbus-0.4.0-2.el7.noarch
python-urlgrabber-3.10-7.el7.noarch
python-urllib3-1.10.2-2.el7_1.noarch

Error in httpd/apache log:
[Mon Jun 06 11:45:09.807617 2016] [:error] [pid 15232] [client 78.46.79.43:38182] mod_wsgi (pid=15232): Target WSGI script '/usr/lib/automx/automx_wsgi.py' cannot be loaded as Python module.
[Mon Jun 06 11:45:09.807642 2016] [:error] [pid 15232] [client 78.46.79.43:38182] mod_wsgi (pid=15232): Exception occurred processing WSGI script '/usr/lib/automx/automx_wsgi.py'.
[Mon Jun 06 11:45:09.807655 2016] [:error] [pid 15232] [client 78.46.79.43:38182] Traceback (most recent call last):
[Mon Jun 06 11:45:09.807666 2016] [:error] [pid 15232] [client 78.46.79.43:38182] File "/usr/lib/automx/automx_wsgi.py", line 29, in
[Mon Jun 06 11:45:09.807749 2016] [:error] [pid 15232] [client 78.46.79.43:38182] from html import escape
[Mon Jun 06 11:45:09.807763 2016] [:error] [pid 15232] [client 78.46.79.43:38182] ImportError: No module named html

sys.path
python
Python 2.7.5 (default, Nov 20 2015, 02:00:19)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import sys
sys.path
['', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib64/python2.7/site-packages/gtk-2.0', '/usr/lib/python2.7/site-packages']
import html
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named html
import escape
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named escape

What I am missing?

Improve iOS form input error message

When someone enters an invalid domain (a domain the particular automx instance doesn't support/serve) into automx' web form for iOS, automx should provide a meaningful error message.

Dynamic services

I would love to have the feature to enable disable a service with a expand_vars.

Currently I have added this feature by using:

if self.__expand_vars(self.get(section, service)).strip().lower() in ('1', 'y', 'yes', 't', 'true', 'on'):

on line 634

Documentation outdated

I struggled several hours today to get automx running on my server. During the process I noticed several problems with the provided documentation.

wrong download link

INSTALL says wget http://automx.org/download/latest.tar.gz which gives a 404
since the tarball is hosted on github there is no latest.tar.gz
Currently: https://github.com/sys4/automx/archive/v0.10.2.tar.gz or https://github.com/sys4/automx/releases

unknown log formats for nginx

I've installed installed nginx-full on Debian Wheezy and when using nginx-automx.conf nginx complains unknown log format "main" and unknown log format "info"

missing module for nginx

Even with nginx-full I can't use more_set_headers and
the resulting error is: unknown directive "more_set_headers"
Maybe it would be better to name the files something like index_de.html instead changing the whole filetype. Then I guess the module would no longer be needed

wrong package names for python packages

When trying to install the suggested packages via pip some are not found because the name you provided is wrong. dateutil is python-dateutil.
memcache also does not exist and there are several similar packages. I'm not sure which to use or if it doesn't matter.

I think these things are easy to fix but these things can cost you hours if you rely on the documentation.

Support for resolving aliases to get actual login name.

In my mail-setup, i never use my actual username as an e-mail address.
Instead, I use aliases.

I would be very nice if there was optional support for something that tries to resolve %u to an alias, putting it into another macro, %a or something like that, or setting said macro to %u if no alias was found.

Finding an alias is simple enough by executing "getent aliases %u". If it finds an alias for that name, it returns a line in the format "alias: username".

There also seems to be a python module for querying getent:

https://pypi.python.org/pypi/getent

With that, it shouldn't be much more than getent.aliases(username).

Send email address as auth_identity

I am utilizing this script to auto-configure virtual domains hosted on a single server. All of the mailboxes need to use their full email address as their login. I see you can specify *_auth_identity but can you have that resolve to the email address passed?

EAS autodiscover does not work for Samsung Galaxy S7

(first as information I'm currently using the 0.10.2 tag as latest I
couldn't get to work (reported on github)).

I basically got everything set up and working but EAS.

With automx-test it seems to work but tried it with my Samsung device
and hit different issues:

the autodiscover request was answered with a 411 which apparently means
that Apache implied a chunked request.
Apache error log:
Received request requiring chunked transfer encoding, but optional
support for chunked transfer encoding has not been enabled.:
/usr/lib/automx/automx_wsgi.py

Apache access log:
[02/Mar/2017:09:06:45 +0100] "POST /autodiscover/autodiscover.xml
HTTP/1.1" 411 921
[02/Mar/2017:09:06:46 +0100] "GET /autodiscover/autodiscover.xml
HTTP/1.1" 500 - "-" "Android-SAMSUNG-SM-G930F/101.60001"

So the device seems to find the error with POST and tries a GET but
without any parameter which again yields into a 500 because automx
currently always requires a parameter.

All the above is not written to the automx debug log btw.

then I enabled WSGIChunkedRequest On to possibly get around the 411
which seemed to workaround the 411 but then again it seems to
immediately run also into a 500 for the POST request.

And last but not least it seems to work fine with an iOS device so there is some client difference causing this behaviour. I could imagine the only thing required is to make the wsgi capable to work with chunked?

MobileConfig Issue with different Server and Domain

Hi,

we facing a problem within the mobileconfig for iOS/MacOS if the Login is the eMail-Address and the Mail-Server and the Domain of the eMail-Address is not the same.

eMail Address: [email protected]
Login: [email protected]
Mail-Server: mail.server.com

If you install the mobileconfig it ends up that the Mail Address is combined as: name@[email protected]

In the mobileconfig file it looks fine. Is there any way to prevent the behavior?
Or is it an issue within the interpretation of the file in OS X / iOS ?

Thanks
Richard

Error message when adding account that supports Automx

Hi, we are trying out Modoboa which installs AutoMX automatically but when I try to add an account I get the following error:

2017-10-09 10:40:01,436 WARNING: No SQL result from server!
2017-10-09 10:40:01,436 WARNING: Request 2 [IP]
autodiscover.domain.com[pid: 1227|app: 0|req: 3/5] IP() {62 vars in 1038 bytes} [Mon Oct  9 10:40:01 2017] POST /autodiscover/autodiscover.xml => generated 0 bytes in 11 msecs (HTTP/1.1 500) 2 headers in 81 bytes (2 switches on core 0)
Traceback (most recent call last):
  File "./automx_wsgi.py", line 126, in application
    tree = etree.parse(fd)
  File "src/lxml/lxml.etree.pyx", line 3442, in lxml.etree.parse (src/lxml/lxml.etree.c:81716)
  File "src/lxml/parser.pxi", line 1828, in lxml.etree._parseDocument (src/lxml/lxml.etree.c:118859)
  File "src/lxml/parser.pxi", line 1843, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:119069)
ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
autodiscover.domain.com [pid: 1227|app: 0|req: 4/6] 91.189.40.200 () {46 vars in 748 bytes} [Mon Oct  9 10:40:01 2017] POST /autodiscover/autodiscover.xml => generated 0 bytes in 1 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)

I've talked to the developer of Modoboa and this error seems to be pointing towards Automx itself.

ActiveSync autodiscovery (Outlook 2016)

I can't get ActiveSync autodiscovery to work, and Outlook 2016 no longer allows me to manually config ActiveSync.

Has anyone been successful?

It's also failing with Outlook for Android.

[automx]
provider = xyzzy.xy
domains = *
debug = yes
logfile = /var/log/automx/automx.log
# Protect against DoS
memcache = 127.0.0.1:11211
memcache_ttl = 600
client_error_limit = 20
rate_limit_exception_networks = 127.0.0.0/8, ::1/128
# The DEFAULT section is always merged into each other section. Each section
# can overwrite settings done here.
[DEFAULT]
account_type = email
account_name = XYZZY Corp ${displayName}
account_name_short = xyzzy
server_url = https://sogo.xyzzy.xy/SOGo/Microsoft-Server-ActiveSync
server_name = SOGo
display_name = ${displayName}
activesync_email = ${mail}
action = settings
smtp = yes
smtp_server = email.xyzzy.xy
smtp_port = 587
smtp_encryption = starttls
smtp_auth = plaintext
smtp_auth_identity = ${uid}
smtp_refresh_ttl = 6
smtp_default = yes
imap = yes
imap_server = email.xyzzy.xy
imap_port = 143
imap_encryption = starttls
imap_auth_identity = ${uid}
imap_auth = plaintext
imap_refresh_ttl = 6
# 172.16.16.4 - IP des Masters, es können mehrere ldap-URLs angegeben werden:
host = ldap://192.168.100.5:7389
base = cn=users,dc=xyzzy,dc=xy
result_attrs = displayName, uid
scope = sub
filter = (&(objectClass=univentionMail) (mailPrimaryAddress=%s))
bindmethod = simple
binddn = uid=apacheauth,cn=users,dc=xyzzy,dc=xy
bindpw = pasword
usetls = false
#cacert = /etc/ldap/ssl/cacert.pem
# If you want to sign mobileconfig profiles, enable these options. Make sure
# that your webserver has proper privileges to read the key. The cert file
# must contain the server certificate and all intermediate certificates. You
# can simply concatenate these certificates.
#sign_mobileconfig = yes
#sign_cert = /path/to/cert
#sign_key = /path/to/key
pop = no
[global]
backend = ldap 


centos6 not working

Syntax errors with the latest git on centos 6

Any help / ideas would be appreciated.

Thanks

/var/log/uwsgi/uwsgi.log

*** Operational MODE: single process ***
added /usr/lib/automx/src/ to pythonpath.
  File "/usr/lib/automx/src/automx_wsgi.py", line 68
    print(e, file=environ["wsgi.errors"])
                 ^
SyntaxError: invalid syntax
unable to load app 0 (mountpoint='') (callable not found or import error)

python -V

Python 2.6.6

/etc/uwsgi.d/automx.ini

[uwsgi]
plugins = python
vhost = true

socket = 127.0.0.1:7000
pidfile = /var/run/uwsgi.automx.pid
chown-socket = nginx:nginx
chmod-socket = 660
uid = automx
gid = automx
enable-threads = true

module = automx_wsgi

python-path = /usr/lib64/python2.6
file = /usr/local/lib/automx/automx_wsgi.py

Double encoding of @

I set up automx but it failed to provide settings for Thunderbird 31, however automx-test passed OK. I looked at the debugging output and noticed that the email address provided by Thunderbird had for some reason been double encoded to "something%2540example.com" and was still encoded as "something%40example.com" when passed to config.py with data.configure(emailaddress, cn, password) in automx_wsgi.py on line 211 (version 0.10.2). I did a crude fix by just doing a replace for "%40" with "@" as I was in a hurry but you probably can fix this issue where the double encoding originally takes place.

Documentation Missing syntax for Microsoft SPA settings

We have searched the documentation, config files and complete mailing list archives and have not found any information on how one would set SPA to "off" using automx. We are using Dovecot IMAP and do not support Microsoft Secure Password Authentication and yet the files being generated by automx have On.

We have tried guessing based on the formatting of other options but have been unsuccessful.

Can the documentation have some corner cases such as this one added?

automx.html not working

I installed automx version 0.10.2, configured following the instructinos and now it's working.
After this I wanted to let it work for iOS and OS X Mail too. The INSTALL file refers to a automx.html that is not present in the master branch.
I found it in the mobileconfig branch. Copied it together with the js css and img directories, opened the URL with a browser, filled in the form, pressed the "Create Configuration!" button and... nothing!
I tried both with Firefox and Safari. Same results.
Am I missing anything? Is this a bug?

new release needed

Given that Python2 support will end in a month it would be good to have an official release that supports Python3.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.