Date: Thu, 4 Dec 1997 14:16:22 -0800 From: Stuart Lynne This config will support delivery across multiple systems using NIS to lookup delivery addresses from the mail.aliases database. It seems to be working fairly well. I'm including a sample mail.aliases file. It shows a setup for four different domains. With mail being delivered to three different systems. Mail is delivered to two different types of mailboxes. If you alias mail to user@machine then it gets delivered to mailbox in /var/mail as normal. If you alias to user%virtual.domain@machine then it gets delivered to /var/mail/virtual.domain/user. Each of the domains you want to handle should have MX records like: IN MX 10 virtual0.fireplug.net IN MX 10 virtual1.fireplug.net IN MX 20 relay.fireplug.net The two virtualN systems are the ones to use the included config. ###################################################################### # Runtime configuration file for Exim # ###################################################################### # 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 = # 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, 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 = # No local deliveries will ever be run under the uids of these users. never_users = root # 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 = uucp # required to allow customer domains mx'd to here to use us relay_domains_include_local_mx spool_directory = /var/spool/exim log_file_path = "/var/log/exim/%slog" # rbl configuration prohibition_message = contact postmaster@fireplug.net for further info recipients_reject_except = postmaster@fireplug.net rbl_domains = "rbl.maps.vix.com.:rbl.fireplug.net." end ###################################################################### # TRANPORTS CONFIGURATION # ###################################################################### ################################### # 1. These transports are used for local delivery to user mailboxes. procmail_pipe: driver = pipe from_hack command = "/usr/bin/procmail -t -o -d ${local_part}" mbox_delivery: driver = appendfile #maildir_format #create_directory file = /var/mail/${domain}/${local_part} user = mail group = mail # mode = 0660 ################################### # 2. This transport is used for delivering messages over SMTP connections. smtp: driver = smtp ################################### # 3. this is for forwarding uucp mail uux_domain: driver = pipe command = "/usr/bin/uux - -r ${domain}!rmail ${local_part}@${domain}" pipe_as_creator return_output ################################### # 4. Misc transports used internally # 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 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 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 end ###################################################################### # DIRECTORS CONFIGURATION # ###################################################################### ################################# # 1. Check for domains aliased to virtual*.fireplug.net # if local mx was to virtual.fireplug.net, lookup in NIS mail.aliases, eventually ldap # partial0 requires fixed exim, allows for per domain wildcard virtual_fireplug_net: condition = "${if match{$self_hostname}{virtual..fireplug.net}{$domain}}" driver = aliasfile search_type = partial0-nis* file = mail.aliases expand include_domain ################################# # 2. Check for domains aliased to uucp.fireplug.net # if local mx was to uucp.fireplug.net then forward via uux_domain transport uucp_fireplug_net: condition = "${if match{$self_hostname}{uucp.fireplug.net}{$domain}}" driver = smartuser transport = uux_domain ################################# # 3. Conventional mail processing, may not be required for fireplug system_aliases: domains = @ driver = aliasfile file = /var/etc/aliases search_type = lsearch userforward: domains = @ no_verify driver = forwardfile file = .forward ################################# # 4. Deliver local mailboxes local_mbox: condition = "${if match{$local_part}{.*%.*}{$domain}}" driver = smartuser transport = mbox_delivery new_address = "${if match{$local_part}{(.*)%.*}{$1}{$domain}}@${if match{$local_part}{.*%(.*)}{$1}{$domain}}" # This director matches local user mailboxes. procmail: domains = @ driver = localuser transport = procmail_pipe end ###################################################################### # ROUTERS CONFIGURATION # ###################################################################### ################################# # 1. Check to see if we can get rid of it by sending it to someone lese # # This router routes to remote hosts over SMTP using a DNS lookup with default options. # # The self option tells exim to continue looking at additional # routers if the MX for a domain points at the local host. lookuphost: driver = lookuphost self = fail_soft transport = smtp ################################# # 2. Special cases here - keep to a bare minimum # # if domain is nwnet.org && primary_hostname is nero.fireplug.net nwnet_org: condition = "${if match{$primary_hostname}{nero.fireplug.net}{$domain}}" domains = "nwnet.org" driver = domainlist transport = smtp route_list = "* nwnet.nwnet.org" # # End of Special cases here - keep to a bare minimum ################################# # 3. We have something that seems to be MX'd to here # # by default, anything that is a local MX will get matched here # This must be set to something reasonable. # # Currently we punt to local director's for further processing self: driver = lookuphost self = local transport = smtp ################################# # 4. IP literal - required by RFC's # 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. literal: driver = ipliteral transport = 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 # ###################################################################### # There are no rewriting specifications in this default configuration file. # End of Exim configuration file Sample mail.aliases file: ------------------------- # Record Description: /etc/alias record # Record Explanation: aliasname alias # Record Example: postmaster user@mydomain.com # # # Wildcard record is entered as: *@domain alias # # Special expansion values: # # @xxx replace with original localpart # :FAIL: message will fail as if user did not exist # :DEFER: message will be held in mail spool # :DROP: message will be silently dropped # # System Aliases # abuse root postmaster root # Wildcard Aliases # * FAIL *@fireplug.net FAIL *@galarie.bc.ca $local_part@galarie.com *@galarie.com FAIL *@poste.com FAIL # Abuse Aliases # abuse root abuse@fireplug.net sl@fireplug.net abuse@galarie.bc.ca abuse abuse@galarie.com abuse abuse@poste.com abuse # Postmaster Aliases # postmaster root postmaster@fireplug.net sl@fireplug.net postmaster@galarie.bc.ca postmaster postmaster@galarie.com postmaster postmaster@poste.com postmaster # Domain based aliases # # fireplug.net # bobe@fireplug.net bobe@webtide.com info@fireplug.net richard@fireplug.net, sl@fireplug.net jsavage@fireplug.net jsavage%fireplug.net@wilt.fireplug.net ken@fireplug.net ken%fireplug.net@wilt.fireplug.net lsavage@fireplug.net lsavage%fireplug.net@wilt.fireplug.net msavage@fireplug.net msavage%fireplug.net@wilt.fireplug.net richard@fireplug.net richard%fireplug.net@nero.fireplug.net rshand@fireplug.net rshand%fireplug.net@wilt.fireplug.net sales@fireplug.net richard@fireplug.net sl@fireplug.net sl@poste.com ted@fireplug.net ted@nero.fireplug.net webmaster@fireplug.net richard@fireplug.net wsavage@fireplug.net wsavage%fireplug.net@wilt.fireplug.net # galarie.com # galarie@galarie.com galarie%galarie.com@wilt.fireplug.net test@galarie.com test%galarie.com@wilt.fireplug.net # poste.com # cl@poste.com cl@whiskey.poste.com donna@poste.com donna@whiskey.poste.com rl@poste.com rl@whiskey.poste.com sl@poste.com sl@nero.fireplug.net