Hi :-),
I have created a pipe into Postfix in order to send incoming/outgoing mails content into a Database (for a Webmail app). The Mail extraction and DB insertion part is (well) done within a Ruby script.
Here is the code in /etc/postfix/master.cf :
Code:
#At the beginning of the file
smtp inet n - - - - smtpd
-o content_filter=brindinfo_filter:
#......and at the bottom of the file :
brindinfo_filter unix - n n - - pipe
flags=hq user=guillaume argv=/usr/bin/ruby1.8 /home/guillaume/brindinfo/lib/mail_receiver.rb
At the beginning, it works fine : everything passing true Postfix is successfully inserted into the DB. But at the end of the ruby script, Postfix simply ends up and do not perform final delivery, so every outgoing mail is simply... lost !!
Here's the /var/log/mail.log after an outgoing mail (@ replaced with "at" to prevent spammers) :
Code:
Aug 14 12:00:24 r25640 postfix/smtpd[17525]: 765FD811B8: client=localhost.localdomain[127.0.0.1]
Aug 14 12:00:24 r25640 postfix/cleanup[17528]: 765FD811B8: message-id=<4a8535b86c903_4474..fdbe46b861c2@r25640.ovh.net.tmail>
Aug 14 12:00:24 r25640 postfix/qmgr[16510]: 765FD811B8: from=<contact_at_brindinfo.fr>, size=451, nrcpt=1 (queue active)
Aug 14 12:00:24 r25640 postfix/smtpd[17525]: disconnect from localhost.localdomain[127.0.0.1]
Aug 14 12:00:25 r25640 postfix/pipe[17529]: 765FD811B8: to=<guy_lux_at_gmail.com>, relay=brindinfo_filter, delay=0.53, delays=0.37/0/0/0.16, dsn=2.0.0, status=sent (delivered via brindinfo_filter service)
Aug 14 12:00:25 r25640 postfix/qmgr[16510]: 765FD811B8: removed
How can I make postfix to perform normal mail delivery after the ruby script has finished (always with exit status 0 : ok) ?!
Any Idea please ?!