Re: [exim] Explanation of Exim's behaviour when doing a line…

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Ted Cooper
Fecha:  
A: pmcilfatrick
Cc: exim-users
Asunto: Re: [exim] Explanation of Exim's behaviour when doing a linear lookup of 'recipients' in a flat file
Paul McIlfatrick wrote:
> I was made postmaster of an existing Exim system and after a few weeks I
> upgraded it to version 4.63 and then introduced a linear lookup of a flat
> file which I created so that e-mails for those who have left the company
> will be discarded early in the SMTP dialogue. In the Exim config file I
> added the following line in the acl_smtp_rcpt ACL:
>
> deny   recipients    =     lsearch;/etc/exim/reject-list

>
> and the lines in the reject-list file are of the format:
>
> aperson@???:    :departed:

>
>
> What I find is the lookup works if the localpart of the full e-mail that is
> in the flat file is also defined in a static.aliases file (e.g. aperson:
> :blackhole:). The config file only refers to the static.aliases once.
>
>
> If I remove the definition from the static.aliases file and restart Exim
> then the linear lookup of the flat file for aperson@??? fails!
> Restoring the definition to the static.aliases file and restarting Exim
> results in the lookup working again.
>
>
> Could any of you experts enlighten me as to what is happening?

Can I try anyway?

Assuming you have something like the default config file, your lsearch
looking isn't looking up anything and all of the work is being done by
the :blackhole: in the aliases file. It's simply being bit bucketed with
sender thinking that the message made it.

If you just want to fail certain addresses, you can still use the alias 
file which will be trigged on the "verify = recipient" line of your rcpt 
ACL. Use something like
peter:        :fail: This person no longer works here


They are both just linear flat file searches so they are equally
fast/slow depending on the file size (1000+ entries and you probably
look into making them into a db4 file instead).

If you still really want to do it with an lsearch, you'll want to see 
what is really happening when the mail is coming in. Best way would be 
to fake an SMTP session and use the "exim -bh 11.22.33.44" command line 
to debug what exactly is happening. When you run that command the 
program will treat you like the supplied IP, so you have to do the HELO, 
MAIL FROM:, RCPT TO:, etc stuff.
You best bet for getting this working is to keep reading the lsearch 
part of the manual as it has a lot of options.. the only thing I use it 
for, in combination with "recipients = " is a @@lsearch of a file in the 
form of
domain.com:    person1,person2,person3
domain2.com:    person4,person5,person6,person7
The @@ is a special case lookup.
I use that particular search to collect all my spamtraps from multiple 
domains into the one account and "control = fakereject" them.


Ted.