procmail
[Top] [All Lists]

Re: Recipe woes

2003-05-28 12:28:47
On 28 May, listuser(_at_)numbnuts(_dot_)net wrote:
| Howdy.  I'm having an awful time getting a recipe of mine to work.  I've
| gone through the FAQs and tips sites looking for examples and have
| thoroughly managed to confuse myself.  This recipe has been a
| work-in-progress for over a year now.  If anyone can point me in the right 
| direction, I'd greatly appreciate it.
| 
| The goal of this script is to munge my users' information from spam and
| forward it on to the FTC and NANAS as well as archive the spam locally.  
| I'm trying to munge all instances of my users addresses from both the
| headers and the body.  That part is relatively easy.  What I'm having
| trouble on is the quoting of the original message.  I need to quote the
| full headers and body of the original spam in the body of the new message
| (forward).  I haven't been able to figure that out.  I believe the munging
| is working.  Here's the state my recipe is currently in:
| 
| [...]

I snipped the procmail recipe because I don't have time to work with it
and it has nothing to do with my response.  Maybe someone else will
have some concrete ideas on how to do this with procmail/formail. I use
a shell script to do (close to) what you want to do.  I don't do any
automatic forwarding and am somewhat skeptical that can be done 100%
error free.  That's your call though.

My script encapsulates the headers and body of the original message in
a MIME message/rfc822 attachment, adds appropriate MIME-Version: and
Content-Type: headers to my forwarded message, and appropriate
boundaries, Content-Type: and Content-Description: within the body
surrounding the original message.  It also allows for an optional
Content-Type: text/plain attachment for additional comment at the top
of the message. AFAICT, this protects MIME parts in the message as
originally delivered. I've done enough testing with different mail
clients to believe it works, though not enough to represent it as
bulletproof.  I did not research any RFCs to make sure this was the
proper way to do this, but used DSNs as templates.

My guess is that it would be difficult to do directly from procmail. 
Off the top of my head, it seems you'd have to save orignal headers and
body to an external file, then use that file to create the
message/rfc822 attachment, adding the appropriate MIME stuff to make it
legit. Otherwise you get an improperly formed MIME message which
displays as plain text, including any boundaries etc. in the body of
the message.  It's ugly. You'd also use formail to add necessary headers
to the new message you're generating.  It may be easier to have an
external program do the whole thing.

If you'd like to see the script, mail me and I'll be happy to send it to
you.  As is, it requires the user to be one of sendmail's trusted
users because it uses sendmail -f to change the envelope sender. It may
give you some ideas that could help your procmail implementation, or it
may be adaptable to your needs to be executed from your procmail rcfile.

-- 
Email address in From: header is valid  * but only for a couple of days *
This is my reluctant response to spammers' unrelenting address harvesting



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