OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: About running programs on the event of mail delivery...

From: /dev/rob0 (rob0gmx.co.uk)
Date: Mon Jun 12 2006 - 11:49:40 CDT


On Monday 2006-June-12 11:31, Luis Motta Campos wrote:
> I need to trigger a perl script whenever an email comes.
> The email belongs to a LDAP-based virtual domain, and I don't know
> how to tell postfix to pipe the email to the script. From the
> manuals, I've learned that I can trigger programs using emails by
> placing a line like
>
> local_mail: "|/path/to/program -and -options"
>
> in one of my $alias_map files. But I have no idea about where to
> place an equivalent line for a virtual domain.

Michael's answer is one way to do it. You use $virtual_alias_maps to
rewrite the address to a local address, then your $alias_maps (note,
plural) entry will work. I would suggest using a complete address on
the right-hand side of the $virtual_alias_maps table:
    mycodeexample.com local_maillocalhost

Other possibilities include using a pipe(8) transport, but this is
simplest.

> $(/usr/sbin/postconf -n)
snip
> append_dot_mydomain = no

This is not recommended.

> relay_domains = $mydestination, lists.segula.pt

Take out $mydestination. Using $relay_domains without
$relay_recipient_maps can make you a backscatter spammer. What are you
doing with lists.segula.pt?

> smtpd_banner = Just send ESMTP messages, 'key, dude?

Um ... why? The hostname in the banner is a requirement.
--
    Offlist mail to this address is discarded unless
    "/dev/rob0" or "not-spam" is in Subject: header