Hi folks,

Situation:
Hoping to tie Postfix into a chain of software and hardware appliances as a Message Bus, most of which is outside of my control. Postfix is run inside a heavily firewalled network, no e-mail incoming from the outside world.

I'm trying to find out how (much work it is) to transform/convert the RCPT TO line--*including* the NOTIFY section--from the incoming SMTP session with an e-mail, into a mailheader with Postfix (or milter-plugin) *and* strip the NOTIFY section from the SMTP session after the original notify_options are preserved for the mailheader. The notify wish of the sender (software program/appliance) would be picked up from the header and handled at a later step. These e-mails will be stored in a Maildir folder, no further relay via SMTP.

- Before, SMTP session:
RCPT TO: <mailbox@domain> NOTIFY=notify_options


- After, SMTP session:
RCPT TO: <mailbox@domain>

After, desired result as a line in the e-mail:
X-env-recipient: <mailbox@domain> NOTIFY=notify_options


I've found http://www.postfix.org/postconf.5.html#smtpd_command_filter - the section of the example (/etc/postfix/command_filter) seems sufficient to strip the NOTIFY part from the RCPT TO line. However I don't see any indication that it is possible to write a mailheader line with the information from the NOTIFY part. (If it is possible to use PREPEND here, it would end up in the SMTP session, not in a header is my guess?)

Also found an example to use the smtpd_recipient_restrictions setting with a pcre table:
/(.*)/  prepend X-Envelope-To: <$1>
but that doesn't seem to offer the option to use anything from the NOTIFY section of the SMTP session.


Anyone know if it is possible what I outlined above, directly with a (combination of) Postfix setting(s)/pcre statement(s)? And if so, can provide me with a hint in the right direction?

And otherwise, might a Before-Queue milter-plugin work or is there no access to the NOTIFY part of the SMTP session possible for that either with Postfix?


If there's no option at all to do this with Postfix, there's a pretty good chance I'll be asked with which mailserver it would be possible, which'd be a shame since so far Postfix has performed fine.

Kind regards,

Alex

Reply via email to