Re: [Exim] \dev\null

Góra strony
Delete this message
Reply to this message
Autor: Simon Alman
Data:  
Dla: Thomas Kinghorn
CC: Exim-Users (E-mail)
Temat: Re: [Exim] \dev\null
Thomas Kinghorn wrote:

>Morning all.
>
>hope everyone had a great weekend.
>
>Is there a way to \dev\null users who are no longer with our company?
>All the mail is relayed to our exchange server which tosses the mail if
>the user does not exist.
>
>I was wondering if exim could do it before it got to the exchange server?
>
>many thanks.
>
>Regards,
>Tom Kinghorn
>

Hi

I'd just use a system filter to drop any addresses I don't want
delivered i.e create a system filter file with the following:

> if $header_to: contains <some address you dont want>
> then
> seen finish
> endif



This simply drops any matching mail with no further actions -
essentially the same as piping to /dev/null.
If the list gets very long then you can specify your filter to be an sql
query rather than a single file - I guess it depends what scale you are
working on - for me and the company I work for we don't need to use a
database yet.

For filters to work you need to make sure you have set up a rule for
them in the exim config i.e:

> #filters:
> system_filter = /usr/exim/system_filter
> system_filter_user = exim
> system_filter_file_transport = address_file


You can stick this line anywhere in your config - I just put it at the top.

I'm sure there are other ways you can drop mail from users - you could
probably even block it at the ACL (access control list) level i.e.
during the smtp session (not sure if this is a good thing or not ...),
but I use the above and it works fine for me.

Since the exim system filter is called before the routers then you can
filter prior to sending the remaining mail onto your exchange server for
further processing and delivery.

I hope this helps

Regards

Simon Alman