Re: [exim] filter and address book

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Phil Pennock
Fecha:  
A: Dennis Yurichev
Cc: exim-users, Mike Cardwell
Asunto: Re: [exim] filter and address book
On 2013-08-23 at 16:38 +0300, Dennis Yurichev wrote:
> Mike Cardwell <exim-users@???> writes:
> > The following in the DATA ACL would add an "AddressBook: true" header
> > to your email if the sender envelope or From address are in your
> > address book file.


> Thank you very much. I added this into .forward (dennis_inbox is an
> account for all emails not in address book text file):


Exim does not use one unified scripting language everywhere, and rules
are not picked up from "wherever" and made to work regardless.

Mike provided data for the DATA ACL, which is not part of a filter but
part of Exim's main configuration.

You can do the same thing in a filter file, but the structural framing
of the "warn condition" is not applicable. You want to look at:
http://www.exim.org/exim-html-current/doc/html/spec_html/filter_ch-exim_filter_files.html
for the filter language, change the framing to be an if/then/endif
block, and then drop the angle brackets <> from the email address.

  if ${lookup one ...}
  then
    deliver dennis_whatever@???
    finish
  endif
  if ${lookup the second ...}
  then
    deliver dennis_whatever@???
    finish
  endif
  deliver dennis_elsewhere@???


I recommend keeping the conditions separate, to make it easy to debug
what's going on, instead of trying to figure out how to combine and/or
operations.

To understand what most folks running Exim for multiple users would do,
which is what Mike was suggesting, then read on.

If you go to:
http://www.exim.org/exim-html-current/doc/html/spec_html/
then in chapter 3:
http://www.exim.org/exim-html-current/doc/html/spec_html/ch-how_exim_receives_and_delivers_mail.html
you want to read, at least, sections 1, 2, 3, probably 8, definitely 13.
That should give you enough mental framework to loosely understand what
you're changing.

I don't know which OS you're running; if it's Debian or Ubuntu, then
there's a README.Debian.gz in /usr/share/doc/exim4/ which will explain
something about how they build up an Exim configuration file; it's
designed for letting packages be able to add features automatically and
handle _common_ cases with some default template parameters, but not to
make it easy to start customising if you're not already familiar with
Exim.

For the default configuration file provided by Exim, then this
walkthrough:
http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_default_configuration_file.html
explains what's going on. Section 2 covers the ACLs, and you should be
able to piece back together how to change the ACL rules even if you're
using something not based on our default configuration.

So, using Mike's approach (which is a good one that scales to more
users) the "warn condition", and the header setting, needs to be applied
in a DATA ACL.

-Phil