Custom logic

Steve Meier smeier at
Wed Jan 6 23:21:43 CET 2016

It seems like I could accomplish this by use of section filters.  I would
write a script that can return the correct section that matches the required

I also read somewhere that you can specify "backend=script" but I'm not
seeing that plainly documented.


section_filter (default: domainpart, optional)

    Specifies a list of one or more filters whose result outputs a section
    name. The filters will be used in order specified. The first match ends
    execution of subsequent filters.

    These filters will be used instead of the hard coded, internal
    filter, which strictly uses the domainpart taken from the email address
    client submitted in its configuration request:

    section_filters = server_1, server_2
    server_1 = /usr/sbin/postmap -q "%u"
hash:/etc/postfix/virtual_alias_domains | \
            sed -e 's/^.*@\(\.*\)/\1/g' | grep
    server_2 = /usr/sbin/postmap -q "%u"
hash:/etc/postfix/virtual_alias_domains | \
            sed -e 's/^.*@\(\.*\)/\1/g' | grep

automx_script.5.rst:        Specifies the absolute path to the script which
should be run by the backend automx_script(5) backend::
automx_script.5.rst:                script = /usr/local/bin/

-----Original Message-----
From: automx-users [mailto:automx-users-bounces at] On Behalf Of Marc
Sent: Wednesday, January 6, 2016 2:10
To: automx-users at
Subject: Re: Custom logic


Am 19.12.2015 um 02:51 Uhr schrieb Steve Meier:
> The general logic needed is-
> 1) User has provided a "*username at*" address
> 2) Query our LDAP server by the *uid=username* and retrieve the 
> *mailRoutingAddress *attribute.
> 3) *mailRoutingAddress *will follow one of *three rules*-
>    a) the "username@*servername*"
>    b) an external "forwarding address" that has been assigned by the 
> user (for example a gmail, a yahoo, etc)
>    c) "username@**" (in other words, an 
> institution-specific Office 365 instance)
so this is coming out of your directory directly, right?

> 4) Based on the rules above, we need to send the correct response, 
> respectively
>    a) respond with settings for IMAP+SMTP email service (based off 
> *username, servername*)
>    b) don't send a response (or possibly fall back to settings using a 
> different LDAP attribute)
>    c respond with a *redirect to Microsoft O365 
If I understood correctly, you do not have the values for LDAP- and
SMTP-server in your directory, so you cannot just sends this information to
automx, right?
This is the problem?

> I have read through the documentation and it appears it may be 
> possible to do this using automx, but I am not sure yet.  The 
> documentation referenced this listserv, so I thought I would ask.
If the answer form LDAP is
if $addresse  ~= *
	then smptserver = microsoftserver
	then imapserver = microsoftserver

> Can anyone provide some insight into whether or not above would be 
> possible, and if so, the general approach to go about it?  I can see 
> it may require a combination of things (filters, custom scripts, LDAP,
The easiest way would be to store the information directly in your LDAP and
send it back to automx.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4827 bytes
Desc: not available
URL: <>

More information about the automx-users mailing list