Hi there, I'm trying to build my own content filter so I can actually filter outgoing messages and take appropriated actions upon spam messages.
After some time I was able to make postfix send messages to the content filter. The documentation says that content_filter expects a "transport:maps" response. The content_filter configuration parameter expects a value of the form > transport:destination. The transport name specifies the first field of a > mail delivery agent definition in master.cf; the syntax of the next-hop > destination is described in the manual page of the corresponding delivery > agent. My script just returns "ACCEPT" as the content_filter action. The thing is that the messages are then gone after the content_filter receives it. Looking my log files: Jan 4 13:58:19 lab postfix/pipe[2025749]: 193EA13DB044: to=<xxx@xxx>, > orig_to=<xxx@xxx>, relay=post_queue_content_filter, delay=0.11, > delays=0.09/0/0/0.02, dsn=2.0.0, status=sent (delivered via > post_queue_content_filter service (action=PERMIT)) After that, the message is gone. So I kindly ask you guys how can I re-inject message back into queue. Another question is how to postpone a specific message when re-injecting it to queue. For example: the filter will accept the message but hold it for 5 minutes before delivering it to final destination. [master.cf] smtp inet n - n - 30 smtpd > -o content_filter=post_queue_content_filter:dummy post_queue_content_filter unix - n n - - > pipe user=iagente argv=/home/postfix/app/tools/contentFilter.php > /usr/sbin/sendmail -oi -f ${sender} ${recipient} Note that I've added at the last line a sendmail call. That was copied from another server running spamassassin (which ijnects message back to queue after content analysis). I'm still trying to understand the right way to do it. Any help would be much appreciated. Thanks in advance. BR, Rafael