Hello, I would like that Postfix calls my PHP script before it accepts a message with code 220. So smtpd would get the message, once the sender has sent the command DATA and ., it should then call my PHP script. The script will parse the email content with header and body, so some thing, and if it exits with exit code 0, then smtpd should respond with: 220 OK other exit codes like 1 should produce 550, 2 450 etc.
Additionally, after the PHP script has been executed, postfix has no more to queue the mail or do other processings. You may ask why I'm not writing directly a SMTP daemon in PHP? Its because I don't want to code the complete socket handling and all SMTP protocol options. Is there a way to create this hook before the message has been accepted? -- Best regards, Peter Bauer Linux & UNIX developper