I have an email message that wraps the Subject line, and I want to put it
back together again.
Received: from (mail.txcc.org) [209.160.147.30]
by dispatch.internet-tools.com with esmtp (Exim 2.11 #1)
id 132wBt-0006jO-00; Fri, 16 Jun 2000 13:29:45 +0000
Received: by CCTX with Internet Mail Service (5.5.2448.0)
id <MA2XL02V>; Fri, 16 Jun 2000 08:25:57 -0500
Message-ID: <91451F85A3D2AA0008C733D1FE1CE2F4(_at_)CCTX>
From: Mark <mdm(_at_)internet-tools(_dot_)com>
To: <techie-request(_at_)dispatch(_dot_)internet-tools(_dot_)com>
Subject: Re: X-Command maintaner password subscribe
elxtina(_at_)xxitqfrazatronixx(_dot_)co
m
Date: Fri, 16 Jun 2000 08:25:56 -0500
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)
Content-Type: text/plain;
charset="iso-8859-1"
The Subject line has a newline, tab, letter "m", newline at the end.
I want to squeeze that all back together, with no spaces so it becomes a
valid email address.
I understand that Procmail unfolds the headers when doing matching.
However it seems to leave a space for the initial newline.
I have tried the following recipes without success.
:0 h
* ^Subject: [ ]
* ^Subject: \/.+
{
SUBJECTLINE = `echo $MATCH | tr --delete '\n\t'`
:0fh
| formail -I"Subject: $SUBJECTLINE"
}
which gives the following result
procmail: Assigning "MATCH="
procmail: Matched "X-command: maintainer passwd subscribe
elxtina(_at_)xxitqfrazatronixx(_dot_)co m"
procmail: Match on "^Subject: \/.+"
procmail: Executing "echo $MATCH | tr --delete '\n\t'"
procmail: Assigning "SUBJECTLINE=X-command: maintainer passwd subscribe
elxtina(_at_)xxitqfrazatronixx(_dot_)co m"
procmail: Executing "formail,-ISubject: X-command: maintainer passwd
subscribe elxtina(_at_)xxitqfrazatronixx(_dot_)co m"
which leaves a space in the dot com ending.
or
:0 fhw
* ^Subject:
* $[ ]
| sed -e '/^Subject:/{
N
s/\n[ ]+//
}
'
This should not be so difficult. Is there a standard and well known recipe
to accomplish this.
Thanks for any insight.
mark
mark david mcCreary
Internet Tools, Inc. 1436 West Gray #438
mdm(_at_)internet-tools(_dot_)com Houston, Texas 77019
http://www.internet-tools.com 713.627.9600
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail