On 11/08/2010 06:43 PM, Bruno Costacurta wrote:

Why procmail is not executed ? Is there some priority or dependencies
for mailbox_command execution ?

Yes: the mail has to be delivered to a mailbox.
You are delivering mail to spamassassin.

You confused me : spamassassin leaves the messages for local delivery
via /usr/local/sbin/sendmail -i "$@"

Yes, I did.
However, you did not provide your entire flow setup, so it was not
completely transparent to me that you were using spamassassin as a
content_filter.
You did show logs that show spamassassin is processing the mail, but I
never saw the config for re-injection, so there was no reason to suppose
that procmail was ever getting hit.

And indeed everything works fine except the missing filtering via
Procmail.
(note : I'm using virtual users).

I know, that's why it doesn't work.
Virtual mailboxes can not run commands, as I already indicated.


More generally, is mailbox_command mandatory ?

No, it's not mandatory.
It is empty by default.

Can I replace it using in master.cf a syntax like following :

smtp   inet  n - n  -  -  smtpd -o content_filter=procmail:filter

where procmail service will call, via shell script, spamassassing
before doing its filtering, and do I can avoid the need of
mailbox_command.

No, procmail is not a "service".
You have to create one and then deliver to it:

myprocmail unix  - n n - - - pipe user=your.virtual.user argv=procmail
- -a $RECIPIENT -a $EXTENSION [-a $MORE_VARS...]

And then either set the virtual_transport to myprocmail or use
transport_maps for more granular control.

NOTE that procmail MUST deliver the message in this case!
If the message "falls out the bottom" of your recipe, it's GORN.

- --
J.



Thanks for your help. It works now.
Indeed virtual_transport need to be setup, not mailbox_command as virtual users are used in my Postfix setup.

in main.cf :
...
virtual_transport=myprocmail
...

in master.cf :
...
smtp      inet  n       -       -       -       -       smtpd
  -o content_filter=spamfilter:dummy

spamfilter unix - n n - - pipe
flags=Rq user=spamfilter argv=/usr/local/bin/spamfilter.sh -f ${sender} -- ${recipient}

myprocmail  unix  - n n - - pipe
flags=DRX user=spamfilter argv=/usr/bin/procmail ... temporary : other procmail params still need to be fixed here ...
...

Bye,
Bruno

--
Linux Counter #353844
http://counter.li.org/



----------------------------------------------------------------

Reply via email to