procmail
[Top] [All Lists]

Re: address without `@'

2001-07-04 00:03:34
On Tue, 3 Jul 2001, Gerardo Herzig wrote:
I'm trying to filter those emails who don't have @ in the ^From
section.

Why this does not work?

:0
* !^FROM(_dot_)*(_at_)(_dot_)*
! ihateyou

There are a couple of things that caught me unawares back when I was
coding procmail recipes; procmail regexps are different than unix
shell regexps, so in your test line, you are saying "select any line
that doesn't start "FRO" and with one or more Ms followed by any
number of @ signs.  The period represents one or more of the preceding
character.  It will also select any line that begins with "From" or
"from", etc., so you probably ought to include the colon, to keep it
specific to the mail-header "From:" Also, it isn't necessary that you
check for the trailing characters on a line, as you seem to be trying.
You might replace that line with:

* !^From: .*\@

I'm on a Windoze machine, so I can't check my man pages, and I am not
certain whether or not to escape (quote) the @ sign, but it ought not
to hurt.

Also, in th action line, why are you sending (forwarding) the message
to an account called "ihateyou"?  Did you mean to write it to a file?
If so, drop the leading !.

Steve

-------------------------------------------
E-mail: 
   Home:  steveh(_at_)iname(_dot_)com
-------------------------------------------


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