procmail
[Top] [All Lists]

Re: (no subject)

2000-12-20 22:23:02
=?iso-8859-1?Q?F=E1bio?= da Silva Cunha 
<fsc(_at_)vetorialnet(_dot_)com(_dot_)br> writes:
I use a perl script (recusanexo.pl) to reject executable attachments, all
works very fine, but i need to execute this script for all user\xB4s mail,
except for one user\xB4s mail (auditor), any ideas? 
...
********* My /etc/procmailrc :

VERBOSE=YES
DROPPRIVS=YES
LOGFILE=/var/log/proc01.log

You should probably reverse the order of those lines.  As is, the
/var/log/proc01.log file better be world-writable if you want it to
include the log output for everyone.


PATH="/usr/sbin:$PATH"

Hmm, is /usr/sbin not in procmail's default PATH?  What's the output of
the following command:

procmail LOG='PATH=$PATH' DEFAULT=/dev/null /dev/null </dev/null; echo


:0 HB
* 
.filename=\".*\.(exe|com|vbs|pps|bat|pif|js|shs|scr|chm|dll|hta|bas|lnk|isn|ade|adp|cmd|cpl|crt|hlp|inf|ins|isp|jse|mdb|mde|msc|msi|msp|mst|pcd|reg|sct|url|vb|vbe|wsc|wsf|wsh|jpg|gif|mov|qt|mpg|mpeg|ra|mp3|mp4|mod|mid)(=\?)?\"
| /etc/procmail.d/recusanexo.pl

If you want to exclude a user or group of users, just add a condition
that tests the LOGNAME variable:

        :0 HB
        * LOGNAME ?? ^^auditor^^
        * 
.filename=\".*\.(ad[ep]|ba[st]|c(hm|md|om|pl|rt)|dll|exe|gif|h(lp|ta)|i(n[fs]|s[np])|j(pg|se?)|lnk|m(d[be]|id|o[dv]|p([34g]|eg)|s[cipt])|p(cd|if|ps)|qt|r(a|eg)|s(c[rt]|hs)|url|vb[es]?|ws[cfh])(=\?)?\"
        | /etc/procmail.d/recusanexo.pl

I've reduced your file extension regexp to a form that procmail can
process faster.

The "^^"s anchor the regexp so that it must match the entire value of
LOGNAME, so that "auditor2" won't be excluded.  If you want to exclude
multiple users, use a form like:

        * LOGNAME ?? ^^(auditor|postmaster)^^


Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>