procmail
[Top] [All Lists]

Re: "domain.tld" from From:-headline

2003-01-05 17:00:17
Joerg Frings-Fuerst <j_ff(_at_)gmx(_dot_)de> wrote:

#
# Get the From-Domain
#
:0w
* ^From: [^(_at_)]+@\/[^ ]+
    { DOMAIN=3D$MATCH }

If the address is <foo(_at_)foo(_dot_)fo> I got "foo.fo>".=20
How can I kill the leading ">" ?

But "leading," I take it you mean "trailing."  Anyway,

        :0  # in the square brackets are a caret, space, tab, >, and )
        * From:(_dot_)*(_at_)\/[^       >)]+
        { DOMAIN = $MATCH }

You didn't need the w flag.  I don't see any good reason to
select the first @ from multiple that might be on the line
(inappropriate though that would be), so took out the [^(_at_)]
stuff.

You could also do it this way:

        :0
        * From:(_dot_)*(_at_)\/[a-z0-9.-]+
        { DOMAIN = $MATCH }

-- 
dman


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