[Thamesvalley-pm] calling all Perl newbies!
Richard Dawe
rich at phekda.gotadsl.co.uk
Tue Aug 21 09:30:52 PDT 2007
Hi Greg,
Greg Matthews wrote:
> Richard Dawe wrote:
>> Have you tried using the Email::* modules? They are a lot simpler to use
>> than some of the other modules I've seen. They are part of the Perl
>> Email Project (PEP) -- see:
>>
>> http://emailproject.perl.org/wiki/Main_Page
>
> I've certainly looked at the PEP site but I must admit I started with
> the Mail::Tools and in particular MIME::Parser
>
> The problem was that the suspect message is tagged as spam and delivered
> to the user as an attachment to a message (which says something like we
> believe the attached message to be spam). The users should then forward
> all of this message as an attachment to particular mailbox. My perl
> script would have to take each individual message in that mailbox,
> explode it and find the original message (and any attachments that had)
> and extract it.
So is the message sent to the user something like this?
multipart/mixed
+- text/plain part containing the "we think this is spam" text
+- message/rfc822 part containing the original (suspected) spam
When the user forwards the message, what are you expecting? From the
list of clients, I guess it could be anything. Are you hoping for
something like this?
multipart/mixed
+- text/plain part containing whatever text the user added on forwarding
+- message/rfc822
+- text/plain part containing the "we think this is spam" text
+- message/rfc822 part containing the original (suspected) spam
[snip]
> The whole thing is complicated by the fact that our users use a variety
> of mail clients and servers (groupwise, exchange, lotus, outlook,
> thunderbird, opera etc) which each do odd things (apprently opera cannot
> forward a message as an attachment for example, Exchange has the
> annoying habit of stripping almost all headers, and GW is a law unto
> itself).
You have my sympathy there. I had to play "guess what the original
message headers were" often at $OLD_JOB.
> I'll try it again sometime when I have time and perhaps I'll try the
> PEP-recommended modules. The job of a sysadmin after all, is to automate
> everything!
Give me a shout if I can help at all, when you get round to it.
Bye, Rich =]
--
Richard Dawe [ http://homepages.nildram.co.uk/~phekda/richdawe/ ]
"You just amass stuff while you are alive. It's like stuff washed up
on a beach somewhere, and that somewhere is you." -- Damien Hirst
More information about the Thamesvalley-pm
mailing list