On 3/19/2014 3:26 PM, Tim Prepscius wrote: > Ok I will describe my goal: > > > There is a server. > On it runs postfix. > > All mail is sent via localhost (or 127.0.0.1). > Meaning, I run a command and mail is sent, nobody is connecting from > outside and sending.
If the mail is injected locally via SMTP, all you need to do is add a -o content_filter=filter:dummy line to the smtpd listener in master.cf, and nothing in main.cf. I think that's what the FILTER_README simple filter example shows. If your local mail uses the sendmail(1) interface, the you'll need a more complex config. -- Noel Jones > > I need to save to a custom DB the mail after any headers are > changed/added by postfix. > So if user X@MyMail sends a mail M, postfix (perhaps) adds headers to > M, creating M-Final. > > I want to save M-Final to a table, (User, SentOrReceived, MailContent) > (X@MyMail, Sent, M-Final). > I then want the mail to be sent. > > I would like the command to save M-Final to be something like: > SentToStore sender recipients > > If for whatever reason, the save of M-Final to the DB fails, I want > the mail to either retry later or bounce. > > -- > > I am attempting to do this with the Posfix After-Queue Content Filter. > It works, except that mail is never sent because it keeps on hitting > the filter, re-added to the queue, etc. > > > -tim >