Operating System - Linux
1825900 Members
3419 Online
109689 Solutions
New Discussion

procmail filter to be used with sendmail

 
Sachin_48
Occasional Advisor

procmail filter to be used with sendmail

Dear All,

Hi I need to use the procmail filter with the sendmail .
But for that when I make the .forward file for the user (stest)
like

"|&&exec /usr/local/bin/procmail -f-||exit 75 #stest"

it gives error while sending any message to user as

stest... aliased to stest@mistest
/home/stest/.forward: line 1: forwarding to "|&&exec /usr/local/bin/procmail -f-||exit 75 #stest"
/home/stest/.forward: line 1: "|&&exec /usr/local/bin/procmail -f-||exit 75 #stest"... Address stest is unsafe for mailing to programs


Pls give any suggestion so that I can make the filter for the specific users for the particular mails.

Thanks & Regards
Sachin Rajput
HCL

1 REPLY 1
Stuart Browne
Honored Contributor

Re: procmail filter to be used with sendmail

Umm, sendmail on most modern systems already uses 'procmail' to deliver mail to a given end user. You can double check this with 'grep ^Mlocal /etc/mail/sendmail.cf' (it'll return something like 'Mlocal, P=/usr/bin/procmail, F=lsDFMAw5:/|@qSPfhn9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,')

So just use '~stest/.procmailrc' for your procmail rules, and don't worry about using a .forward to pipe through procmail.

In any case, some reasons why this didnt work:

- /etc/smrsh/procmail symbolic link doesn't exist
- '| && exec' is just.. just.. wrong. A simple '| procmail -f -' is what you're after.

One long-haired git at your service...