Trouble with rewriting local-part addresses

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Glenn Carver
Fecha:  
A: exim-users
Cc: glenn
Asunto: Trouble with rewriting local-part addresses

I've got Exim 1.61 running on a Sun Solaris 2.5.1 machine (our mail hub)
using a tweaked copy of the default configuration (attached).

However, I've tried to follow the rewriting example in the manual in
which local usernames are replaced by real names
e.g.
    glenn@???  becomes Glenn.Carver@???


However, although running exim in test mode shows the rewriting works,
the problem is that exim then complains the local part (now Glenn.Carver)
is bad e.g.

   # exim -v -bt glenn@???
   Address rewritten as: Glenn.Carver@???
   Glenn.Carver@??? is undeliverable:
     unknown local-part "glenn.carver" in domain "atm.ch.cam.ac.uk"


I have the option 'sender_verify=yes' set which may be the problem, but
I am reluctant to give it up. I also wondered whether I'd need to
set no_check_local_user, but again, I'm not keen on this as I would
prefer to check.

Can I get around this?

      Glenn

######################################################################
#                  Runtime configuration file for Exim               #
######################################################################


# ********  CAESAR'S EXIM MAIL CONFIGURATION FILE  **********
#    Glenn   9/3/97


# This is a default configuration file which will operate correctly in
# uncomplicated installations. Please see the manual for a complete list
# of all the runtime configuration options.


# This file is divided into several parts, all but the last of which are
# terminated by a line containing the word "end". The parts must appear
# in the correct order, and all must be present (even if some of them are
# in fact empty). Blank lines, and lines starting with # are ignored.



######################################################################
#                    MAIN CONFIGURATION SETTINGS                     #
######################################################################


# Specify your host's canonical name here. If this option is not set, the
# uname() function is called to obtain the name.

# primary_hostname =

# Specify the domain you want to be added to all unqualified addresses
# here. If this option is not set, the primary_hostname value is used.

qualify_domain = atm.ch.cam.ac.uk

# If you want unqualified recipient addresses to be qualified with a different
# domain to unqualified sender addresses, specify the recipient domain here.
# If this option is not set, the qualify_domain value is used.

# qualify_recipient =

# Specify your local domains as a colon-separated list here. If this option
# is not set (i.e. not mentioned in the configuration file), the
# qualify_recipient value is used as the only local domain. If you do not want
# to do any local deliveries, uncomment the following line, but do not supply
# any data for it. This sets local_domains to an empty string, which is not
# the same as not mentioning it at all. An empty string specifies that there
# are no local domains; not setting it at all causes the default value (the
# setting of qualify_recipient) to be used.

local_domains = "atm.ch.cam.ac.uk:ozone-sec.ch.cam.ac.uk:*.atm.ch.cam.ac.uk"

# No local deliveries will ever be run under the uids of these users (a colon-
# separated list). Note the default setting means you cannot deliver mail
# addressed to root as if it were a normal user. (This isn't usually a problem,
# as most sites have an alias for root that redirects such mail to a human
# administrator.)

never_users = root:daemon:bin:exim

# If you want Exim to support the "percent hack" for all your local domains,
# uncomment the following line. This is the feature by which mail addressed
# to x%y@z (where z is one of your local domains) is locally rerouted to
# x@y and sent on. Otherwise x%y is treated as an ordinary local part.

# percent_hack_domains=*

# If you are running Exim under its own uid (recommended), then you should
# set up that uid as a trusted user by de-commenting the following and
# changing the name if necessary.

trusted_users = exim

# Additional options added by Glenn. See Exim documentation for full
# description of these options.

errors_reply_to = postmaster@???

finduser_retries = 5
freeze_tell_mailmaster = yes

local_interfaces = 131.111.112.3

sender_verify = yes
sender_verify_fixup = yes

smtp_connect_backlog = 20

end



######################################################################
#                      TRANPORTS CONFIGURATION                       #
######################################################################


# This transport is used for local delivery to user mailboxes.

local_delivery:
driver = appendfile;
file = /var/mail/${local_part}

# This transport is used for handling pipe addresses generated by alias
# or .forward files. It has a conventional name, since it is not actually
# mentioned elsewhere in this configuration file.

address_pipe:
driver = pipe;
return_output

# This transport is used for handling file addresses generated by alias
# or .forward files. It has a conventional name, since it is not actually
# mentioned elsewhere in this configuration file.

address_file:
driver = appendfile

# This transport is used for handling autoreplies generated by the filtering
# option of the forwardfile director. It has a conventional name, since it
# is not actually mentioned elsewhere in this configuration file.

address_reply:
driver = autoreply

# This transport is used for delivering messages over SMTP connections.

remote_smtp:
driver = smtp;

end



######################################################################
#                      DIRECTORS CONFIGURATION                       #
######################################################################


# This director handles aliasing using a traditional /etc/aliases file.

system_aliases:
driver = aliasfile;
file = /etc/mail/aliases,
search_type = lsearch

# This director handles forwarding using traditional .forward files.
# If you want it also to allow mail filtering when a forward file
# starts with the string "# Exim filter", uncomment the "filter" option.

userforward:
no_verify,
driver = forwardfile;
file = .forward,
filter

# This director matches local user mailboxes.

localuser:
driver = localuser,
transport = local_delivery;

end



######################################################################
#                      ROUTERS CONFIGURATION                         #
######################################################################


# This router routes to remote hosts over SMTP using a DNS lookup with
# default options.

lookuphost:
driver = lookuphost,
transport = remote_smtp;

# This router routes to remote hosts over SMTP by explicit IP address,
# given as a "domain literal" in the form [nnn.nnn.nnn.nnn]. The RFCs
# require this facility, which is why it is enabled by default in Exim.
# If you want to lock it out, set forbid_domain_literals in the main
# configuration section above.

literal:
driver = ipliteral,
transport = remote_smtp;

end



######################################################################
#                      RETRY CONFIGURATION                           #
######################################################################


# This single retry rule applies to all domains and all errors. It specifies
# retries every 15 minutes for 2 hours, then increasing retry intervals,
# starting at 2 hours and increasing each time by a factor of 1.5, up to 16
# hours, then retries every 8 hours until 4 days have passed since the first
# failed delivery.

# Domain               Error       Retries
# ------               -----       -------


*                      *           F,2h,15m; G,16h,2h,1.5; F,4d,8h


end



######################################################################
#                      REWRITE CONFIGURATION                         #
######################################################################


# Sometimes a user misconfigures Pine or Netscape and the domain
# name includes the hostname. We need to strip this.

*@*.atm.ch.cam.ac.uk    $1@???


# If this is uncommented, then local userids are replaced by
# the result of the lookup. This can be used to replace
# glenn@??? with Glenn.Carver@???

*@atm.ch.cam.ac.uk
    ${lookup{$1}dbm{/etc/mail/realnames}{$value}fail}@???


# End of Exim configuration file

_______________________________________________________________________
Dr. Glenn Carver,                         Phone: +44 (1223) 336524
Centre for Atmospheric Science,           Fax:   +44 (1223) 336473
Cambridge University, Chemistry Dept.,    Email: glenn@???
Lensfield Road,
Cambridge, CB2 1EW, UK              http://www.atm.ch.cam.ac.uk/~glenn/


"Someone told me that each equation I included in the book would halve
the sales." Prof. Stephen Hawking, 'A Brief History of Time', 1988.
_______________________________________________________________________