procmail
[Top] [All Lists]

Re: (blocking mail with) no subject

2000-11-11 12:59:07
Joao Paulo Andrade asked,

| this is easy...
| how can i block an e-mail with empty subject????

It's not so easy.  Or rather, it's easy, but it's not so simple, because we
need to know more.

Does that include mail with no subject line at all?
Does it include mail with whitespace characters in the subject header's
 contents but no visible characters?

That's four interpretations of your question.  Each of the solutions is easy,
but we need more details.  So here are all four.

1. This will catch mail with no subject line, mail with an empty subject
header, and mail with only whitespace in the subject:

  :0: # brackets enclose caret, space, tab
  * ! ^Subject:.*[^     ]
  subjectisemptyorblankormissing

2. This will catch mail with an empty subject header, but mail with no sub-
ject line and mail with anything (except one lone space) after "Subject:"
will sail past:

  :0:
  * ^Subject: ?$
  subjectisempty

3. This will catch mail with empty or blank subjects, but mail without any
subject header line will get past it:

  :0: # brackets enclose space and tab
  * ^Subject:[  ]*$
  subjectisemptyorblank

4. This will catch mail with an empty subject or no subject line at all, but
a message with a subject consisting only of whitespace will slip through
(unless the whitespace is a single space after the colon and nothing more,
which I'm treating as equivalent to emptiness).

  :0:
  * ! ^Subject:.*(.+ |[^ ])
  subjectisemptyormissing

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