procmail
[Top] [All Lists]

Re: mutilple @ in From:-field

2001-03-14 08:56:58
On 13 Mar, Ralf(_dot_)Gross(_at_)STZ-Softwaretechnik(_dot_)de wrote:
| Hi,
| 
| our company is changing from M$ Exchange to LotusNotes (don't know if I
| should laugh or cry...). At the moment there is a forward from the new
| NotesAccount to our old Exchange mailbox, where we (LinuxUsers) fetch our
| mail via IMAP. Since mail is forwarded to the Exchange Server there are
| multiple @ that are added to the From: Field. It looks like this:
| 
| bar(_dot_)foo(_at_)ourdomain(_dot_)com@domain(_at_)other_domain (domain and 
other_domain are
| always the same...)
| 
| The reponsible people told us that this is a problem with the "notes
| connector" (or whatever). Now I'm looking for a way to filter the part
| after foo(_dot_)bar(_at_)domain(_dot_)com at the beginning of my procmailrc, 
that the
| From:-field is displayed correctly.
| 
| Any idea?

I'm not sure I understand this. In your example above is
"bar(_dot_)foo(_at_)ourdomain(_dot_)com" the content that you want remaining? 
If so,
this should work:

:0
* ^From:\/[^(_at_)]+@[^(_at_)]+
{
  NEWFROM=$MATCH
  :0fhw
  | formail -i "From:$NEWFROM"
  :0:
  $DEFAULT
}

Note there is no space in "From:$NEWFROM", the expected space is there
from the match operator on the condition line above. This will preserve
an Old-From: field. If that's unnecessary change the -i to -I.

If I haven't understood correctly, I think you need to answer the
following questions. If domain and other_domain are always the same,
they could be represented as "@domain(_at_)domain" right?  And are they
always the same for every message, or are they same for any one message
but vary from message to message?  Real examples with real domain names
are almost always preferable to fictional ones.

-- 
                         /"\
Don Hammond              \ /     ASCII RIBBON CAMPAIGN
Raleigh, NC US            X        AGAINST HTML MAIL,
                         / \      AND NEWS TOO

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