Many thanks to everyone who replied, inparticular;
Todd Herr
Reto Lichtensteiger
Sebastian Benoit
Claus Assman
Gerhard
Heidi Burgiel
Firstly my apologies for making my users sound like complete idiots. The
problem relates to an application which sends mail messages to the user
everytime the user does something.
This is the least of the applications faults and I have complained about
having to run such a piece to garbage on my server, but to no avail.
Secondly, the string "DO NOT SEND" was just an example. Even this app is
not so crass as to send messages containing the string "DO NOT SEND". I'
don't know what the users want to filter on yet. I guess its more likely
to be something like "Process Completed Successfully" or something
similar.
Anyway the replies I've had are summarised below;
* Sendmail cannot filter subjects or content
* Reto and Sebastian suggested using procmail as the local delivery
agent and creating the following rule
Rather than trying to filter in sendmail on sending, you might want to
consider using procmail as the local delivery agent and then using a
system wide procmail recipe to dump the unwanted mail to /dev/null.
Using procmail as LDA is supported by the m4 rules using "FEATURE
(local_procmail)".
You might then have the following in /etc/procmailrc:
:0
* ^From.*@<customer-domain-in-question>
{
:0
* ^Subject:.*DO NOT SEND
/dev/null
:0 B
* ()DO NOT SEND
/dev/null
}
First the recipe checks to see whether the message is _from_ someone
local -- naturally to be handled by the delivery agent, it would be
addressed _to_ someone local ... Then it runs one test for a matching
Subject: then a second test for a matching message body.
This will, of course only work in situations where such mail is being
+delivered+
* Sendmail can be configured just to dump messages into the mail queue
you can then use a shell script to filter the messages before sendmail
sends them out.
* Todd and Claus suggested some useful URLs
http://www.informatik.uni-kiel.de/%7Eca/email/chk-89.html
http://www.sendmail.org
* Gerhard made a very useful point
"the first option (refuse any email where the sender is also the
recipient)
will break any email coming from a lot of mailing lists (e.g. your own
message to this list would be refused by this new sendmail rule,since it
gets bounced back to you and is coming from you)."
Many thanks to the following for pointing out that my users are being
completely unreasonable. I always thought it went with the job
Michael Hill
Jason Marshall
Mark Sherman
Alex Goodson. (Original Message below)
Goodson Alex A had this to say:
>
> I've just built a server and the users are saying that mail must be
> configured to either not send any message that has the same sender and
> recipient or not send any message containing the string DO NOT SEND in
> either the Subject or Body of the message.
> I've had a look at the sendmail infodoc and am really none the wiser.
>
> Any help will be gratefully summarised.
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:45 CDT