Re: [Exim] Sending Messages to /dev/null

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Phil Pennock
Datum:  
To: Martin Cameron
CC: exim-users@exim.org
Betreff: Re: [Exim] Sending Messages to /dev/null
On 2001-11-12 at 15:19 -1200, Martin Cameron wrote:
> Is there a script that will allow us to send unwanted email to
> /dev/null.


An infinite variety. Depends upon what condition you want to use, to
decide to send the mails to the bitbucket.

> We host a domain that is very similar to another ISP's domain. As a
> result, we get a lot of email coming to us bound for them which we
> simply want to pipe to /dev/null.
>
> Anyone got any ideas.


Lots, but I don't know which are relevant because you don't give any
information as to how you want to decide _which_ mails to send to
/dev/null.

Any for unknown users? Any for a certain list of users? Some other
condition? Easily expressed based upon recipient and/or headers, or
based upon content?

I don't have a magic wand to create scripts which psychically figure out
which mails to delete, otherwise I might offer to lend it to you.


If it's a simple condition, eg "any unknown user", then no script is
needed and it can trivially be done as part of the Exim config. Just
point the mail at the file /dev/null; Exim is even smart enough to spot
"/dev/null" as a special case and to just discard the mail, saving some
system calls. :^)

Simplest way, for the simplest case, would be to define a transport:

devnull:
driver = appendfile
file = /dev/null

and then a new director which uses that transport. Eg, to catch any
remaining users, as the very last director have:

silently_junk_unknown:
driver = smartuser
transport = devnull

Then there are all sorts of different things you can do to refine this.
Exim is very powerful and flexible, yet sane and readable too. You
could trivially have a file with a list of undesired local-parts, one
per line. Or junk if a certain header is present, or any number of
other things.

Take a look around:
<http://www.exim.org/docs.html>
The "Exim Specification" and the FAQ are especially useful. The Spec is
also available in plain text, as part of the Exim distribution, in
doc/spec.txt

HTH,
--
C program run. C program crash. C programmer quit.