From wolfgang at rosenauer.org Thu Mar 2 09:21:19 2017 From: wolfgang at rosenauer.org (Wolfgang Rosenauer) Date: Thu, 2 Mar 2017 09:21:19 +0100 Subject: EAS autodiscover Message-ID: <38481a68-3562-9d5a-3209-ace1f917ddd1@rosenauer.org> Hi, (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: 1. 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. 2. 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. I currently do not have any packet level protocols for that but I'm wondering if the Samsung EAS autodiscover is doing something strange or if there is something else wrong in my setup. Does it ring a bell to anyone? (I do not have other EAS devices to test atm.) Thanks, Wolfgang From n.messerschmidt at buero.link-m.de Fri Mar 10 12:40:19 2017 From: n.messerschmidt at buero.link-m.de (Nicki Messerschmidt, Linksystem Muenchen GmbH) Date: Fri, 10 Mar 2017 12:40:19 +0100 Subject: Config example for multiple domains with different settings In-Reply-To: <6DEFE2DE-E90B-40B9-AD49-A3172B6C2971@roessner-network-solutions.com> References: <593A46CC-B6ED-4A64-9193-41E5DE5298DD@roessner-network-solutions.com> <5c7c0df4-39eb-b31a-ed45-9f8231f155f9@buero.link-m.de> <6DEFE2DE-E90B-40B9-AD49-A3172B6C2971@roessner-network-solutions.com> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I still don't get how I can achieve multiple filter/sql based domains within one config file. I have attached my current config file. All domains that use the global and static settings work fine. Now I want to add another domain that needs a filter (nosfo.de). But I am not able to create a config that produces any sane settings. The domain nosfo.de should follow the static settings of the section settings.mail_ewh_de but should look up the username using a filter. Can you help me out with this one? Cheers Nicki Christian R??ner schrieb: > Hi, > > sorry for my delay. > > Unfortunately I am on vacation right now, so I will be back on > 10th Oct. > > >> Am 15.09.2016 um 18:03 schrieb Nicki Messerschmidt, Linksystem >> Muenchen GmbH : >> >> Christian R??ner schrieb: >>>> Am 03.08.2016 um 12:17 schrieb Nicki Messerschmidt, >>>> Linksystem Muenchen GmbH : >>>> >>>> [DEFAULT] action = settings account_type = email >>> >>> You can use this section for default settings that are mapped >>> to _all_ other sections. So everything you specify here, will >>> also exist in any other section. Os this what you looked for? >> Not quite. I was looking for your secound example. :) >> >>> Another way is to specify follow statements: >>> >>> [my_wonderful_settings] backend = static_append foo = bar >>> {...} >> Is there a way to have these settings dynamic? Like a sql query >> or a filter? >> >> I want to have several generic sections that are referenced to >> several domains. Most of the time I have not direct mapping of >> the username to the eMail adress. >> >> And I don't quite understand how the filter system works. I >> found the thread https://is.gd/xb8KlB , but it seems that there >> was no solution for the same problem. >> >> So right now I have the following working: ######### start >> config ######### [DEFAULT] action = settings account_type = email >> sign_mobileconfig = yes sign_cert = /etc/ssl/certs/cert.pem >> sign_key = /etc/ssl/private/key.pem >> >> #main server [global] backend = sql host = >> mysql://user:pass at host/db query = SELECT user,email_address from >> lm_email_address where email_address='%s'; result_attrs = user, >> email_address >> >> account_name = ${email_address} account_name_short = ${user} >> >> # all main server setting <...> >> >> [main-domain.tld] backend = global >> >> [second-domain.tld] backend = global >> >> [settings_second_server] backend = static_append #second server >> settings username = email adress <...> >> >> [third_domain.tld] follow = settings_second_server >> >> #### NOT WORKING - Start #### testing section with dynamic >> username from email adress [settings_third_server] backend = >> static_append #third server static settings no username <...> >> >> [dynamic-domain.tld] follow = settings_third_server backend = >> filter username = /usr/bin/automx/third_server_filter.sh %s >> #result: username #### NOT WORKING - End ######### end config >> ######### >> >> But the above does not work. How can this be achieved? > > You can do a lot of dynamic stuff in automx. > > If I remember correctly, you can define variables for "follow = > someprefix.${sectionname}" > > where sectionname is your domain. > > [someprefix.example.com] backend = static_append > > "someprefix" is important here, as you do not want to have this > section map a real domain! It is like a placeholder. The structure > looks like this: > > [DEFAULT] ... > > [global] backend = sql result_attrs = user, email_address, > thedomain ... follow = foo.${thedomain} > > [foo.example1.com] backend = static_append ... > > [foo.example2.com] backend = static_append ... > > [foo.example3.com] backend = static_append ... > > > Maybe something like this. You can combine this with DEFAULT. So > put all common setting into DEFAULT. Define a "global" section > with you SQL queries and use "follow" with dynamic-var to switch > to special backends. Let me know if that worked for you. > > I need to dive deeper into it, when I am back. Or someone else > here on the list might be so kind and help you in the meantime :-) > > Christian > - -- Linksystem Muenchen GmbH We make the Net work Ludwig-Richter-Str. 29 Tel. 089 / 890 518-0 80687 Muenchen Fax 089 / 890 518-77 info at link-m.de http://www.link-m.de Handelsregister: Amtsgericht Muenchen, HRB 129182 Geschaeftsfuehrung: Christine Wittig, Mathias Zunterer PGP Keys: https://www.link-m.de/pgp/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAljCkKIACgkQ6zWc+bXuIEPgGACgyRcUDO5j1U57qhWFWqpZzDpU hDsAniiYt5uVVofHfShw6ar3Hi24INOZ =v/hX -----END PGP SIGNATURE----- -------------- next part -------------- # file: /etc/automx.conf [automx] provider = lm.de domains = * debug = yes logfile = /var/log/automx/automx.log # Protect against DoS memcache = 127.0.0.1:11211 memcache_ttl = 1 client_error_limit = 20 rate_limit_exception_networks = 127.0.0.0/8, ::1/128 [DEFAULT] action = settings account_type = email # 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 = /etc/ssl/certs/cert.pem sign_key = /etc/ssl/private/key.pem [global] backend = sql host = mysql://username:password at mysql.host/database query = SELECT user,email_address from lm_email_address where email_address='%s'; result_attrs = user, email_address account_name = ${email_address} account_name_short = ${user} # The DEFAULT section is always merged into each other section. Each section # can overwrite settings done here. smtp = yes smtp_server = mail.lm.de smtp_port = 587 smtp_encryption = starttls smtp_auth = plaintext smtp_auth_identity = ${user} smtp_refresh_ttl = 6 smtp_default = yes imap = yes imap_server = mail.lm.de imap_port = 993 imap_encryption = ssl imap_auth_identity = ${user} imap_auth = plaintext imap_refresh_ttl = 6 pop = yes pop_server = mail.lm.de pop_port = 995 pop_encryption = ssl pop_auth_identity = ${user} pop_auth = plaintext pop_refresh_ttl = 6 [lm.de] backend=global [fv.de] backend = static account_name = %s account_name_short = %u smtp = yes smtp_server = webmail.fv.de smtp_port = 587 smtp_encryption = starttls smtp_auth = plaintext smtp_auth_identity = %u smtp_refresh_ttl = 6 smtp_default = yes imap = yes imap_server = webmail.fv.de imap_port = 993 imap_encryption = ssl imap_auth_identity = %u imap_auth = plaintext imap_refresh_ttl = 6 pop = yes pop_server = webmail.fv.de pop_port = 995 pop_encryption = ssl pop_auth_identity = %u pop_auth = plaintext pop_refresh_ttl = 6 [ispconfig_lm_de] backend = static_append account_name = %s account_name_short = %u smtp = yes smtp_server = ispconfig.lm.de smtp_port = 587 smtp_encryption = starttls smtp_auth = plaintext smtp_auth_identity = %s smtp_refresh_ttl = 6 smtp_default = yes imap = yes imap_server = ispconfig.lm.de imap_port = 993 imap_encryption = ssl imap_auth_identity = %s imap_auth = plaintext imap_refresh_ttl = 6 pop = yes pop_server = ispconfig.lm.de pop_port = 995 pop_encryption = ssl pop_auth_identity = %s pop_auth = plaintext pop_refresh_ttl = 6 [settings.mail_ewh_de] backend = static account_name = %s account_name_short = %u smtp = yes smtp_server = mail.ewh.de smtp_port = 587 smtp_encryption = starttls smtp_auth = plaintext smtp_auth_identity = %s smtp_refresh_ttl = 6 smtp_default = yes imap = yes imap_server = mail.ewh.de imap_port = 993 imap_encryption = ssl imap_auth_identity = %s imap_auth = plaintext imap_refresh_ttl = 6 pop = yes pop_server = mail.ewh.de pop_port = 995 pop_encryption = ssl pop_auth_identity = %s pop_auth = plaintext pop_refresh_ttl = 6 [kinderbuero-landsberg.de] backend = static follow = ispconfig_lm_de [nosfo.de] backend = filter username = /usr/local/sbin/automx/postfix_virtual_grep %s follow = settings.mail_ewh_de