[Exim] Multidomain support with exim

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Hennion
Datum:  
To: exim-users
Betreff: [Exim] Multidomain support with exim
Hi,

I currently have 1 mail server, which serves our school's internet and mail needs. It runs Redhat enterprise 2.4.9-13. On it is running exim 3.34. Currently we run novell on our main servers, but I am setiing up a test server running linux. To test the full functionallity of Linux, I have set up a second domain name for our email. So the problem is, I need to set up exim to serve both domains. The first which is already set up is wpps.wcape.school.za, and the second one which I need to set up, to go to a diffrent IP address to the first is wpps1.wcape.school.za. How does one do this? I have included my config file.

Thanks

Paul

p.s. I had to take the first couple of comments out, because i could not paste it all in, (microsoft products!!)

―---------------------------------------------------------------------------------------
######################################################################
##                                                                  ##
##              EXIM MAIL TRANSPORT CONFIGURATION FILE              ##
##                                                                  ##
######################################################################



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


accept_timeout = 10m

auto_thaw = 1d

check_spool_space = 10M

collapse_source_routes = true

delay_warning = 4h:12h:36h

delay_warning_condition = "\
${if match{$h_precedence:}{(?i)bulk|list|junk}{no}{yes}}"
deliver_load_max = 6
deliver_queue_load_max = 5
dns_check_names = true
exim_user = exim
exim_group = mail
freeze_tell_mailmaster = false
gecos_name = "$1"
gecos_pattern = "^([^,]*),"
helo_strict_syntax = false

#----------------------------------------------------------------------------
# The RFCs mandate that a server must not reject a message because it
# doesn't like the HELO or EHLO command, or indeed if there isn't a HELO or
# EHLO command at all. However, some sites like to be stricter. If
# helo_verify is set, Exim checks incoming calls from all hosts that do not
# match helo_verify_except_hosts or helo_verify_except_nets, and accepts an
# incoming SMTP call only if:
#
#         .   A HELO or EHLO command is received;
#
#                       and
#
#            .   The host name given in that command either:
#
#                (i)  is an IP literal matching the calling
#                     address of the host (the
#                     RFCs specifically allow this), or
#
#                (ii) matches the host name that Exim obtains by doing
#                     a reverse lookup of the calling host address, or
#
#               (iii) when looked up using gethostbyname() yields the
#                     calling host address.
#
# If no HELO or EHLO is given, MAIL FROM commands are rejected; if a bad
# HELO or EHLO is given, it is rejected with a 550 error. Rejections are
# logged in the main and reject logs.


helo_verify = 0.0.0.0/0

#----------------------------------------------------------------------------
# The setting below causes Exim to do a reverse DNS lookup on all incoming
# IP calls, in order to get the true host name. If you feel this is too
# expensive, you can specify the networks for which a lookup is done, or
# remove the setting entirely.

host_lookup = 0.0.0.0/0

#----------------------------------------------------------------------------
# Set exim to ignore failures to deliver error messages. If this option is
# set, failed addresses in error messages (that is, messages whose senders
# are '<>') are discarded (with a log entry). The default action is to freeze
# such messages for human attention.

ignore_errmsg_errors = true

#----------------------------------------------------------------------------
# Set exim to discard frozen error messages

ignore_errmsg_errors_after = 1s

#----------------------------------------------------------------------------
# This option specifies the length of time to keep messages whose spool
# files have been corrupted in some way. This should, of course, never
# happen. At the next attempt to deliver such a message, it gets removed.
# The incident is logged. [Default = 4d]

keep_malformed = 1d

#----------------------------------------------------------------------------
# Specify your local domains as a colon-separated list here. If this option
# is not set, 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.

local_domains = "wppstdfg.wcape.school.za"

#----------------------------------------------------------------------------
# The log_all_parents option causes all intermediate addresses between an
# original envelope address and the final delivery address to be included in
# the log line in parentheses after the first address that follows "=>".
# Without this, intermediate addresses are not included, except that if the
# final delivery is a to pipe or file or autoreply, the immediately preceding
# parent address is listed.

log_all_parents = true

#----------------------------------------------------------------------------
# Log the original recepients, before rewriting.

log_received_recipients = true

#----------------------------------------------------------------------------
# If this option is set, the unrewritten original sender of a message is
# added to the end of the log line that records the message's arrival,
# after the word 'from' (before the recipients if log_received_recipients
# is also set).

log_received_sender = true

#----------------------------------------------------------------------------
# Log mail rejections

log_refused_recipients = true

#----------------------------------------------------------------------------
# Log mail header rewrites

log_rewrites = true

#----------------------------------------------------------------------------
# Log smtp result.

log_smtp_confirmation = true

#----------------------------------------------------------------------------
# This option turns on more verbose logging of incoming SMTP connections, at
# log level 4. This does not apply to batch SMTP, but it does apply to SMTP
# connections from local processes that use the -bs option, including
# incoming calls using inetd. A log line is written whenever a connection is
# established or closed. If a connection is dropped in the middle of a
# message, a log line is always written, but otherwise nothing is written at
# the start and end of connections unless log_smtp_connections is set.

log_smtp_connections = true

#----------------------------------------------------------------------------
# If this option is set, syntax errors in incoming SMTP commands are logged
# at level 4. For an external connection, the host identity is given; for
# an internal connection using -bs the sender identification (normally the
# calling user) is given.

log_smtp_syntax_errors = true

#----------------------------------------------------------------------------
# Log message subject.

log_subject = true

#----------------------------------------------------------------------------
# Set message size limit, 10MB

message_size_limit = 10M

#----------------------------------------------------------------------------
# No local deliveries will ever be run under the uids of these users.

never_users = root:daemon:bin:lp:sync:shutdown:adm:halt

#----------------------------------------------------------------------------
# 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=*

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

# primary_hostname =

#---------------------------------------------------------------------------
# The -M and -q command-line options require the caller to be an admin user
# unless prod_requires_admin is set false. See also queue_list_requires_admin.

prod_requires_admin = true

#----------------------------------------------------------------------------
# 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 = wpps.wcape.school.za

#----------------------------------------------------------------------------
# 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 = wpps.wcape.school.za

#----------------------------------------------------------------------------
# The -bp command-line option requires the caller to be an admin user unless
# queue_list_requires_admin is set false. Otherwise, only messages that the
# caller submitted are displayed. See also prod_requires_admin.

queue_list_requires_admin = true

#----------------------------------------------------------------------------
# Do not attempt immediate delivery if load is above this

queue_only_load = 4

#----------------------------------------------------------------------------
# Controls the maximum number of queue-running processes that the Exim daemon
# will run simultaneously.

queue_run_max = 4

#-----------------------------------------------------------------------------
# Queue management - disable automatic dequeuing ... for virus scanning

queue_only = true

#----------------------------------------------------------------------------
# When a message is to be delivered to a remote machine, the number of
# Received headers is counted, and if it is greater than this parameter,
# a mail loop is assumed to have occurred, the delivery is abandoned, and
# a delivery error message is generated.

received_headers_max = 15

#----------------------------------------------------------------------------
# When this option is set, the addresses of recipients received from a
# remote host are verified as they are received, unless the host matches
# an entry in either receiver_verify_except_hosts or
# receiver_verify_except_nets. If receiver_verify_addresses, is set, only
# those addresses that match are verified. If receiver_verify_senders, or
# receiver_verify_senders_except is set, verification happens only for
# messages whose senders meet the criteria.
#
# If an address is invalid, an incoming SMTP call gets an error response
# to the RCPT TO command. If an address cannot immediately be verified, a
# temporary error code is given. The receiver_try_verify option is less
# severe: it operates in the same way, except that an address is accepted
# if it cannot immediately be verified. Verification failures are logged.

receiver_verify = true

#----------------------------------------------------------------------------
# If the recipients_max option is > zero, it specifies the maximum number of
# recipients for any message. This applies to the original list of recipi-
# ents supplied with the message. SMTP messages get a 452 response for all
# recipients over the limit; earlier recipients are delivered as normal.
# Non-SMTP messages with too many recipients are failed, and no deliveries
# are done. Note that the RFCs specify that an SMTP server should accept at
# least 100 RCPT commands in a single message.

recipients_max = 200

#----------------------------------------------------------------------------
# Control which hosts may use us as relay host

relay_domains = "*.wcape.school.za"

#----------------------------------------------------------------------------
# Set the maximum number of parallel deliveries done from a queue run

remote_max_parallel = 4

#----------------------------------------------------------------------------
# Set order into which domains are sorted before delivery starts

# remote_sort = "*.localdomain"

#----------------------------------------------------------------------------
# Set maximum size of bounce message return to sender

return_size_limit = 20K

#-----------------------------------------------------------------------------
# Sets which hosts we don't do an ident on.

rfc1413_hosts = "*"

#----------------------------------------------------------------------------
# This sets the timeout on RFC 1413 identification calls. If it is set to
# zero, no RFC 1413 calls are ever made.

rfc1413_query_timeout = 0s

#----------------------------------------------------------------------------
# If this option is set, incoming SMTP calls are accepted only from the
# hosts listed, possibly also qualified by an RFC 1413 identification.
# (Calls from networks listed in sender_net_accept are also accepted.)
# However, if a call arrives from a host (and identification) which is also
# listed in sender_host_reject or from a network listed in
# sender_net_reject, the call is rejected, unless the host matches
# sender_host_reject_except or sender_net_reject_except.

# sender_host_accept = "mail.gateway"

#----------------------------------------------------------------------------
# The setting below locks out the use of your host as a mail relay by any
# other host. If you want to permit relaying through your host from certain
# hosts or IP networks, you need to vary this option and/or make use of the
# other three options in the set sender_{host,net}_{accept,reject}_relay.
# See the section of the manual entitled "Control of relaying" for more info.
# Removing this setting altogether is not recommended, because there are many
# unscrupulous people out there who will make use of open relays to try to
# disguise the source of unsolicited bulk mail. By default, disable all
# relaying (help fight SPAM!).

host_accept_relay = "10.0.1.9:!*"

#----------------------------------------------------------------------------
# However, make sure that unqualified addresses are not now rejected as well

# sender_unqualified_nets = localdomain.0.0/netmask.0.0

#----------------------------------------------------------------------------
# If this option is true, envelope sender addresses on incoming SMTP
# messages are checked to ensure that they are valid. Messages with invalid
# envelope senders are rejected with a permanent error code if
# sender_verify_reject is set (the default). Otherwise a warning is logged.
# See section 39.2 for details of the rejection, which can happen at three
# different points in the SMTP dialogue. If a sender cannot immediately be
# verified, a temporary error code is returned after reading the data (so
# the headers can be logged). The sender_try_verify option is less severe:
# it operates in exactly the same way as sender_verify except that if an
# address cannot immediately be verified, it is accepted instead of being
# temporarily rejected.

sender_verify = true

sender_verify_reject = true

#----------------------------------------------------------------------------
# Experience shows that many messages are sent out onto the Internet with
# invalid sender addresses in the envelopes (i.e. in the MAIL FROM command of
# the SMTP dialogue), but with valid addresses in the Sender, From, or
# Reply-to header fields. If sender_verify is true and this option is also
# true, an invalid envelope sender or one that cannot immediately be verified
# is replaced by a valid value from the headers.

sender_verify_fixup = true

#----------------------------------------------------------------------------
# Set maximum number of incoming connections

smtp_accept_max = 30

#----------------------------------------------------------------------------
# This option restricts the number of simultaneous IP connections from a
# single host (strictly, from a single IP address) to the Exim daemon. The
# default value of zero imposes no limit. If this option is set, it is
# required that smtp_accept_max be set non-zero.

smtp_accept_max_per_host = 8

#----------------------------------------------------------------------------
# Set to only queue incomming messages if more than given number of
# simultaneous SMTP connections are received.

smtp_accept_queue = 10

#---------------------------------------------------------------------------
# This option limits the number of delivery processes that Exim starts
# automatically when receiving messages via SMTP, whether via the daemon
# or by the use of -bs or -bS. If the value of the option is greater than
# zero, and the number of messages received in a single SMTP session exceeds
# this number, subsequent messages are placed on the spool, but no delivery
# process is started. This helps to limit the number of Exim processes when
# a server restarts after downtime and there is a lot of mail waiting for it
# on other systems. On large systems the default should probably be increased.

smtp_accept_queue_per_connection = 4

#----------------------------------------------------------------------------
# Reserve SMTP connections for local domain (as in smtp_reserve_hosts).

smtp_accept_reserve = 6

#----------------------------------------------------------------------------
# Set custom mailer signature

smtp_banner = "${primary_hostname} ESMTP"

#-----------------------------------------------------------------------------
# When this option is set, if an incoming SMTP session encounters the SIZE
# option on a MAIL FROM command, it checks that there is enough space in the
# spool directory's partition to accept a message of that size, while still
# leaving free the amount specified by check_spool_space (even if that value
# is zero). If there isn't enough space, a temporary error code is returned.

smtp_check_spool_space = true

#----------------------------------------------------------------------------
# Set connection backlog - anti denial of service

smtp_connect_backlog = 10

#----------------------------------------------------------------------------
# Set load for reserved hosts

smtp_load_reserve = 5

#----------------------------------------------------------------------------
# Reserve connections for local domain hosts

smtp_reserve_hosts = "*.wcape.school.za"

#---------------------------------------------------------------------------
# If this option is set, it causes Exim to split its input directory into 62
# subdirectories, each with a single alphanumeric character as its name. The
# fifth character of the message id is used to allocate messages to
# subdirectories; this is the least significant base-62 digit of the time of
# arrival of the message.
#
# Splitting up the spool in this way may provide better performance on
# systems where there are long mail queues, by reducing the number of files
# in any one directory. The msglog directory is also split up in a similar
# way to the input directory; however, if preserve_message_logs is set, all
# old msglog files are still placed in the single directory msglog.OLD.
#
# It is not necessary to take any special action for existing messages when
# changing split_spool_directory. Exim notices messages that are in the
# 'wrong' place, and continues to process them. If the option is turned off
# after a period of being on, the subdirectories will eventually empty and
# get deleted.

split_spool_directory = true

#----------------------------------------------------------------------------
# Set mail spool directory

spool_directory = /var/spool/exim

#-----------------------------------------------------------------------------
# Redundant pairs of angle brackets round 'route-addr' items in addresses are
# stripped. For example, <<xxx@???>> is treated as <xxx@???>. If this
# is in the envelope and the message is passed on to another MTA, the excess
# angle brackets are not passed on. If this option is not set, multiple pairs
# of angle brackets cause a syntax error.

strip_excess_angle_brackets = true

#-----------------------------------------------------------------------------
# A trailing dot at the end of a domain in an address is ignored. If this
# is in the envelope and the message is passed on to another MTA, the dot is
# not passed on. If this option is not set, a dot at the end of a domain
# causes a syntax error.

strip_trailing_dot = true

#----------------------------------------------------------------------------
# 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


######################################################################
#                      TRANPORTS CONFIGURATION                       #
######################################################################
#                       ORDER DOES NOT MATTER                        #-----
#     Only one appropriate transport is called for each delivery.    #
######################################################################


# This transport is used for local delivery to user mailboxes. By default
# it will be run under the uid and gid of the local user, and requires
# the sticky bit to be set on the /var/mail directory. Some systems use
# the alternative approach of running mail deliveries under a particular
# group instead of using the sticky bit. The commented options below show
# how this can be done.

local_delivery:
driver = appendfile
file = /var/spool/mail/${local_part}
# user = ${local_part},
# group = mail,
# mode = 0660

# 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. (A different name *can*
# be specified via the "address_pipe_transport" option if you really want
# to.) If the pipe generates any standard output, it is returned to the sender
# of the message as a delivery error. Set return_fail_output instead if you
# want this to happen only when the pipe fails to complete normally.

address_pipe:
driver = pipe
# ignore_status,
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 file addresses generated by alias
# or .forward files if the path ends in "/", which causes it to be treated
# as a directory name rather than a file name. Each message is then delivered
# to a unique file in the directory. If instead you want all such deliveries to
# be in the "maildir" format that is used by some other mail software,
# uncomment the final option below. If this is done, the directory specified
# in the .forward or alias file is the base maildir directory.
#
# Should you want to be able to specify either maildir or non-maildir
# directory-style deliveries, then you must set up yet another transport,
# called address_directory2. This is used if the path ends in "//" so should
# be the one used for maildir, as the double slash suggests another level
# of directory. In the absence of address_directory2, paths ending in //
# are passed to address_directory.

address_directory:
driver = appendfile
no_from_hack
prefix = ""
suffix = ""
# maildir_format

# 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
command_timeout = 1m
connect_timeout = 10s
keepalive = true
max_rcpt = 60


######################################################################
#                      DIRECTORS CONFIGURATION                       #
#             Specifies how local addresses are handled              #
######################################################################
#                          ORDER DOES MATTER                         #
#   A local address is passed to each in turn until it is accepted.  #
######################################################################


# Local addresses are those with a domain that matches some item in the
# "local_domains" setting above, or those which are passed back from the
# routers because of a "self=local" setting (not used in this configuration).

# This director handles aliasing using a traditional /etc/aliases file.
# If any of your aliases expand to pipes or files, you will need to set
# up a user and a group for these deliveries to run under. You can do
# this by uncommenting the "user" option below (changing the user name
# as appropriate) and adding a "group" option if necessary.
system_aliases:
driver = aliasfile
file_transport = address_file
pipe_transport = address_pipe
file = /etc/aliases
search_type = lsearch
# user = exim

# 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.
# The check_ancestor option means that if the forward file generates an
# address that is an ancestor of the current one, the current one gets
# passed on instead. This covers the case where A is aliased to B and B
# has a .forward file pointing to A.

userforward:
driver = forwardfile
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply
file = .forward
no_verify
check_ancestor
filter


# This director matches local user mailboxes.

localuser:
driver = localuser
transport = local_delivery



######################################################################
#                      ROUTERS CONFIGURATION                         #
#            Specifies how remote addresses are handled              #
######################################################################
#                          ORDER DOES MATTER                         #
#  A remote address is passed to each in turn until it is accepted.  #
######################################################################


# Remote addresses are those with a domain that does not match any item
# in the "local_domains" setting above.

# The follow router routes all non-local messages to a gateway
# mail exchanger, which will do the actual remote transport of the mail.

relayrouter:
driver = domainlist
transport = remote_smtp
route_list = "*wpps.wcape.school.za 10.0.1.9 byname"

# 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




######################################################################
#                      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
# ------               -----       -------


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





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


# End of Exim configuration file






---------------------------------------------------------------
Paul Hennion
IT Director
Western Province Preparatory School

Email address: pauhen@???
Phone: (021) 761 8074
Fax: (021) - 762 6120