[exim] alias lookup not working as expected

Inizio della pagina
Delete this message
Reply to this message
Autore: Phillip Carroll
Data:  
To: Exim-users
Oggetto: [exim] alias lookup not working as expected
Using the attached configuration, mail sent to valid alias "mercury" is
returned with:

550 Unknown user mercury

If I understand exim correctly check_local_user looks up $local_part as
a local user. Therefore, I added $local_part to the fail message in the
localuser transport to see what is being looked up. (With the resuilt
shown above) Given the fact that mercury is only an alias and not the
actual aliased user, that explains the failure of check_local_user.
Then I don't understand why the data assignments in the virtual_aliases
routers are not passing the actual user through to the localuser router.

The aliases file for mydomain looks like:
planets: planets
mercury: planets
*: :fail:

planets is a local user. mercury is purely an alias.

mail sent to mercury@mydomain receives: 550 Unknown user mercury
mail sent to planets@mydomain is stored in /var/spool/mail/planets

I am presently running an FC2 server under DA with similar routers and
transports that processes aliases perfectly. (Hasn't burped in several
years of use) Can anybody tell me what I screwed up in translating the
configuration to a CentOS 5.5 server? (I am not running DA on the new
server.) I am pretty well baffled.

I surmise since the email gets to the localuser transport, the issue is
not with dns or anything involving tcp/ip. I have tried running under
debug and it SEEMS to be routing as expected. It only fails when the
email arrives on the interface.

PhilC
# $Cambridge: exim/exim-src/src/configure.default,v 1.14 2009/10/16 07:46:13 tom Exp $
# Running exim.i386 4.63-5.el5 (from atrpms repo)
#      on CentOS 5.5 on Linux 2.6.18.8 kernel
######################################################################
#                  Runtime configuration file for Exim               #
#  default conf supplied by atrpms hacked to support domain/aliases  #
#       ala j lasman DA script for a similar file structure          # 
######################################################################


# Notes:   /etc/virtual/domains is a simple list of local domain names
#          /etc/virtual/$domain/aliases  is a snedmail-style aliases file
domainlist local_domains = lsearch;/etc/virtual/domains
domainlist relay_to_domains = lsearch;/etc/virtual/domains
hostlist relay_from_hosts = <; 127.0.0.1 ; ::1


# maintain consistency with DA logging
log_selector = \
+delivery_size \
+sender_on_delivery \
+received_recipients \
+received_sender \
+smtp_confirmation \
+subject \
+smtp_incomplete_transaction \
-dnslist_defer \
-host_lookup_failed \
-queue_run \
-rejected_header \
-retry_defer \
-skip_delivery \
+arguments
syslog_duplication = false

acl_smtp_mail = acl_check_mail
acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data
acl_smtp_mime = acl_check_mime

tls_advertise_hosts = *
tls_certificate = /etc/pki/tls/certs/exim.pem
tls_privatekey = /etc/pki/tls/private/exim.pem

daemon_smtp_ports = 25 : 465 : 587
tls_on_connect_ports = 465

never_users = root
host_lookup = *
auth_advertise_hosts =
rfc1413_hosts = *
rfc1413_query_timeout = 5s
ignore_bounce_errors_after = 2d
timeout_frozen_after = 7d

av_scanner = clamd:/var/run/clamd.exim/clamd.sock

######################################################################
#                       ACL CONFIGURATION                            #
######################################################################


begin acl

# -------------------------
acl_check_mail:
# -------------------------
#  commented this temporarily to simplify using debug:
#  deny condition = ${if eq{$sender_helo_name}{} {1}}
#       message = Nice boys say HELO first
  accept
# -------------------------
acl_check_rcpt:
# -------------------------
  accept  hosts = :
          control = dkim_disable_verify
  deny    message       = Restricted characters in address
          domains       = +local_domains
          local_parts   = ^[.] : ^.*[@%!/|]
  deny    message       = Restricted characters in address
          domains       = !+local_domains
          local_parts   = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
  accept  local_parts   = postmaster
          domains       = +local_domains
 #require verify        = sender
  accept  hosts         = +relay_from_hosts
          control       = submission
          control       = dkim_disable_verify
  accept  authenticated = *
          control       = submission
          control       = dkim_disable_verify
  require message = relay not permitted
          domains = +local_domains : +relay_to_domains
  require verify = recipient


  accept
# -------------------------
acl_check_data:
# -------------------------
  warn    condition  = ${if !def:h_Message-ID: {1}}
          set acl_m_greylistreasons = Message lacks Message-Id: header. Consult RFC2822.\n$acl_m_greylistreasons


  accept
# -------------------------
acl_check_mime:
# -------------------------
  deny message = Blacklisted file extension detected
       condition = ${if match \
                        {${lc:$mime_filename}} \
                        {\N(\.exe|\.pif|\.bat|\.scr|\.lnk|\.com)$\N} \
                     {1}{0}}


  accept
######################################################################
#                      ROUTERS CONFIGURATION                         #
######################################################################
# Note: aliases files used by the routers have standard aliases format


begin routers

# -------------------------
dnslookup:
# -------------------------
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more
# -------------------------
virtual_aliases_nostar:
# -------------------------
driver = redirect
allow_defer
allow_fail
data = ${if exists{/etc/virtual/${domain}/aliases}{${lookup{$local_part}lsearch{/etc/virtual/${domain}/aliases}}}}
file_transport = address_file
group = mail
pipe_transport = virtual_address_pipe
retry_use_local_part
unseen
#include_domain = true
# -------------------------
virtual_aliases:
# -------------------------
driver = redirect
allow_defer
allow_fail
condition = ${if eq {}{${if exists{/etc/virtual/${domain}/aliases}{${lookup{$local_part}lsearch{/etc/virtual/${domain}/aliases}}}}}{yes}{no}}
data = ${if exists{/etc/virtual/$domain/aliases}{${lookup{$local_part}lsearch*{/etc/virtual/$domain/aliases}}}}
file_transport = address_file
group = mail
pipe_transport = virtual_address_pipe
retry_use_local_part
# -------------------------
drop_solo_alias:
# -------------------------
driver = redirect
allow_defer
allow_fail
data = ${if exists{/etc/virtual/$domain/aliases}{${lookup{$local_part}lsearch{/etc/virtual/$domain/aliases}}}}
file_transport = devnull
group = mail
pipe_transport = devnull
retry_use_local_part
# -------------------------
system_aliases:
# -------------------------
driver = redirect
allow_fail
allow_defer
data = ${lookup{$local_part}lsearch{/etc/aliases}}
file_transport = address_file
pipe_transport = address_pipe
# -------------------------
localuser:
# -------------------------
driver = accept
check_local_user
transport = local_delivery
cannot_route_message = Unknown user $local_part

######################################################################
#                      TRANSPORTS CONFIGURATION                      #
######################################################################


begin transports

# -------------------------
remote_smtp:
# -------------------------
  driver = smtp
# -------------------------
address_pipe:
# -------------------------
  driver = pipe
  return_output
# -------------------------
virtual_address_pipe:
# -------------------------
  driver = pipe
  group = nobody
  return_output
  # should I set user here?  If so, to what?
# -------------------------
address_file:
# -------------------------
  driver = appendfile
  delivery_date_add
  envelope_to_add
  return_path_add
# -------------------------
local_delivery:
# -------------------------
  driver = appendfile
  file = /var/mail/$local_part
  delivery_date_add
  envelope_to_add
  return_path_add
  group = mail
  user = ${local_part}
  mode = 0660
######################################################################
#                      RETRY CONFIGURATION                           #
######################################################################


begin retry

# Address or Domain    Error       Retries
# -----------------    -----       -------


*                      *           F,2h,15m; G,16h,1h,1.5; F,4d,6h
######################################################################
#                      REWRITE CONFIGURATION                         #
######################################################################


# There are no rewriting specifications in this default configuration file.

begin rewrite
######################################################################
#                   AUTHENTICATION CONFIGURATION                     #
######################################################################


begin authenticators

# End of Exim configuration file