procmail
[Top] [All Lists]

Re: sending valid 'from' field to perl script.

1996-06-07 08:29:49

Hello, and thanks for such a thorough reply!  My question is now quite 
focused because of it.

The problem now is that I cannot determin the "original" sender of the 
mail message with the following code due to the fact that the incoming 
mail has been forwarded before it reaches the mail processing script.

    if ($line =~ /^From: (.*)$/) {
        $from = $1 ;
        if ($from =~ /<(.*)>/) { $from = $1 ; } 
        else { $from =~ s/(\S+)\s(.*)$/$1/ ; }
        $from =~ /(.*)\@(.*)/; 
    }

This code will extract the last sender which, as I piece together 
formatting standards, is shown by the colon directly after "From".
It seems that the original sender's address is marked with a line 
beginning with "From <address> <date> ..." without any colon.  If it is 
as simple as removing the colon in the extraction code then there is no 
problem, but I have doubts.

Thanks again for your help,

Benjamin G. Benson
President

-----------------------------------------------------------------------
| Spiderline Consulting        Web Development & Recruiting Services  |
| ------------------------------------------------------------------- |
| 2081 West Hwy 89A, Ste 1-B   tel: 888-282-2765   
ben(_at_)spiderline(_dot_)com |
| Sedona, Arizona 86336-5428   fax: 520-204-5872   www.spiderline.com |
-----------------------------------------------------------------------

<Prev in Thread] Current Thread [Next in Thread>