LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Postfix Pipe ending, final delivery not performed ! (https://www.linuxquestions.org/questions/linux-server-73/postfix-pipe-ending-final-delivery-not-performed-747503/)

guy_lux 08-14-2009 05:14 AM

Postfix Pipe ending, final delivery not performed !
 
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 ?!

Berhanie 08-14-2009 06:13 AM

Have you looked at this? Notice that in the sample filter, mail is explicitly resubmitted using the sendmail command.

guy_lux 08-15-2009 11:59 AM

Yes, thank you, but althought I took sometime to dig in that document, I can't get things to work properly. Basically, I'm a web and Ruby on Rails developer, and not a sys admin. It would be great if someone could give me a little help about how things works in postfix and particularly the filters functions.

Any help highly appreciated


All times are GMT -5. The time now is 10:13 AM.