procmail
[Top] [All Lists]

Problem extracting from the from_ header

2002-07-08 17:11:59

Having looked at RFC 2822 and, as Pine allows me to do it, I think it is
legal, I send myself an email from my test account, from "@ @"@clifford.ac

So the actual from_ header is:

  From "@ @"@clifford.ac  Mon Jul  8 23:28:43 2002


I assume it is the space that is the cause of my problems.  As I
understand it, the quoted local part of an address could include CRLF as
well.  Problem 1 below, concerning the date is the most important to me.
And I am totally at a loss with problem 4 if the local part contained a
newline.



Problem 1:

To extract the date, I am using:

#### The From_ date ###################
# remove the variable
FROM_SECS
: 0
* ^^From [^      ]+[     ]+\/.*
{
   FROM_SECS=`date --date "$MATCH" +%s`
}
# check for missing or bad date outside the recipe
FROM_SECS=${FROM_SECS:-"Bad date"}
######################################

The procmail log shows:

  date: invalid date `@"@clifford.ac  Mon Jul  8 23:28:43 2002'






Problem 2

I am not using the address from the from_ header at the moment, but using:

#### The From_ header ###################
: 0
* ^^From[       ]+\/[^  ]+
{ FROM_HEADER=$MATCH }

LOG="${NL}From_: ${FROM_HEADER}${NL}"
#########################################


I get a log of

  From_: "@





Problem 3

Formail fails, presumably when it tries to create the reply header.  Or
mybe it is sendmail.  But it seems to recover from this and sends off the
autoreply, so not too much of a problem.


Log is:


procmail: Program failure (67) of " (formail -rtz -A"X-Loop:
antispamcheck(_at_)clifford(_dot_)ac" \
        -I"Precedence: junk" \
        -I"X-Message-Flag: Mundungus Spam Guard" \
        -I"From: ${AUTOREPLYFROM}" \
        -I"Bcc: ${AUTOREPLYFROM}" \
        -I"Subject: Re: ${OLDSUBJECT} (password is
${MUNGEDANTISPAMPASSWORD} - please remove the question marks) " \
                -I"Reply-To: ${AUTOREPLYTO}"; \
        cat $AUTOREPLYFILE1 ) \
        | $SENDMAIL -oi -f ${AUTOREPLYFROM}  -t"






Problem 4

Before the autoreply is sent, a check is made against the "grey" list to
see if an autoreply has been sent recently.

The greylist is a text file in this form:

custserv(_at_)alldomains(_dot_)com
"@ @"@clifford.ac
"@ @"@clifford.ac

The check for the grey list is:

* $ ! ? echo ${FROMHEADER} | grep -F -isx -f $PMDIR/list.grey


This check has failed, the FROMHEADER was put in the greylist again and
the autoresponder triggered.








Alan

( Please do not email me AS WELL as replying to the list. Personal
  email may invoke a password autoresponder. )



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