# # this file was originally contributed by James Harr (james at grickle dot org) # and was slightly modified by me (Thomas Pircher) # # MySQL database host/db/user/pass hide mysql_servers = localhost/maildb/mail/secret ###################################################################### # MAIN CONFIGURATION SETTINGS # ###################################################################### # Domains & Names primary_hostname = my.server.com # Domains domainlist local_domains = \ ${lookup mysql {SELECT domain FROM domains \ WHERE type="local" and domain="${domain}" }} domainlist relay_to_domains = \ ${lookup mysql {SELECT domain FROM domains \ WHERE type="relay" }} # Relaying hostlist relay_from_hosts = 127.0.0.1 acl_smtp_rcpt = acl_check_rcpt # qualify_domain = {primary_hostname} # qualify_recipient = {primary_hostname} # allow_domain_literals # Never do _local_ delivery to these users. never_users = root # Name lookups host_lookup = * rfc1413_hosts = * rfc1413_query_timeout = 30s # sender_unqualified_hosts = # recipient_unqualified_hosts = # percent_hack_domains = ignore_bounce_errors_after = 2d timeout_frozen_after = 7d ###################################################################### # ACL CONFIGURATION # # Specifies access control lists for incoming SMTP mail # ###################################################################### begin acl acl_check_rcpt: # Accept if the source is local SMTP (i.e. not over TCP/IP). We do this by # testing for an empty sending host field. accept hosts = : deny local_parts = ^.*[@%!/|] accept local_parts = postmaster domains = +local_domains require verify = sender accept domains = +local_domains endpass message = unknown user verify = recipient accept domains = +relay_to_domains endpass message = unrouteable address verify = recipient accept hosts = +relay_from_hosts accept authenticated = * deny message = relay not permitted ###################################################################### # ROUTERS CONFIGURATION # # Specifies how addresses are handled # ###################################################################### # THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT! # # An address is passed to each router in turn until it is accepted. # ###################################################################### begin routers # domain_literal: # driver = ipliteral # domains = ! +local_domains # transport = remote_smtp dnslookup: driver = dnslookup domains = ! +local_domains transport = remote_smtp ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 no_more mysql_sys_aliases: driver = redirect allow_fail allow_defer data = ${lookup mysql{SELECT dest FROM aliases \ WHERE email='${local_part}' AND \ type="system"}} mysql_aliases: driver = redirect allow_fail allow_defer data = ${lookup mysql{ SELECT dest FROM aliases \ WHERE email='${local_part}@${domain}' AND \ type="site"}} #system_aliases: # driver = redirect # allow_fail # allow_defer # data = ${lookup{$local_part}lsearch{/etc/aliases}} ## user = exim # file_transport = address_file # pipe_transport = address_pipe #userforward: # driver = redirect # check_local_user # file = $home/.forward # no_verify # no_expn # check_ancestor ## allow_filter # file_transport = address_file # pipe_transport = address_pipe # reply_transport = address_reply #localuser: # driver = accept # check_local_user # transport = local_delivery mysql_user: driver = accept condition = ${lookup mysql {SELECT home FROM passwd \ WHERE email='${local_part}@${domain}'}} retry_use_local_part transport=mysql_delivery ###################################################################### # TRANSPORTS CONFIGURATION # ###################################################################### # ORDER DOES NOT MATTER # # Only one appropriate transport is called for each delivery. # ###################################################################### begin transports remote_smtp: driver = smtp #local_delivery: # driver = appendfile # file = /var/mail/$local_part # delivery_date_add # envelope_to_add # return_path_add ## group = mail ## mode = 0660 mysql_delivery: driver = appendfile maildir_format directory = \ ${lookup mysql{SELECT maildir FROM passwd \ WHERE email='${local_part}@${domain}'}} user = \ ${lookup mysql{SELECT uid FROM passwd \ WHERE email='${local_part}@${domain}'}} group = \ ${lookup mysql{SELECT gid FROM passwd \ WHERE email='${local_part}@${domain}'}} #address_pipe: # driver = pipe # return_output #address_file: # driver = appendfile # delivery_date_add # envelope_to_add # return_path_add #address_reply: # driver = autoreply ###################################################################### # RETRY CONFIGURATION # ###################################################################### begin retry # 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 1 hour and increasing each time by a factor of 1.5, up to 16 # hours, then retries every 6 hours until 4 days have passed since the first # failed delivery. # 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 # ###################################################################### # There are no authenticator specifications in this default configuration file. begin authenticators # End of Exim configuration file