[wplug] Re: [wplug]Anti-Spam
Nate Sharadin
nps5+ at pitt.edu
Fri Sep 13 02:24:58 EDT 2002
That's sick.
Nate Sharadin
nps5 at pitt.edu
On 9/12/02 3:21 PM, "Henry Umansky" <hmust2+ at pitt.edu> wrote:
> I think I solved the problem. It took a massive regex but it works. I had
> to really read RFC 821 and understand the CFG. But here's the regex:
>
> $header =~ /Received: from
> .*\[(\d?\d?\d\.\d?\d?\d\.\d?\d?\d\.\d?\d?\d)\].*?;.*?(\d?\d \w\w\w
> \d?\d?\d\d \d\d:\d\d:\d\d.+?\r\n)/si
>
> I need to clean it up a bit but it works.
>
> --On Wednesday, September 11, 2002 2:51 PM -0400 Henry Umansky
> <hmust2+ at pitt.edu> wrote:r
>
>> Well actually here's my problem, I have this webpage where a user enters
>> the full email (w/ headers) into a textbox then submits the form. The
>> form goes to a perl script that I want to parse the email and seperate
>> the body from the email. After reading in the POST variables and putting
>> the full email into a variable called $email I try to seperate the body
>> from the email like so:
>>
>> @email = split(/\r\n\s*\r\n/, $email);
>> $header = $email[0];
>>
>> Now this is where I get stuck. I want to be able to extracted the
>> Received headers (which can reside on multiple lines) and extract the IP
>> address, usually encased with brackets, then extract the time and date.
>> I know this is not a Linux-specific question, but it is an open-source
>> question. I'll also post to the perl newsgroup, but I just wanted to
>> know if anyone on this list dealt with this as well.
>>
>> -Henry
>>
>> --On Wednesday, September 11, 2002 2:23 PM -0400 Henry Umansky
>> <hmust2+ at pitt.edu> wrote:r
>>
>>> Does anyone know of any Perl script that can parse email messages (header
>>> & body), find out the IP address of the sender, and the date and time the
>>> email was sent? Almost similiar to what Spamcop.net does.
>>>
>>> -Henry
>>> _______________________________________________
>>> wplug mailing list
>>> wplug at wplug.org
>>> http://www.wplug.org/mailman/listinfo/wplug
>>
>>
>>
>> Henry Umansky
>> University of Pittsburgh
>> Systems/Programmer III
>> www.pitt.edu/~hmust2
>> hmust2 at pitt.edu
>> (412)624-4357
>>
>> _______________________________________________
>> wplug mailing list
>> wplug at wplug.org
>> http://www.wplug.org/mailman/listinfo/wplug
>
>
>
> Henry Umansky
> University of Pittsburgh
> Systems/Programmer III
> www.pitt.edu/~hmust2
> hmust2 at pitt.edu
> (412)624-4357
>
> _______________________________________________
> wplug mailing list
> wplug at wplug.org
> http://www.wplug.org/mailman/listinfo/wplug
>
More information about the wplug
mailing list