Re: exim - what is it? (how does it run)
"Bob Goldberg" <bobg.hahc@gmail.com> writes:
>
> What exactly IS exim?
> IOW: when I setup sendmail, I'm working with bash scripts.
> when I setup an exim conf file - what exactly runs it? perl?
The exim configuration file is written in an Exim-specific language
parsed by nothing but Exim. It is documented in the Exim manual,
though not always very well. General syntax is documented in the
section "The Exim run time configuration file" or "The Exim
configuration file", documentation on the "${lookup...}" expansion is
available in the section "String expansions", and specific types of
lookups are documented in the section "File and database lookups".
The general syntax for a "lookup" is:
${lookup{key}lookuptype{On success}{On failure}}
So, for your example,
data = ${lookup{$local_part@$domain}lsearch{/etc/exim4/email-accept}
{:fail: User unknown }}
your {:fail: User unknown} block is being expanded on *success*. That
is, this code looks up the expansion of "$local_port@$domain" in
"/etc/exim4/email-accept", and---if it is found---sets data to ":fail:
User unknown", which is exactly the opposite of what you want.
This is probably being used in a "redirect" router. If the sole
purpose of this router is to reject email addresses that don't appear
in "email-accept", then:
data = ${lookup{$local_part@$domain}lsearch{/etc/exim4/email-accept}
{}{:fail: User unknown }}
might work. Now, if the lookup succeeds, the data is set to the empty
string, and the router will decline to process the address, leaving it
for a different router (to deliver, for example). If the lookup
fails, the router will process a :fail: redirect with the given error
message.
Taking a step back, though, I'm not so sure writing your own Exim file
from scratch, as you seem to be doing, is the best way to get Exim
"working". It's much easier to start with a barebones configuration,
such as one of the stock configurations generated by Debian, and tweak
that as necessary.
--
Kevin Buhr <buhr+debian@asaurus.net>
Reply to: