procmail
[Top] [All Lists]

Procmail help request with recipe and errors.

2003-12-05 12:20:53
Hi,
        This is my first post to the list, thank you for having me. 

I am seeking some help with Procmail, and this looks like the best place to
get it.

Please excuse my ignorance, and thanks for any help I get.

I am using Procmail to pipe mail through spam assassin, filter for
attachment types, and handle a couple small other things. I am getting some
errors that I don't understand and I am also having some problems with
understanding how Procmail/Sendmail handle entry's in the virtusertable for
my email aliases and virtual domain email.

The filtering seems to be working, because it is refusing to accept the
attachments, it is sending the meaningful error message, and it is deleting
the original email. Spam assassin is working, at least for real accounts
(not virtual aliases). The only real problem is the weird error messages in
the log file (which is keeping me up at nights). I must admit, I do not
fully understand Procmails flags, or some of the syntax. I'm going to
presume I have a syntax error somewhere, but for the life of me I can't find
it. My question is: what is wrong with my recipes that make them log these
errors (see log file posted below)? What did I do wrong? If it is wrong, and
I get errors in the log file, why is it still working?

The second issue I have is how do I get Procmail to filter virtual address's
(if it's even possible). It seems that when sendmail is done processing the
virtual address, Procmail never even sees it unless the alias in the
virtusertable points to a local account. This is probably because Procmail
is the local delivery agent and only gets invoked on local deliveries eh? Is
there anyway to force procmail to scan all email that passes through the
system, not just email that is local? (I want to pipe all mail through the
attachment filter and spamassassin for my clients, even mail aliased to
another system i.e.: user(_at_)mydomain(_dot_)tld  sent to 
user(_at_)theirdomain(_dot_)tld)

Finally, what is wrong with my recipe that I get the weird spamassassin
error? "Cannot write to /dev/null/.spamassassin/user_prefs: Not a
directory". Does this look like a Procmail error or a Spamassassin error?
Obviously it can't find /dev/null as a directory, but why is it even looking
there?

Please don't flame the n00bie *grin*, I'm sure I left out some important
information... Any help would be great. I replaced the actually domain with
"domain.tld" in the following as well as removed a couple usernames for
privacy reasons. Please let me know if you need further information to help
in the diagnosis.

Here is my /etc/procmailrc file.

SHELL=/bin/bash
PMDIR=/etc/Procmail
LOGFILE=$PMDIR/pmlog
#LOGABSTRACT=all
VERBOSE=on
MAILDIR=/var/spool/mail/

INCLUDERC=$PMDIR/rc.attachment
INCLUDERC=$PMDIR/rc.emailsystemdelete
INCLUDERC=$PMDIR/rc.fromfilter
INCLUDERC=$PMDIR/rc.zipfilter
INCLUDERC=$PMDIR/rc.spamassassin

Here are the Include file recipe's:

rc.attachment

:0
* ^Content-Type: multipart/.*
* B ?? ^Content-(Type|Disposition): \
.*;.*($.*)?\
name=.*\.
(ade|adp|asd|bas|bin|chm|cil|cmd|cpl|crt|dll|dot|drv|eml|hlp|hta|inf|ini|ins
|isp|jse|mdb|mde|msc|msi
|msp|mst|net|nws|ocx|pcd|pif|pps|pwl|reg|rm|sct|shb|shm|shs|src|sys|vb|vbe|v
xd|wfs|wsc|wsh|xlt|scr|com|bat|pif|lnk|exe)(")?$
{
#Reply to sender with a meaning full error message
:0c: attachment.lock
| (formail -r \
-i"Subject: Returned email: Restricted attachment" \
-i"From: EmailSystems(_at_)domain(_dot_)tld" ; \
-A"X-Loop: adminstrator(_at_)domain(_dot_)tld" ; \
echo "MEANINGFULL ERROR" ; \
| $SENDMAIL -oi -t

#Throw the original email message in the bit bucket
:0
/dev/null
}

rc.emailsystemdelete

:0
* ^TO_EmailSystems(_at_)domain(_dot_)tld
/dev/null


rc.fromfilter

:0
* ^From_admin(_at_)domain(_dot_)tld
/dev/null

rc.zipfilter

:0:
* ^Content-Type: multipart/.*
* B ?? ^Content-(Type|Disposition): \
.*;.*($.*)?\
name=.message|readnow*\.(zip)(")?$
{
#Reply to sender with a meaning full error message
:0c: zipfilter.lock
| (formail -r \
-i"Subject: Returned email: Restricted attachment - message.zip or
readnow.zip" \
-i"From: EmailSystems(_at_)domain(_dot_)tld" ; \
-A"X-Loop: adminstrator(_at_)domain(_dot_)tld" ; \
echo "MEANINGFULL ERROR" ; \
| $SENDMAIL -oi -t
#Throw the original email message in the bit bucket
:0
/dev/null
}


rc.spamassassin

:0fw: spamassassin.lock
* < 256000
| spamassassin

#Handle bug in procmail that drops the F from the from header for some
reason
:0
* ^^rom[ ]
{
LOG="*** Dropped F off From_ header! Fixing up. "

:0 fhw
| sed -e '1s/^/F/'
}


Here is what I get in my procmail log file:


procmail: [18449] Thu Dec 4 15:30:55 2003
procmail: Assigning "MAILDIR=/var/spool/mail/"
procmail: Assigning "INCLUDERC=/etc/Procmail/rc.attachment"
procmail: Match on "^Content-Type: multipart/.*"
procmail: Match on "^Content-(Type|Disposition): 
.*;.*($.*)?name=.*\.
(ade|adp|asd|bas|bin|chm|cil|cmd|cpl|crt|dll|dot|drv|eml|hlp|hta|inf|ini|ins
|isp|jse|mdb|mde|msc|msi|msp|mst|net|nws|ocx|pcd|pif|pps|pwl|reg|rm|sct|shb|
shm|shs|src|sys|vb|vbe|vxd|wfs|wsc|wsh|xlt|scr|com|bat|pif|lnk|exe)(")?$"
procmail: Locking "attachment.lock"
procmail: Executing " (formail -r \
-i"Subject: Returned email: Restricted attachment" \
-i"From: EmailSystems(_at_)domain(_dot_)tld" ; \
-A"X-Loop: adminstrator(_at_)domain(_dot_)tld" ; \
echo "MEANINGFULL ERROR" ; \
| $SENDMAIL -oi -t"
/bin/bash: -AX-Loop: adminstrator(_at_)domain(_dot_)tld: command not found
procmail: Error while writing to " (formail -r \
-i"Subject: Returned email: Restricted attachment" \
-i"From: EmailSystems(_at_)domain(_dot_)tld" ; \
-A"X-Loop: adminstrator(_at_)domain(_dot_)tld" ; \
echo "MEANINGFULL ERROR" ; \
| $SENDMAIL -oi -t"
procmail: Assigning "LASTFOLDER= (formail -r \
-i"Subject: Returned email: Restricted attachment" \
-i"From: EmailSystems(_at_)domain(_dot_)tld" ; \
-A"X-Loop: adminstrator(_at_)domain(_dot_)tld" ; \
echo "MEANINGFULL ERROR" ; \
| $SENDMAIL -oi -t"
procmail: Unlocking "attachment.lock"
procmail: Assigning "LASTFOLDER=/dev/null"
procmail: Opening "/dev/null"
procmail: Notified comsat: "stucker(_at_)0:/dev/null"
From stucker(_at_)domain(_dot_)tld Thu Dec 4 15:30:55 2003
Subject: test3
Folder: /dev/null 
procmail: [19338] Thu Dec 4 16:43:46 2003
procmail: Assigning "MAILDIR=/var/spool/mail/"
procmail: Assigning "INCLUDERC=/etc/Procmail/rc.attachment"
procmail: Match on "^Content-Type: multipart/.*"
procmail: No match on "^Content-(Type|Disposition): .*;.*($.*)?name=.*\.
(ade|adp|asd|bas|bin|chm|cil|cmd|cpl|crt|dll|dot|drv|eml|hlp|hta|inf|ini|ins
|isp|jse|mdb|mde|msc|msi|msp|mst|net|nws|ocx|pcd|pif|pps|pwl|reg|rm|sct|shb|
shm|shs|src|sys|vb|vbe|vxd|wfs|wsc|wsh|xlt|scr|com|bat|pif|lnk|exe)(")?$"
procmail: Assigning "INCLUDERC=/etc/Procmail/rc.emailsystemdelete"
procmail: No match on
"(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):
(.*[^-a-zA-Z0-9_.])?)EmailSystems(_at_)domain(_dot_)tld"
procmail: Assigning "INCLUDERC=/etc/Procmail/rc.fromfilter"
procmail: No match on "^From_admin(_at_)domain(_dot_)tld"
procmail: Assigning "INCLUDERC=/etc/Procmail/rc.zipfilter"
procmail: Match on "^Content-Type: multipart/.*"
procmail: No match on "^Content-(Type|Disposition):
.*;.*($.*)?name=.message|readnow*\.(zip)(")?$"
procmail: Extraneous locallockfile ignored
procmail: Assigning "INCLUDERC=/etc/Procmail/rc.spamassassin"
procmail: Match on "< 256000"
procmail: Locking "spamassassin.lock"
procmail: Executing "spamassassin"
Cannot write to /dev/null/.spamassassin/user_prefs: Not a directory
Failed to create default user preference file
/dev/null/.spamassassin/user_prefs
procmail: [19338] Thu Dec 4 16:43:49 2003
procmail: Unlocking "spamassassin.lock"
procmail: No match on "^^rom[ ]"
procmail: From schmugo(_at_)domain(_dot_)tld Thu Dec 4 16:43:46 2003
Subject: 908ZIP
Folder: /var/spool/mail/username 

END LOG FILE

Thanks in advance for your time.

Shannon Tucker


I haven't lost my mind; it's backed up on tape somewhere.



_______________________________________________
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>