Triggering a script when mail is received on some address in ISPConfig3

Discussion in 'Tips/Tricks/Mods' started by Mark_NL, Apr 6, 2011.

  1. Mark_NL

    Mark_NL New Member

    Well, i started this post to ask for your assistance .. but while i was typing, and double checking everything i resolved the problem.

    Instead of closing this window and go on with my day i thought it might be useful to post my solution so others can benefit from it in case they run into the same problem (i couldn't find anything on the forum btw)

    Anyway, i wanted to trigger a script when i received an email on a specified address (bounce@domain.tld).

    so ..

    vi /etc/aliases
    bounce: "|/data/scripts/"
    /etc/init.d/postfix reload
    The problem i ran into here was that, postfix didn't knew "bounce@domain.tld", so i got this error:
    Oke, well let's make a virtual user (bounce@ should not be a real mailbox)

    So in ISPConfig3 i added a "Mail forward"
    E-Mail: bounce @ domain.tld
    Destination Email: bounce

    By not adding a domain after "bounce" this will become a local user on this system, hence it will be picked up by "aliasses" (where we said: run script X when mail for bounce).

    New test!

    mail.domain.tld is indeed the same machine, so we need to tell postfix that he is mail.domain.tld as destination so add "mail.domain.tld" to "mydestination" in /etc/postfix/

    new test!

    et voila!


    P.S. Adding a virtual alias map didn't work. And now we keep using ispconfig's interface, which imho is more neat.

Share This Page