NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

postfix: most economical way to pipe email of a specific recipient



The requirement is to run a certain script, as a local user, on an email
received on a certain email address on the local machine.

I know procmail can do it. But if I can do it at postfix level it would be
more efficient.

Evaluating following 2 options:

1. pipe (man 8 pipe)

Pros:

Low level, possibly faster than alternatives.

Various macros readily available for fields such as client address to pass
to the command.

Can specify the user it should run as and sets that user's full
environment.

Cons:

How do I invoke the command only on a certain recipient address? Is that
possible? (Possibly I can pipe back mails that are not of interest to the
scipr, but is that a good way?)


2. aliases (man 5 aliases)

Pros:

Simpler to set up

Cons:

Possibly less efficient than pipe

You are on your own to parse the mail and extract the fields you want

No built-in way to specify `run-as'. You have to make do with 'su -' etc.
which has its own quirks. (Or is there a better way?)


Please do suggest ways to meet the requirement, with either above or any
other alternative around postfix.


Mayuresh


Home | Main Index | Thread Index | Old Index