Advertisement
Guest User

exim4.conf.template-andre

a guest
Mar 25th, 2016
531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 77.56 KB | None | 0 0
  1. #####################################################
  2. ### main/01_exim4-config_listmacrosdefs
  3. #####################################################
  4. ######################################################################
  5. # Runtime configuration file for Exim 4 (Debian Packaging) #
  6. ######################################################################
  7.  
  8. ######################################################################
  9. # /etc/exim4/exim4.conf.template is only used with the non-split
  10. # configuration scheme.
  11. # /etc/exim4/conf.d/main/01_exim4-config_listmacrosdefs is only used
  12. # with the split configuration scheme.
  13. # If you find this comment anywhere else, somebody copied it there.
  14. # Documentation about the Debian exim4 configuration scheme can be
  15. # found in /usr/share/doc/exim4-base/README.Debian.gz.
  16. ######################################################################
  17.  
  18. ######################################################################
  19. # MAIN CONFIGURATION SETTINGS #
  20. ######################################################################
  21.  
  22. # Just for reference and scripts.
  23. # On Debian systems, the main binary is installed as exim4 to avoid
  24. # conflicts with the exim 3 packages.
  25. exim_path = /usr/sbin/exim4
  26.  
  27. # Macro defining the main configuration directory.
  28. # We do not use absolute paths.
  29. .ifndef CONFDIR
  30. CONFDIR = /etc/exim4
  31. .endif
  32.  
  33. # debconf-driven macro definitions get inserted after this line
  34. UPEX4CmacrosUPEX4C = 1
  35.  
  36. # Create domain and host lists for relay control
  37. # '@' refers to 'the name of the local host'
  38.  
  39. # List of domains considered local for exim. Domains not listed here
  40. # need to be deliverable remotely.
  41. domainlist local_domains = MAIN_LOCAL_DOMAINS
  42.  
  43. # List of recipient domains to relay _to_. Use this list if you're -
  44. # for example - fallback MX or mail gateway for domains.
  45. domainlist relay_to_domains = MAIN_RELAY_TO_DOMAINS
  46.  
  47. # List of sender networks (IP addresses) to _unconditionally_ relay
  48. # _for_. If you intend to be SMTP AUTH server, you do not need to enter
  49. # anything here.
  50. hostlist relay_from_hosts = MAIN_RELAY_NETS
  51.  
  52.  
  53. # Decide which domain to use to add to all unqualified addresses.
  54. # If MAIN_PRIMARY_HOSTNAME_AS_QUALIFY_DOMAIN is defined, the primary
  55. # hostname is used. If not, but MAIN_QUALIFY_DOMAIN is set, the value
  56. # of MAIN_QUALIFY_DOMAIN is used. If both macros are not defined,
  57. # the first line of /etc/mailname is used.
  58. .ifndef MAIN_PRIMARY_HOSTNAME_AS_QUALIFY_DOMAIN
  59. .ifndef MAIN_QUALIFY_DOMAIN
  60. qualify_domain = ETC_MAILNAME
  61. .else
  62. qualify_domain = MAIN_QUALIFY_DOMAIN
  63. .endif
  64. .endif
  65.  
  66. # listen on all all interfaces?
  67. .ifdef MAIN_LOCAL_INTERFACES
  68. local_interfaces = MAIN_LOCAL_INTERFACES
  69. .endif
  70.  
  71. .ifndef LOCAL_DELIVERY
  72. # The default transport, set in /etc/exim4/update-exim4.conf.conf,
  73. # defaulting to mail_spool. See CONFDIR/conf.d/transport/ for possibilities
  74. LOCAL_DELIVERY=mail_spool
  75. .endif
  76.  
  77. # The gecos field in /etc/passwd holds not only the name. see passwd(5).
  78. gecos_pattern = ^([^,:]*)
  79. gecos_name = $1
  80.  
  81. # define macros to be used in acl/30_exim4-config_check_rcpt to check
  82. # recipient local parts for strange characters.
  83.  
  84. # This macro definition really should be in
  85. # acl/30_exim4-config_check_rcpt but cannot be there due to
  86. # http://www.exim.org/bugzilla/show_bug.cgi?id=101 as of exim 4.62.
  87.  
  88. # These macros are documented in acl/30_exim4-config_check_rcpt,
  89. # can be changed here or overridden by a locally added configuration
  90. # file as described in README.Debian chapter 2.1.2
  91.  
  92. .ifndef CHECK_RCPT_LOCAL_LOCALPARTS
  93. CHECK_RCPT_LOCAL_LOCALPARTS = ^[.] : ^.*[@%!/|`#&?]
  94. .endif
  95.  
  96. .ifndef CHECK_RCPT_REMOTE_LOCALPARTS
  97. CHECK_RCPT_REMOTE_LOCALPARTS = ^[./|] : ^.*[@%!`#&?] : ^.*/\\.\\./
  98. .endif
  99.  
  100. # always log tls_peerdn as we use TLS for outgoing connects by default
  101. .ifndef MAIN_LOG_SELECTOR
  102. MAIN_LOG_SELECTOR = +tls_peerdn
  103. .endif
  104. #####################################################
  105. ### end main/01_exim4-config_listmacrosdefs
  106. #####################################################
  107. #####################################################
  108. ### main/02_exim4-config_options
  109. #####################################################
  110.  
  111. ### main/02_exim4-config_options
  112. #################################
  113.  
  114.  
  115. # Defines the access control list that is run when an
  116. # SMTP MAIL command is received.
  117. #
  118. .ifndef MAIN_ACL_CHECK_MAIL
  119. MAIN_ACL_CHECK_MAIL = acl_check_mail
  120. .endif
  121. acl_smtp_mail = MAIN_ACL_CHECK_MAIL
  122.  
  123.  
  124. # Defines the access control list that is run when an
  125. # SMTP RCPT command is received.
  126. #
  127. .ifndef MAIN_ACL_CHECK_RCPT
  128. MAIN_ACL_CHECK_RCPT = acl_check_rcpt
  129. .endif
  130. acl_smtp_rcpt = MAIN_ACL_CHECK_RCPT
  131.  
  132.  
  133. # Defines the access control list that is run when an
  134. # SMTP DATA command is received.
  135. #
  136. .ifndef MAIN_ACL_CHECK_DATA
  137. MAIN_ACL_CHECK_DATA = acl_check_data
  138. .endif
  139. acl_smtp_data = MAIN_ACL_CHECK_DATA
  140.  
  141.  
  142. # Message size limit. The default (used when MESSAGE_SIZE_LIMIT
  143. # is unset) is 50 MB
  144. .ifdef MESSAGE_SIZE_LIMIT
  145. message_size_limit = MESSAGE_SIZE_LIMIT
  146. .endif
  147.  
  148.  
  149. # If you are running exim4-daemon-heavy or a custom version of Exim that
  150. # was compiled with the content-scanning extension, you can cause incoming
  151. # messages to be automatically scanned for viruses. You have to modify the
  152. # configuration in two places to set this up. The first of them is here,
  153. # where you define the interface to your scanner. This example is typical
  154. # for ClamAV; see the manual for details of what to set for other virus
  155. # scanners. The second modification is in the acl_check_data access
  156. # control list.
  157.  
  158. # av_scanner = clamd:/var/run/clamav/clamd.ctl
  159.  
  160.  
  161. # For spam scanning, there is a similar option that defines the interface to
  162. # SpamAssassin. You do not need to set this if you are using the default, which
  163. # is shown in this commented example. As for virus scanning, you must also
  164. # modify the acl_check_data access control list to enable spam scanning.
  165.  
  166. # spamd_address = 127.0.0.1 783
  167.  
  168. # Domain used to qualify unqualified recipient addresses
  169. # If this option is not set, the qualify_domain value is used.
  170. # qualify_recipient = <value of qualify_domain>
  171.  
  172.  
  173. # Allow Exim to recognize addresses of the form "user@[10.11.12.13]",
  174. # where the domain part is a "domain literal" (an IP address) instead
  175. # of a named domain. The RFCs require this facility, but it is disabled
  176. # in the default config since it is seldomly used and frequently abused.
  177. # Domain literal support also needs a special router, which is automatically
  178. # enabled if you use the enable macro MAIN_ALLOW_DOMAIN_LITERALS.
  179. # Additionally, you might want to make your local IP addresses (or @[])
  180. # local domains.
  181. .ifdef MAIN_ALLOW_DOMAIN_LITERALS
  182. allow_domain_literals
  183. .endif
  184.  
  185.  
  186. # Do a reverse DNS lookup on all incoming IP calls, in order to get the
  187. # true host name. If you feel this is too expensive, the networks for
  188. # which a lookup is done can be listed here.
  189. .ifndef DC_minimaldns
  190. .ifndef MAIN_HOST_LOOKUP
  191. MAIN_HOST_LOOKUP = *
  192. .endif
  193. host_lookup = MAIN_HOST_LOOKUP
  194. .endif
  195.  
  196.  
  197. # In a minimaldns setup, update-exim4.conf guesses the hostname and
  198. # dumps it here to avoid DNS lookups being done at Exim run time.
  199. .ifdef MAIN_HARDCODE_PRIMARY_HOSTNAME
  200. primary_hostname = MAIN_HARDCODE_PRIMARY_HOSTNAME
  201. .endif
  202.  
  203. # The settings below, which are actually the same as the defaults in the
  204. # code, cause Exim to make RFC 1413 (ident) callbacks for all incoming SMTP
  205. # calls. You can limit the hosts to which these calls are made, and/or change
  206. # the timeout that is used. If you set the timeout to zero, all RFC 1413 calls
  207. # are disabled. RFC 1413 calls are cheap and can provide useful information
  208. # for tracing problem messages, but some hosts and firewalls are
  209. # misconfigured to drop the requests instead of either answering or
  210. # rejecting them. This can result in a timeout instead of an immediate refused
  211. # connection, leading to delays on starting up SMTP sessions. (The default was
  212. # reduced from 30s to 5s for release 4.61.)
  213. # rfc1413_hosts = *
  214. # rfc1413_query_timeout = 5s
  215.  
  216. # When using an external relay tester (such as rt.njabl.org and/or the
  217. # currently defunct relay-test.mail-abuse.org, the test may be aborted
  218. # since exim complains about "too many nonmail commands". If you want
  219. # the test to complete, add the host from where "your" relay tester
  220. # connects from to the MAIN_SMTP_ACCEPT_MAX_NOMAIL_HOSTS macro.
  221. # Please note that a non-empty setting may cause extra DNS lookups to
  222. # happen, which is the reason why this option is commented out in the
  223. # default settings.
  224. # MAIN_SMTP_ACCEPT_MAX_NOMAIL_HOSTS = !rt.njabl.org
  225. .ifdef MAIN_SMTP_ACCEPT_MAX_NOMAIL_HOSTS
  226. smtp_accept_max_nonmail_hosts = MAIN_SMTP_ACCEPT_MAX_NOMAIL_HOSTS
  227. .endif
  228.  
  229. # By default, exim forces a Sender: header containing the local
  230. # account name at the local host name in all locally submitted messages
  231. # that don't have the local account name at the local host name in the
  232. # From: header, deletes any Sender: header present in the submitted
  233. # message and forces the envelope sender of all locally submitted
  234. # messages to the local account name at the local host name.
  235. # The following settings allow local users to specify their own envelope sender
  236. # in a locally submitted message. Sender: headers existing in a locally
  237. # submitted message are not removed, and no automatic Sender: headers
  238. # are added. These settings are fine for most hosts.
  239. # If you run exim on a classical multi-user systems where all users
  240. # have local mailboxes that can be reached via SMTP from the Internet
  241. # with the local FQDN as the domain part of the address, you might want
  242. # to disable the following three lines for traceability reasons.
  243. .ifndef MAIN_FORCE_SENDER
  244. local_from_check = false
  245. local_sender_retain = true
  246. untrusted_set_sender = *
  247. .endif
  248.  
  249.  
  250. # By default, Exim expects all envelope addresses to be fully qualified, that
  251. # is, they must contain both a local part and a domain. Configure exim
  252. # to accept unqualified addresses from certain hosts. When this is done,
  253. # unqualified addresses are qualified using the settings of qualify_domain
  254. # and/or qualify_recipient (see above).
  255. # sender_unqualified_hosts = <unset>
  256. # recipient_unqualified_hosts = <unset>
  257.  
  258.  
  259. # Configure Exim to support the "percent hack" for certain domains.
  260. # The "percent hack" is the feature by which mail addressed to x%y@z
  261. # (where z is one of the domains listed) is locally rerouted to x@y
  262. # and sent on. If z is not one of the "percent hack" domains, x%y is
  263. # treated as an ordinary local part. The percent hack is rarely needed
  264. # nowadays but frequently abused. You should not enable it unless you
  265. # are sure that you really need it.
  266. # percent_hack_domains = <unset>
  267.  
  268.  
  269. # Bounce handling
  270. .ifndef MAIN_IGNORE_BOUNCE_ERRORS_AFTER
  271. MAIN_IGNORE_BOUNCE_ERRORS_AFTER = 2d
  272. .endif
  273. ignore_bounce_errors_after = MAIN_IGNORE_BOUNCE_ERRORS_AFTER
  274.  
  275. .ifndef MAIN_TIMEOUT_FROZEN_AFTER
  276. MAIN_TIMEOUT_FROZEN_AFTER = 7d
  277. .endif
  278. timeout_frozen_after = MAIN_TIMEOUT_FROZEN_AFTER
  279.  
  280. .ifndef MAIN_FREEZE_TELL
  281. MAIN_FREEZE_TELL = postmaster
  282. .endif
  283. freeze_tell = MAIN_FREEZE_TELL
  284.  
  285.  
  286. # Define spool directory
  287. .ifndef SPOOLDIR
  288. SPOOLDIR = /var/spool/exim4
  289. .endif
  290. spool_directory = SPOOLDIR
  291.  
  292.  
  293. # trusted users can set envelope-from to arbitrary values
  294. .ifndef MAIN_TRUSTED_USERS
  295. MAIN_TRUSTED_USERS = uucp
  296. .endif
  297. trusted_users = MAIN_TRUSTED_USERS
  298. .ifdef MAIN_TRUSTED_GROUPS
  299. trusted_groups = MAIN_TRUSTED_GROUPS
  300. .endif
  301.  
  302.  
  303. # users in admin group can do many other things
  304. # admin_groups = <unset>
  305.  
  306.  
  307. # SMTP Banner. The example includes the Debian version in the SMTP dialog
  308. # MAIN_SMTP_BANNER = "${primary_hostname} ESMTP Exim ${version_number} (Debian package MAIN_PACKAGE_VERSION) ${tod_full}"
  309. # smtp_banner = $smtp_active_hostname ESMTP Exim $version_number $tod_full
  310.  
  311. .ifdef MAIN_KEEP_ENVIRONMENT
  312. keep_environment = MAIN_KEEP_ENVIRONMENT
  313. .else
  314. # set option to empty value to avoid warning.
  315. keep_environment =
  316. .endif
  317. .ifdef MAIN_ADD_ENVIRONMENT
  318. add_environment = MAIN_ADD_ENVIRONMENT
  319. .endif
  320. #####################################################
  321. ### end main/02_exim4-config_options
  322. #####################################################
  323. #####################################################
  324. ### main/03_exim4-config_tlsoptions
  325. #####################################################
  326.  
  327. ### main/03_exim4-config_tlsoptions
  328. #################################
  329.  
  330. # TLS/SSL configuration for exim as an SMTP server.
  331. # See /usr/share/doc/exim4-base/README.Debian.gz for explanations.
  332.  
  333. .ifdef MAIN_TLS_ENABLE
  334. # Defines what hosts to 'advertise' STARTTLS functionality to. The
  335. # default, *, will advertise to all hosts that connect with EHLO.
  336. .ifndef MAIN_TLS_ADVERTISE_HOSTS
  337. MAIN_TLS_ADVERTISE_HOSTS = *
  338. .endif
  339. tls_advertise_hosts = MAIN_TLS_ADVERTISE_HOSTS
  340.  
  341.  
  342. # Full paths to Certificate and Private Key. The Private Key file
  343. # must be kept 'secret' and should be owned by root.Debian-exim mode
  344. # 640 (-rw-r-----). exim-gencert takes care of these prerequisites.
  345. # Normally, exim4 looks for certificate and key in different files:
  346. # MAIN_TLS_CERTIFICATE - path to certificate file,
  347. # CONFDIR/exim.crt if unset
  348. # MAIN_TLS_PRIVATEKEY - path to private key file
  349. # CONFDIR/exim.key if unset
  350. # You can also configure exim to look for certificate and key in the
  351. # same file, set MAIN_TLS_CERTKEY to that file to enable. This takes
  352. # precedence over all other settings regarding certificate and key file.
  353. .ifdef MAIN_TLS_CERTKEY
  354. tls_certificate = MAIN_TLS_CERTKEY
  355. .else
  356. .ifndef MAIN_TLS_CERTIFICATE
  357. MAIN_TLS_CERTIFICATE = CONFDIR/exim.crt
  358. .endif
  359. tls_certificate = MAIN_TLS_CERTIFICATE
  360.  
  361. .ifndef MAIN_TLS_PRIVATEKEY
  362. MAIN_TLS_PRIVATEKEY = CONFDIR/exim.key
  363. .endif
  364. tls_privatekey = MAIN_TLS_PRIVATEKEY
  365. .endif
  366.  
  367. # Pointer to the CA Certificates against which client certificates are
  368. # checked. This is controlled by the `tls_verify_hosts' and
  369. # `tls_try_verify_hosts' lists below.
  370. # If you want to check server certificates, you need to add an
  371. # tls_verify_certificates statement to the smtp transport.
  372. # /etc/ssl/certs/ca-certificates.crt is generated by
  373. # the "ca-certificates" package's update-ca-certificates(8) command.
  374. .ifndef MAIN_TLS_VERIFY_CERTIFICATES
  375. MAIN_TLS_VERIFY_CERTIFICATES = ${if exists{/etc/ssl/certs/ca-certificates.crt}\
  376. {/etc/ssl/certs/ca-certificates.crt}\
  377. {/dev/null}}
  378. .endif
  379. tls_verify_certificates = MAIN_TLS_VERIFY_CERTIFICATES
  380.  
  381.  
  382. # A list of hosts which are constrained by `tls_verify_certificates'. A host
  383. # that matches `tls_verify_host' must present a certificate that is
  384. # verifyable through `tls_verify_certificates' in order to be accepted as an
  385. # SMTP client. If it does not, the connection is aborted.
  386. .ifdef MAIN_TLS_VERIFY_HOSTS
  387. tls_verify_hosts = MAIN_TLS_VERIFY_HOSTS
  388. .endif
  389.  
  390. # A weaker form of checking: if a client matches `tls_try_verify_hosts' (but
  391. # not `tls_verify_hosts'), request a certificate and check it against
  392. # `tls_verify_certificates' but do not abort the connection if there is no
  393. # certificate or if the certificate presented does not match. (This
  394. # condition can be tested for in ACLs through `verify = certificate')
  395. # By default, this check is done for all hosts. It is known that some
  396. # clients (including incredimail's version downloadable in February
  397. # 2008) choke on this. To disable, set MAIN_TLS_TRY_VERIFY_HOSTS to an
  398. # empty value.
  399. .ifdef MAIN_TLS_TRY_VERIFY_HOSTS
  400. tls_try_verify_hosts = MAIN_TLS_TRY_VERIFY_HOSTS
  401. .endif
  402.  
  403. .endif
  404. #####################################################
  405. ### end main/03_exim4-config_tlsoptions
  406. #####################################################
  407. #####################################################
  408. ### main/90_exim4-config_log_selector
  409. #####################################################
  410.  
  411. ### main/90_exim4-config_log_selector
  412. #################################
  413.  
  414. # uncomment this for debugging
  415. # MAIN_LOG_SELECTOR == MAIN_LOG_SELECTOR +all -subject -arguments
  416.  
  417. .ifdef MAIN_LOG_SELECTOR
  418. log_selector = MAIN_LOG_SELECTOR
  419. .endif
  420. #####################################################
  421. ### end main/90_exim4-config_log_selector
  422. #####################################################
  423. #####################################################
  424. ### acl/00_exim4-config_header
  425. #####################################################
  426.  
  427. ######################################################################
  428. # ACL CONFIGURATION #
  429. # Specifies access control lists for incoming SMTP mail #
  430. ######################################################################
  431. begin acl
  432.  
  433.  
  434. #####################################################
  435. ### end acl/00_exim4-config_header
  436. #####################################################
  437. #####################################################
  438. ### acl/20_exim4-config_local_deny_exceptions
  439. #####################################################
  440.  
  441. ### acl/20_exim4-config_local_deny_exceptions
  442. #################################
  443.  
  444. # This is used to determine whitelisted senders and hosts.
  445. # It checks for CONFDIR/host_local_deny_exceptions and
  446. # CONFDIR/sender_local_deny_exceptions.
  447. #
  448. # It is meant to be used from some other acl entry.
  449. #
  450. # See exim4-config_files(5) for details.
  451. #
  452. # If the files do not exist, the white list never matches, which is
  453. # the desired behaviour.
  454. #
  455. # The old file names CONFDIR/local_host_whitelist and
  456. # CONFDIR/local_sender_whitelist will continue to be honored for a
  457. # transition period. Their use is deprecated.
  458.  
  459. acl_local_deny_exceptions:
  460. accept
  461. hosts = ${if exists{CONFDIR/host_local_deny_exceptions}\
  462. {CONFDIR/host_local_deny_exceptions}\
  463. {}}
  464. accept
  465. senders = ${if exists{CONFDIR/sender_local_deny_exceptions}\
  466. {CONFDIR/sender_local_deny_exceptions}\
  467. {}}
  468. accept
  469. hosts = ${if exists{CONFDIR/local_host_whitelist}\
  470. {CONFDIR/local_host_whitelist}\
  471. {}}
  472. accept
  473. senders = ${if exists{CONFDIR/local_sender_whitelist}\
  474. {CONFDIR/local_sender_whitelist}\
  475. {}}
  476.  
  477. # This hook allows you to hook in your own ACLs without having to
  478. # modify this file. If you do it like we suggest, you'll end up with
  479. # a small performance penalty since there is an additional file being
  480. # accessed. This doesn't happen if you leave the macro unset.
  481. .ifdef LOCAL_DENY_EXCEPTIONS_LOCAL_ACL_FILE
  482. .include LOCAL_DENY_EXCEPTIONS_LOCAL_ACL_FILE
  483. .endif
  484.  
  485. # this is still supported for a transition period and is deprecated.
  486. .ifdef WHITELIST_LOCAL_DENY_LOCAL_ACL_FILE
  487. .include WHITELIST_LOCAL_DENY_LOCAL_ACL_FILE
  488. .endif
  489. #####################################################
  490. ### end acl/20_exim4-config_local_deny_exceptions
  491. #####################################################
  492. #####################################################
  493. ### acl/30_exim4-config_check_mail
  494. #####################################################
  495.  
  496. ### acl/30_exim4-config_check_mail
  497. #################################
  498.  
  499. # This access control list is used for every MAIL command in an incoming
  500. # SMTP message. The tests are run in order until the address is either
  501. # accepted or denied.
  502. #
  503. acl_check_mail:
  504. .ifdef CHECK_MAIL_HELO_ISSUED
  505. deny
  506. message = no HELO given before MAIL command
  507. condition = ${if def:sender_helo_name {no}{yes}}
  508. .endif
  509.  
  510. accept
  511. #####################################################
  512. ### end acl/30_exim4-config_check_mail
  513. #####################################################
  514. #####################################################
  515. ### acl/30_exim4-config_check_rcpt
  516. #####################################################
  517.  
  518. ### acl/30_exim4-config_check_rcpt
  519. #################################
  520.  
  521. # This access control list is used for every RCPT command in an incoming
  522. # SMTP message. The tests are run in order until the address is either
  523. # accepted or denied.
  524. #
  525. acl_check_rcpt:
  526.  
  527. # Accept if the source is local SMTP (i.e. not over TCP/IP). We do this by
  528. # testing for an empty sending host field.
  529. accept
  530. hosts = :
  531. control = dkim_disable_verify
  532.  
  533. # Do not try to verify DKIM signatures of incoming mail if DC_minimaldns
  534. # or DISABLE_DKIM_VERIFY are set.
  535. .ifdef DC_minimaldns
  536. warn
  537. control = dkim_disable_verify
  538. .else
  539. .ifdef DISABLE_DKIM_VERIFY
  540. warn
  541. control = dkim_disable_verify
  542. .endif
  543. .endif
  544.  
  545. # The following section of the ACL is concerned with local parts that contain
  546. # certain non-alphanumeric characters. Dots in unusual places are
  547. # handled by this ACL as well.
  548. #
  549. # Non-alphanumeric characters other than dots are rarely found in genuine
  550. # local parts, but are often tried by people looking to circumvent
  551. # relaying restrictions. Therefore, although they are valid in local
  552. # parts, these rules disallow certain non-alphanumeric characters, as
  553. # a precaution.
  554. #
  555. # Empty components (two dots in a row) are not valid in RFC 2822, but Exim
  556. # allows them because they have been encountered. (Consider local parts
  557. # constructed as "firstinitial.secondinitial.familyname" when applied to
  558. # a name without a second initial.) However, a local part starting
  559. # with a dot or containing /../ can cause trouble if it is used as part of a
  560. # file name (e.g. for a mailing list). This is also true for local parts that
  561. # contain slashes. A pipe symbol can also be troublesome if the local part is
  562. # incorporated unthinkingly into a shell command line.
  563. #
  564. # These ACL components will block recipient addresses that are valid
  565. # from an RFC2822 point of view. We chose to have them blocked by
  566. # default for security reasons.
  567. #
  568. # If you feel that your site should have less strict recipient
  569. # checking, please feel free to change the default values of the macros
  570. # defined in main/01_exim4-config_listmacrosdefs or override them from a
  571. # local configuration file.
  572. #
  573. # Two different rules are used. The first one has a quite strict
  574. # default, and is applied to messages that are addressed to one of the
  575. # local domains handled by this host.
  576.  
  577. # The default value of CHECK_RCPT_LOCAL_LOCALPARTS is defined in
  578. # main/01_exim4-config_listmacrosdefs:
  579. # CHECK_RCPT_LOCAL_LOCALPARTS = ^[.] : ^.*[@%!/|`#&?]
  580. # This blocks local parts that begin with a dot or contain a quite
  581. # broad range of non-alphanumeric characters.
  582. .ifdef CHECK_RCPT_LOCAL_LOCALPARTS
  583. deny
  584. domains = +local_domains
  585. local_parts = CHECK_RCPT_LOCAL_LOCALPARTS
  586. message = restricted characters in address
  587. .endif
  588.  
  589.  
  590. # The second rule applies to all other domains, and its default is
  591. # considerably less strict.
  592.  
  593. # The default value of CHECK_RCPT_REMOTE_LOCALPARTS is defined in
  594. # main/01_exim4-config_listmacrosdefs:
  595. # CHECK_RCPT_REMOTE_LOCALPARTS = ^[./|] : ^.*[@%!`#&?] : ^.*/\\.\\./
  596.  
  597. # It allows local users to send outgoing messages to sites
  598. # that use slashes and vertical bars in their local parts. It blocks
  599. # local parts that begin with a dot, slash, or vertical bar, but allows
  600. # these characters within the local part. However, the sequence /../ is
  601. # barred. The use of some other non-alphanumeric characters is blocked.
  602. # Single quotes might probably be dangerous as well, but they're
  603. # allowed by the default regexps to avoid rejecting mails to Ireland.
  604. # The motivation here is to prevent local users (or local users' malware)
  605. # from mounting certain kinds of attack on remote sites.
  606. .ifdef CHECK_RCPT_REMOTE_LOCALPARTS
  607. deny
  608. domains = !+local_domains
  609. local_parts = CHECK_RCPT_REMOTE_LOCALPARTS
  610. message = restricted characters in address
  611. .endif
  612.  
  613.  
  614. # Accept mail to postmaster in any local domain, regardless of the source,
  615. # and without verifying the sender.
  616. #
  617. accept
  618. .ifndef CHECK_RCPT_POSTMASTER
  619. local_parts = postmaster
  620. .else
  621. local_parts = CHECK_RCPT_POSTMASTER
  622. .endif
  623. domains = +local_domains : +relay_to_domains
  624.  
  625.  
  626. # Deny unless the sender address can be verified.
  627. #
  628. # This is disabled by default so that DNSless systems don't break. If
  629. # your system can do DNS lookups without delay or cost, you might want
  630. # to enable this feature.
  631. #
  632. # This feature does not work in smarthost and satellite setups as
  633. # with these setups all domains pass verification. See spec.txt chapter
  634. # 39.31 with the added information that a smarthost/satellite setup
  635. # routes all non-local e-mail to the smarthost.
  636. .ifdef CHECK_RCPT_VERIFY_SENDER
  637. deny
  638. message = Sender verification failed
  639. !acl = acl_local_deny_exceptions
  640. !verify = sender
  641. .endif
  642.  
  643. # Verify senders listed in local_sender_callout with a callout.
  644. #
  645. # In smarthost and satellite setups, this causes the callout to be
  646. # done to the smarthost. Verification will thus only be reliable if the
  647. # smarthost does reject illegal addresses in the SMTP dialog.
  648. deny
  649. !acl = acl_local_deny_exceptions
  650. senders = ${if exists{CONFDIR/local_sender_callout}\
  651. {CONFDIR/local_sender_callout}\
  652. {}}
  653. !verify = sender/callout
  654.  
  655.  
  656. # Accept if the message comes from one of the hosts for which we are an
  657. # outgoing relay. It is assumed that such hosts are most likely to be MUAs,
  658. # so we set control=submission to make Exim treat the message as a
  659. # submission. It will fix up various errors in the message, for example, the
  660. # lack of a Date: header line. If you are actually relaying out out from
  661. # MTAs, you may want to disable this. If you are handling both relaying from
  662. # MTAs and submissions from MUAs you should probably split them into two
  663. # lists, and handle them differently.
  664.  
  665. # Recipient verification is omitted here, because in many cases the clients
  666. # are dumb MUAs that don't cope well with SMTP error responses. If you are
  667. # actually relaying out from MTAs, you should probably add recipient
  668. # verification here.
  669.  
  670. # Note that, by putting this test before any DNS black list checks, you will
  671. # always accept from these hosts, even if they end up on a black list. The
  672. # assumption is that they are your friends, and if they get onto black
  673. # list, it is a mistake.
  674. accept
  675. hosts = +relay_from_hosts
  676. control = submission/sender_retain
  677. control = dkim_disable_verify
  678.  
  679.  
  680. # Accept if the message arrived over an authenticated connection, from
  681. # any host. Again, these messages are usually from MUAs, so recipient
  682. # verification is omitted, and submission mode is set. And again, we do this
  683. # check before any black list tests.
  684. accept
  685. authenticated = *
  686. control = submission/sender_retain
  687. control = dkim_disable_verify
  688.  
  689.  
  690. # Insist that any other recipient address that we accept is either in one of
  691. # our local domains, or is in a domain for which we explicitly allow
  692. # relaying. Any other domain is rejected as being unacceptable for relaying.
  693. require
  694. message = relay not permitted
  695. domains = +local_domains : +relay_to_domains
  696.  
  697.  
  698. # We also require all accepted addresses to be verifiable. This check will
  699. # do local part verification for local domains, but only check the domain
  700. # for remote domains.
  701. require
  702. verify = recipient
  703.  
  704.  
  705. # Verify recipients listed in local_rcpt_callout with a callout.
  706. # This is especially handy for forwarding MX hosts (secondary MX or
  707. # mail hubs) of domains that receive a lot of spam to non-existent
  708. # addresses. The only way to check local parts for remote relay
  709. # domains is to use a callout (add /callout), but please read the
  710. # documentation about callouts before doing this.
  711. deny
  712. !acl = acl_local_deny_exceptions
  713. recipients = ${if exists{CONFDIR/local_rcpt_callout}\
  714. {CONFDIR/local_rcpt_callout}\
  715. {}}
  716. !verify = recipient/callout
  717.  
  718.  
  719. # CONFDIR/local_sender_blacklist holds a list of envelope senders that
  720. # should have their access denied to the local host. Incoming messages
  721. # with one of these senders are rejected at RCPT time.
  722. #
  723. # The explicit white lists are honored as well as negative items in
  724. # the black list. See exim4-config_files(5) for details.
  725. deny
  726. message = sender envelope address $sender_address is locally blacklisted here. If you think this is wrong, get in touch with postmaster
  727. !acl = acl_local_deny_exceptions
  728. senders = ${if exists{CONFDIR/local_sender_blacklist}\
  729. {CONFDIR/local_sender_blacklist}\
  730. {}}
  731.  
  732.  
  733. # deny bad sites (IP address)
  734. # CONFDIR/local_host_blacklist holds a list of host names, IP addresses
  735. # and networks (CIDR notation) that should have their access denied to
  736. # The local host. Messages coming in from a listed host will have all
  737. # RCPT statements rejected.
  738. #
  739. # The explicit white lists are honored as well as negative items in
  740. # the black list. See exim4-config_files(5) for details.
  741. deny
  742. message = sender IP address $sender_host_address is locally blacklisted here. If you think this is wrong, get in touch with postmaster
  743. !acl = acl_local_deny_exceptions
  744. hosts = ${if exists{CONFDIR/local_host_blacklist}\
  745. {CONFDIR/local_host_blacklist}\
  746. {}}
  747.  
  748.  
  749. # Warn if the sender host does not have valid reverse DNS.
  750. #
  751. # If your system can do DNS lookups without delay or cost, you might want
  752. # to enable this.
  753. # If sender_host_address is defined, it's a remote call. If
  754. # sender_host_name is not defined, then reverse lookup failed. Use
  755. # this instead of !verify = reverse_host_lookup to catch deferrals
  756. # as well as outright failures.
  757. .ifdef CHECK_RCPT_REVERSE_DNS
  758. warn
  759. condition = ${if and{{def:sender_host_address}{!def:sender_host_name}}\
  760. {yes}{no}}
  761. add_header = X-Host-Lookup-Failed: Reverse DNS lookup failed for $sender_host_address (${if eq{$host_lookup_failed}{1}{failed}{deferred}})
  762. .endif
  763.  
  764.  
  765. # Use spfquery to perform a pair of SPF checks (for details, see
  766. # http://www.openspf.org/)
  767. #
  768. # This is quite costly in terms of DNS lookups (~6 lookups per mail). Do not
  769. # enable if that's an issue. Also note that if you enable this, you must
  770. # install "spf-tools-perl" which provides the spfquery command.
  771. # Missing spf-tools-perl will trigger the "Unexpected error in
  772. # SPF check" warning.
  773. .ifdef CHECK_RCPT_SPF
  774. deny
  775. message = [SPF] $sender_host_address is not allowed to send mail from \
  776. ${if def:sender_address_domain {$sender_address_domain}{$sender_helo_name}}. \
  777. Please see \
  778. http://www.openspf.org/Why?scope=${if def:sender_address_domain \
  779. {mfrom}{helo}};identity=${if def:sender_address_domain \
  780. {$sender_address}{$sender_helo_name}};ip=$sender_host_address
  781. log_message = SPF check failed.
  782. !acl = acl_local_deny_exceptions
  783. condition = ${run{/usr/bin/spfquery.mail-spf-perl --ip \
  784. ${quote:$sender_host_address} --identity \
  785. ${if def:sender_address_domain \
  786. {--scope mfrom --identity ${quote:$sender_address}}\
  787. {--scope helo --identity ${quote:$sender_helo_name}}}}\
  788. {no}{${if eq {$runrc}{1}{yes}{no}}}}
  789.  
  790. defer
  791. message = Temporary DNS error while checking SPF record. Try again later.
  792. !acl = acl_local_deny_exceptions
  793. condition = ${if eq {$runrc}{5}{yes}{no}}
  794.  
  795. warn
  796. condition = ${if <={$runrc}{6}{yes}{no}}
  797. add_header = Received-SPF: ${if eq {$runrc}{0}{pass}\
  798. {${if eq {$runrc}{2}{softfail}\
  799. {${if eq {$runrc}{3}{neutral}\
  800. {${if eq {$runrc}{4}{permerror}\
  801. {${if eq {$runrc}{6}{none}{error}}}}}}}}}\
  802. } client-ip=$sender_host_address; \
  803. ${if def:sender_address_domain \
  804. {envelope-from=${sender_address}; }{}}\
  805. helo=$sender_helo_name
  806.  
  807. warn
  808. log_message = Unexpected error in SPF check.
  809. condition = ${if >{$runrc}{6}{yes}{no}}
  810. .endif
  811.  
  812.  
  813. # Check against classic DNS "black" lists (DNSBLs) which list
  814. # sender IP addresses
  815. .ifdef CHECK_RCPT_IP_DNSBLS
  816. warn
  817. dnslists = CHECK_RCPT_IP_DNSBLS
  818. add_header = X-Warning: $sender_host_address is listed at $dnslist_domain ($dnslist_value: $dnslist_text)
  819. log_message = $sender_host_address is listed at $dnslist_domain ($dnslist_value: $dnslist_text)
  820. .endif
  821.  
  822.  
  823. # Check against DNSBLs which list sender domains, with an option to locally
  824. # whitelist certain domains that might be blacklisted.
  825. #
  826. # Note: If you define CHECK_RCPT_DOMAIN_DNSBLS, you must append
  827. # "/$sender_address_domain" after each domain. For example:
  828. # CHECK_RCPT_DOMAIN_DNSBLS = rhsbl.foo.org/$sender_address_domain \
  829. # : rhsbl.bar.org/$sender_address_domain
  830. .ifdef CHECK_RCPT_DOMAIN_DNSBLS
  831. warn
  832. !senders = ${if exists{CONFDIR/local_domain_dnsbl_whitelist}\
  833. {CONFDIR/local_domain_dnsbl_whitelist}\
  834. {}}
  835. dnslists = CHECK_RCPT_DOMAIN_DNSBLS
  836. add_header = X-Warning: $sender_address_domain is listed at $dnslist_domain ($dnslist_value: $dnslist_text)
  837. log_message = $sender_address_domain is listed at $dnslist_domain ($dnslist_value: $dnslist_text)
  838. .endif
  839.  
  840.  
  841. # This hook allows you to hook in your own ACLs without having to
  842. # modify this file. If you do it like we suggest, you'll end up with
  843. # a small performance penalty since there is an additional file being
  844. # accessed. This doesn't happen if you leave the macro unset.
  845. .ifdef CHECK_RCPT_LOCAL_ACL_FILE
  846. .include CHECK_RCPT_LOCAL_ACL_FILE
  847. .endif
  848.  
  849.  
  850. #############################################################################
  851. # This check is commented out because it is recognized that not every
  852. # sysadmin will want to do it. If you enable it, the check performs
  853. # Client SMTP Authorization (csa) checks on the sending host. These checks
  854. # do DNS lookups for SRV records. The CSA proposal is currently (May 2005)
  855. # an Internet draft. You can, of course, add additional conditions to this
  856. # ACL statement to restrict the CSA checks to certain hosts only.
  857. #
  858. # require verify = csa
  859. #############################################################################
  860.  
  861.  
  862. # Accept if the address is in a domain for which we are an incoming relay,
  863. # but again, only if the recipient can be verified.
  864.  
  865. accept
  866. domains = +relay_to_domains
  867. endpass
  868. verify = recipient
  869.  
  870.  
  871. # At this point, the address has passed all the checks that have been
  872. # configured, so we accept it unconditionally.
  873.  
  874. accept
  875. #####################################################
  876. ### end acl/30_exim4-config_check_rcpt
  877. #####################################################
  878. #####################################################
  879. ### acl/40_exim4-config_check_data
  880. #####################################################
  881.  
  882. ### acl/40_exim4-config_check_data
  883. #################################
  884.  
  885. # This ACL is used after the contents of a message have been received. This
  886. # is the ACL in which you can test a message's headers or body, and in
  887. # particular, this is where you can invoke external virus or spam scanners.
  888.  
  889. acl_check_data:
  890.  
  891. # Deny unless the address list headers are syntactically correct.
  892. #
  893. # If you enable this, you might reject legitimate mail.
  894. .ifdef CHECK_DATA_VERIFY_HEADER_SYNTAX
  895. deny
  896. message = Message headers fail syntax check
  897. !acl = acl_local_deny_exceptions
  898. !verify = header_syntax
  899. .endif
  900.  
  901.  
  902. # require that there is a verifiable sender address in at least
  903. # one of the "Sender:", "Reply-To:", or "From:" header lines.
  904. .ifdef CHECK_DATA_VERIFY_HEADER_SENDER
  905. deny
  906. message = No verifiable sender address in message headers
  907. !acl = acl_local_deny_exceptions
  908. !verify = header_sender
  909. .endif
  910.  
  911.  
  912. # Deny if the message contains malware. Before enabling this check, you
  913. # must install a virus scanner and set the av_scanner option in the
  914. # main configuration.
  915. #
  916. # exim4-daemon-heavy must be used for this section to work.
  917. #
  918. # deny
  919. # malware = *
  920. # message = This message was detected as possible malware ($malware_name).
  921.  
  922.  
  923. # Add headers to a message if it is judged to be spam. Before enabling this,
  924. # you must install SpamAssassin. You also need to set the spamd_address
  925. # option in the main configuration.
  926. #
  927. # exim4-daemon-heavy must be used for this section to work.
  928. #
  929. # Please note that this is only suiteable as an example. There are
  930. # multiple issues with this configuration method. For example, if you go
  931. # this way, you'll give your spamassassin daemon write access to the
  932. # entire exim spool which might be a security issue in case of a
  933. # spamassassin exploit.
  934. #
  935. # See the exim docs and the exim wiki for more suitable examples.
  936. #
  937. # warn
  938. # spam = Debian-exim:true
  939. # add_header = X-Spam_score: $spam_score\n\
  940. # X-Spam_score_int: $spam_score_int\n\
  941. # X-Spam_bar: $spam_bar\n\
  942. # X-Spam_report: $spam_report
  943.  
  944.  
  945. # This hook allows you to hook in your own ACLs without having to
  946. # modify this file. If you do it like we suggest, you'll end up with
  947. # a small performance penalty since there is an additional file being
  948. # accessed. This doesn't happen if you leave the macro unset.
  949. .ifdef CHECK_DATA_LOCAL_ACL_FILE
  950. .include CHECK_DATA_LOCAL_ACL_FILE
  951. .endif
  952.  
  953.  
  954. # accept otherwise
  955. accept
  956. #####################################################
  957. ### end acl/40_exim4-config_check_data
  958. #####################################################
  959. #####################################################
  960. ### router/00_exim4-config_header
  961. #####################################################
  962.  
  963. ######################################################################
  964. # ROUTERS CONFIGURATION #
  965. # Specifies how addresses are handled #
  966. ######################################################################
  967. # THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT! #
  968. # An address is passed to each router in turn until it is accepted. #
  969. ######################################################################
  970.  
  971. begin routers
  972.  
  973. #####################################################
  974. ### end router/00_exim4-config_header
  975. #####################################################
  976. #####################################################
  977. ### router/100_exim4-config_domain_literal
  978. #####################################################
  979.  
  980. ### router/100_exim4-config_domain_literal
  981. #################################
  982.  
  983. # This router handles e-mail addresses in "domain literal" form like
  984. # <user@[10.11.12.13]>. The RFCs require this facility, but it is disabled
  985. # in the default config since it is seldomly used and frequently abused.
  986. # Domain literal support also needs to be enabled in the main config,
  987. # which is automatically done if you use the enable macro
  988. # MAIN_ALLOW_DOMAIN_LITERALS.
  989.  
  990. .ifdef MAIN_ALLOW_DOMAIN_LITERALS
  991. domain_literal:
  992. debug_print = "R: domain_literal for $local_part@$domain"
  993. driver = ipliteral
  994. domains = ! +local_domains
  995. transport = remote_smtp
  996. .endif
  997. #####################################################
  998. ### end router/100_exim4-config_domain_literal
  999. #####################################################
  1000. #####################################################
  1001. ### router/150_exim4-config_hubbed_hosts
  1002. #####################################################
  1003.  
  1004. # router/150_exim4-config_hubbed_hosts
  1005. #################################
  1006.  
  1007. # route specific domains manually.
  1008. #
  1009. # see exim4-config_files(5) and spec.txt chapter 20.3 through 20.7 for
  1010. # more detailed documentation.
  1011.  
  1012. hubbed_hosts:
  1013. debug_print = "R: hubbed_hosts for $domain"
  1014. driver = manualroute
  1015. domains = "${if exists{CONFDIR/hubbed_hosts}\
  1016. {partial-lsearch;CONFDIR/hubbed_hosts}\
  1017. fail}"
  1018. same_domain_copy_routing = yes
  1019. route_data = ${lookup{$domain}partial-lsearch{CONFDIR/hubbed_hosts}}
  1020. transport = remote_smtp
  1021. #####################################################
  1022. ### end router/150_exim4-config_hubbed_hosts
  1023. #####################################################
  1024. #####################################################
  1025. ### router/200_exim4-config_primary
  1026. #####################################################
  1027.  
  1028. ### router/200_exim4-config_primary
  1029. #################################
  1030. # This file holds the primary router, responsible for nonlocal mails
  1031.  
  1032. .ifdef DCconfig_internet
  1033. # configtype=internet
  1034. #
  1035. # deliver mail to the recipient if recipient domain is a domain we
  1036. # relay for. We do not ignore any target hosts here since delivering to
  1037. # a site local or even a link local address might be wanted here, and if
  1038. # such an address has found its way into the MX record of such a domain,
  1039. # the local admin is probably in a place where that broken MX record
  1040. # could be fixed.
  1041.  
  1042. dnslookup_relay_to_domains:
  1043. debug_print = "R: dnslookup_relay_to_domains for $local_part@$domain"
  1044. driver = dnslookup
  1045. domains = ! +local_domains : +relay_to_domains
  1046. transport = remote_smtp
  1047. same_domain_copy_routing = yes
  1048. no_more
  1049.  
  1050. # deliver mail directly to the recipient. This router is only reached
  1051. # for domains that we do not relay for. Since we most probably can't
  1052. # have broken MX records pointing to site local or link local IP
  1053. # addresses fixed, we ignore target hosts pointing to these addresses.
  1054.  
  1055. dnslookup:
  1056. debug_print = "R: dnslookup for $local_part@$domain"
  1057. driver = dnslookup
  1058. domains = ! +local_domains
  1059. transport = remote_smtp
  1060. same_domain_copy_routing = yes
  1061. # ignore private rfc1918 and APIPA addresses
  1062. ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 192.168.0.0/16 :\
  1063. 172.16.0.0/12 : 10.0.0.0/8 : 169.254.0.0/16 :\
  1064. 255.255.255.255
  1065. no_more
  1066.  
  1067. .endif
  1068.  
  1069.  
  1070. .ifdef DCconfig_local
  1071. # configtype=local
  1072. #
  1073. # Stand-alone system, so generate an error for mail to a non-local domain
  1074. nonlocal:
  1075. debug_print = "R: nonlocal for $local_part@$domain"
  1076. driver = redirect
  1077. domains = ! +local_domains
  1078. allow_fail
  1079. data = :fail: Mailing to remote domains not supported
  1080. no_more
  1081.  
  1082. .endif
  1083.  
  1084.  
  1085. .ifdef DCconfig_smarthost DCconfig_satellite
  1086. # configtype=smarthost or configtype=satellite
  1087. #
  1088. # Send all non-local mail to a single other machine (smarthost).
  1089. #
  1090. # This means _ALL_ non-local mail goes to the smarthost. This will most
  1091. # probably not do what you want for domains that are listed in
  1092. # relay_domains. The most typical use for relay_domains is to control
  1093. # relaying for incoming e-mail on secondary MX hosts. In that case,
  1094. # it doesn't make sense to send the mail to the smarthost since the
  1095. # smarthost will probably send the message right back here, causing a
  1096. # loop.
  1097. #
  1098. # If you want to use a smarthost while being secondary MX for some
  1099. # domains, you'll need to copy the dnslookup_relay_to_domains router
  1100. # here so that mail to relay_domains is handled separately.
  1101.  
  1102. smarthost:
  1103. debug_print = "R: smarthost for $local_part@$domain"
  1104. driver = manualroute
  1105. domains = ! +local_domains
  1106. transport = remote_smtp_smarthost
  1107. route_list = * DCsmarthost byname
  1108. host_find_failed = ignore
  1109. same_domain_copy_routing = yes
  1110. no_more
  1111.  
  1112. .endif
  1113.  
  1114.  
  1115. # The "no_more" above means that all later routers are for
  1116. # domains in the local_domains list, i.e. just like Exim 3 directors.
  1117. #####################################################
  1118. ### end router/200_exim4-config_primary
  1119. #####################################################
  1120. #####################################################
  1121. ### router/300_exim4-config_real_local
  1122. #####################################################
  1123.  
  1124. ### router/300_exim4-config_real_local
  1125. #################################
  1126.  
  1127. # This router allows reaching a local user while avoiding local
  1128. # processing. This can be used to inform a user of a broken .forward
  1129. # file, for example. The userforward router does this.
  1130.  
  1131. COND_LOCAL_SUBMITTER = "\
  1132. ${if match_ip{$sender_host_address}{:@[]}\
  1133. {1}{0}\
  1134. }"
  1135.  
  1136. real_local:
  1137. debug_print = "R: real_local for $local_part@$domain"
  1138. driver = accept
  1139. domains = +local_domains
  1140. condition = COND_LOCAL_SUBMITTER
  1141. local_part_prefix = real-
  1142. check_local_user
  1143. transport = LOCAL_DELIVERY
  1144.  
  1145. #####################################################
  1146. ### end router/300_exim4-config_real_local
  1147. #####################################################
  1148. #####################################################
  1149. ### router/400_exim4-config_system_aliases
  1150. #####################################################
  1151.  
  1152. ### router/400_exim4-config_system_aliases
  1153. #################################
  1154.  
  1155. # This router handles aliasing using a traditional /etc/aliases file.
  1156. #
  1157. ##### NB You must ensure that /etc/aliases exists. It used to be the case
  1158. ##### NB that every Unix had that file, because it was the Sendmail default.
  1159. ##### NB These days, there are systems that don't have it. Your aliases
  1160. ##### NB file should at least contain an alias for "postmaster".
  1161. #
  1162. # This router handles the local part in a case-insensitive way which
  1163. # satisfies the RFCs requirement that postmaster be reachable regardless
  1164. # of case. If you decide to handle /etc/aliases in a caseful way, you
  1165. # need to make arrangements for a caseless postmaster.
  1166. #
  1167. # Delivery to arbitrary directories, files, and piping to programs in
  1168. # /etc/aliases is disabled per default.
  1169. # If that is a problem for you, see
  1170. # /usr/share/doc/exim4-base/README.Debian.gz
  1171. # for explanation and some workarounds.
  1172.  
  1173. system_aliases:
  1174. debug_print = "R: system_aliases for $local_part@$domain"
  1175. driver = redirect
  1176. domains = +local_domains
  1177. allow_fail
  1178. allow_defer
  1179. data = ${lookup{$local_part}lsearch{/etc/aliases}}
  1180. .ifdef SYSTEM_ALIASES_USER
  1181. user = SYSTEM_ALIASES_USER
  1182. .endif
  1183. .ifdef SYSTEM_ALIASES_GROUP
  1184. group = SYSTEM_ALIASES_GROUP
  1185. .endif
  1186. .ifdef SYSTEM_ALIASES_FILE_TRANSPORT
  1187. file_transport = SYSTEM_ALIASES_FILE_TRANSPORT
  1188. .endif
  1189. .ifdef SYSTEM_ALIASES_PIPE_TRANSPORT
  1190. pipe_transport = SYSTEM_ALIASES_PIPE_TRANSPORT
  1191. .endif
  1192. .ifdef SYSTEM_ALIASES_DIRECTORY_TRANSPORT
  1193. directory_transport = SYSTEM_ALIASES_DIRECTORY_TRANSPORT
  1194. .endif
  1195. #####################################################
  1196. ### end router/400_exim4-config_system_aliases
  1197. #####################################################
  1198. #####################################################
  1199. ### router/500_exim4-config_hubuser
  1200. #####################################################
  1201.  
  1202. ### router/500_exim4-config_hubuser
  1203. #################################
  1204.  
  1205. .ifdef DCconfig_satellite
  1206. # This router is only used for configtype=satellite.
  1207. # It takes care to route all mail targetted to <somelocaluser@this.machine>
  1208. # to the host where we read our mail
  1209. #
  1210. hub_user:
  1211. debug_print = "R: hub_user for $local_part@$domain"
  1212. driver = redirect
  1213. domains = +local_domains
  1214. data = ${local_part}@DCreadhost
  1215. check_local_user
  1216.  
  1217. # Grab the redirected mail and deliver it.
  1218. # This is a duplicate of the smarthost router, needed because
  1219. # DCreadhost might end up as part of +local_domains
  1220. hub_user_smarthost:
  1221. debug_print = "R: hub_user_smarthost for $local_part@$domain"
  1222. driver = manualroute
  1223. domains = DCreadhost
  1224. transport = remote_smtp_smarthost
  1225. route_list = * DCsmarthost byname
  1226. host_find_failed = ignore
  1227. same_domain_copy_routing = yes
  1228. check_local_user
  1229. .endif
  1230.  
  1231.  
  1232. #####################################################
  1233. ### end router/500_exim4-config_hubuser
  1234. #####################################################
  1235. #####################################################
  1236. ### router/600_exim4-config_userforward
  1237. #####################################################
  1238.  
  1239. ### router/600_exim4-config_userforward
  1240. #################################
  1241.  
  1242. # This router handles forwarding using traditional .forward files in users'
  1243. # home directories. It also allows mail filtering with a forward file
  1244. # starting with the string "# Exim filter" or "# Sieve filter".
  1245. #
  1246. # The no_verify setting means that this router is skipped when Exim is
  1247. # verifying addresses. Similarly, no_expn means that this router is skipped if
  1248. # Exim is processing an EXPN command.
  1249. #
  1250. # The check_ancestor option means that if the forward file generates an
  1251. # address that is an ancestor of the current one, the current one gets
  1252. # passed on instead. This covers the case where A is aliased to B and B
  1253. # has a .forward file pointing to A.
  1254. #
  1255. # The four transports specified at the end are those that are used when
  1256. # forwarding generates a direct delivery to a directory, or a file, or to a
  1257. # pipe, or sets up an auto-reply, respectively.
  1258. #
  1259. userforward:
  1260. debug_print = "R: userforward for $local_part@$domain"
  1261. driver = redirect
  1262. domains = +local_domains
  1263. check_local_user
  1264. file = $home/.forward
  1265. require_files = $local_part:$home/.forward
  1266. no_verify
  1267. no_expn
  1268. check_ancestor
  1269. allow_filter
  1270. forbid_smtp_code = true
  1271. directory_transport = address_directory
  1272. file_transport = address_file
  1273. pipe_transport = address_pipe
  1274. reply_transport = address_reply
  1275. skip_syntax_errors
  1276. syntax_errors_to = real-$local_part@$domain
  1277. syntax_errors_text = \
  1278. This is an automatically generated message. An error has\n\
  1279. been found in your .forward file. Details of the error are\n\
  1280. reported below. While this error persists, you will receive\n\
  1281. a copy of this message for every message that is addressed\n\
  1282. to you. If your .forward file is a filter file, or if it is\n\
  1283. a non-filter file containing no valid forwarding addresses,\n\
  1284. a copy of each incoming message will be put in your normal\n\
  1285. mailbox. If a non-filter file contains at least one valid\n\
  1286. forwarding address, forwarding to the valid addresses will\n\
  1287. happen, and those will be the only deliveries that occur.
  1288.  
  1289. #####################################################
  1290. ### end router/600_exim4-config_userforward
  1291. #####################################################
  1292. #####################################################
  1293. ### router/700_exim4-config_procmail
  1294. #####################################################
  1295.  
  1296. procmail:
  1297. debug_print = "R: procmail for $local_part@$domain"
  1298. driver = accept
  1299. domains = +local_domains
  1300. check_local_user
  1301. transport = procmail_pipe
  1302. # emulate OR with "if exists"-expansion
  1303. require_files = ${local_part}:\
  1304. ${if exists{/etc/procmailrc}\
  1305. {/etc/procmailrc}{${home}/.procmailrc}}:\
  1306. +/usr/bin/procmail
  1307. no_verify
  1308. no_expn
  1309.  
  1310. #####################################################
  1311. ### end router/700_exim4-config_procmail
  1312. #####################################################
  1313. #####################################################
  1314. ### router/800_exim4-config_maildrop
  1315. #####################################################
  1316.  
  1317. ### router/800_exim4-config_maildrop
  1318. #################################
  1319.  
  1320. maildrop:
  1321. debug_print = "R: maildrop for $local_part@$domain"
  1322. driver = accept
  1323. domains = +local_domains
  1324. check_local_user
  1325. transport = maildrop_pipe
  1326. require_files = ${local_part}:${home}/.mailfilter:+/usr/bin/maildrop
  1327. no_verify
  1328. no_expn
  1329.  
  1330. #####################################################
  1331. ### end router/800_exim4-config_maildrop
  1332. #####################################################
  1333. #####################################################
  1334. ### router/850_exim4-config_lowuid
  1335. #####################################################
  1336.  
  1337. ### router/850_exim4-config_lowuid
  1338. #################################
  1339.  
  1340. .ifndef FIRST_USER_ACCOUNT_UID
  1341. FIRST_USER_ACCOUNT_UID = 0
  1342. .endif
  1343.  
  1344. .ifndef DEFAULT_SYSTEM_ACCOUNT_ALIAS
  1345. DEFAULT_SYSTEM_ACCOUNT_ALIAS = :fail: no mail to system accounts
  1346. .endif
  1347.  
  1348. COND_SYSTEM_USER_AND_REMOTE_SUBMITTER = "\
  1349. ${if and{{! match_ip{$sender_host_address}{:@[]}}\
  1350. {<{$local_user_uid}{FIRST_USER_ACCOUNT_UID}}}\
  1351. {1}{0}\
  1352. }"
  1353.  
  1354. lowuid_aliases:
  1355. debug_print = "R: lowuid_aliases for $local_part@$domain (UID $local_user_uid)"
  1356. check_local_user
  1357. driver = redirect
  1358. allow_fail
  1359. domains = +local_domains
  1360. condition = COND_SYSTEM_USER_AND_REMOTE_SUBMITTER
  1361. data = ${if exists{CONFDIR/lowuid-aliases}\
  1362. {${lookup{$local_part}lsearch{CONFDIR/lowuid-aliases}\
  1363. {$value}{DEFAULT_SYSTEM_ACCOUNT_ALIAS}}}\
  1364. {DEFAULT_SYSTEM_ACCOUNT_ALIAS}}
  1365. #####################################################
  1366. ### end router/850_exim4-config_lowuid
  1367. #####################################################
  1368. #####################################################
  1369. ### router/900_exim4-config_local_user
  1370. #####################################################
  1371.  
  1372. ### router/900_exim4-config_local_user
  1373. #################################
  1374.  
  1375. # This router matches local user mailboxes. If the router fails, the error
  1376. # message is "Unknown user".
  1377.  
  1378. local_user:
  1379. debug_print = "R: local_user for $local_part@$domain"
  1380. driver = accept
  1381. domains = +local_domains
  1382. check_local_user
  1383. local_parts = ! root
  1384. transport = LOCAL_DELIVERY
  1385. cannot_route_message = Unknown user
  1386. #####################################################
  1387. ### end router/900_exim4-config_local_user
  1388. #####################################################
  1389. #####################################################
  1390. ### router/mmm_mail4root
  1391. #####################################################
  1392.  
  1393. ### router/mmm_mail4root
  1394. #################################
  1395. # deliver mail addressed to root to /var/mail/mail as user mail:mail
  1396. # if it was not redirected in /etc/aliases or by other means
  1397. # Exim cannot deliver as root since 4.24 (FIXED_NEVER_USERS)
  1398.  
  1399. mail4root:
  1400. debug_print = "R: mail4root for $local_part@$domain"
  1401. driver = redirect
  1402. domains = +local_domains
  1403. data = /var/mail/mail
  1404. file_transport = address_file
  1405. local_parts = root
  1406. user = mail
  1407. group = mail
  1408.  
  1409. #####################################################
  1410. ### end router/mmm_mail4root
  1411. #####################################################
  1412. #####################################################
  1413. ### transport/00_exim4-config_header
  1414. #####################################################
  1415.  
  1416. ######################################################################
  1417. # TRANSPORTS CONFIGURATION #
  1418. ######################################################################
  1419. # ORDER DOES NOT MATTER #
  1420. # Only one appropriate transport is called for each delivery. #
  1421. ######################################################################
  1422.  
  1423. # A transport is used only when referenced from a router that successfully
  1424. # handles an address.
  1425.  
  1426. begin transports
  1427.  
  1428. #####################################################
  1429. ### end transport/00_exim4-config_header
  1430. #####################################################
  1431. #####################################################
  1432. ### transport/10_exim4-config_transport-macros
  1433. #####################################################
  1434.  
  1435. ### transport/10_exim4-config_transport-macros
  1436. #################################
  1437.  
  1438. .ifdef HIDE_MAILNAME
  1439. REMOTE_SMTP_HEADERS_REWRITE=*@+local_domains $1@DCreadhost frs : *@ETC_MAILNAME $1@DCreadhost frs
  1440. REMOTE_SMTP_RETURN_PATH=${if match_domain{$sender_address_domain}{+local_domains}{${sender_address_local_part}@DCreadhost}{${if match_domain{$sender_address_domain}{ETC_MAILNAME}{${sender_address_local_part}@DCreadhost}fail}}}
  1441. .endif
  1442.  
  1443. .ifdef REMOTE_SMTP_HELO_FROM_DNS
  1444. .ifdef REMOTE_SMTP_HELO_DATA
  1445. REMOTE_SMTP_HELO_DATA==${lookup dnsdb {ptr=$sending_ip_address}{$value}{$primary_hostname}}
  1446. .else
  1447. REMOTE_SMTP_HELO_DATA=${lookup dnsdb {ptr=$sending_ip_address}{$value}{$primary_hostname}}
  1448. .endif
  1449. .endif
  1450. #####################################################
  1451. ### end transport/10_exim4-config_transport-macros
  1452. #####################################################
  1453. #####################################################
  1454. ### transport/30_exim4-config_address_file
  1455. #####################################################
  1456.  
  1457. # This transport is used for handling deliveries directly to files that are
  1458. # generated by aliasing or forwarding.
  1459. #
  1460. address_file:
  1461. debug_print = "T: address_file for $local_part@$domain"
  1462. driver = appendfile
  1463. delivery_date_add
  1464. envelope_to_add
  1465. return_path_add
  1466.  
  1467. #####################################################
  1468. ### end transport/30_exim4-config_address_file
  1469. #####################################################
  1470. #####################################################
  1471. ### transport/30_exim4-config_address_pipe
  1472. #####################################################
  1473.  
  1474. # This transport is used for handling pipe deliveries generated by
  1475. # .forward files. If the commands fails and produces any output on standard
  1476. # output or standard error streams, the output is returned to the sender
  1477. # of the message as a delivery error.
  1478. address_pipe:
  1479. debug_print = "T: address_pipe for $local_part@$domain"
  1480. driver = pipe
  1481. return_fail_output
  1482.  
  1483. #####################################################
  1484. ### end transport/30_exim4-config_address_pipe
  1485. #####################################################
  1486. #####################################################
  1487. ### transport/30_exim4-config_address_reply
  1488. #####################################################
  1489.  
  1490. # This transport is used for handling autoreplies generated by the filtering
  1491. # option of the userforward router.
  1492. #
  1493. address_reply:
  1494. debug_print = "T: autoreply for $local_part@$domain"
  1495. driver = autoreply
  1496.  
  1497. #####################################################
  1498. ### end transport/30_exim4-config_address_reply
  1499. #####################################################
  1500. #####################################################
  1501. ### transport/30_exim4-config_mail_spool
  1502. #####################################################
  1503.  
  1504. ### transport/30_exim4-config_mail_spool
  1505.  
  1506. # This transport is used for local delivery to user mailboxes in traditional
  1507. # BSD mailbox format.
  1508. #
  1509. mail_spool:
  1510. debug_print = "T: appendfile for $local_part@$domain"
  1511. driver = appendfile
  1512. file = /var/mail/$local_part
  1513. delivery_date_add
  1514. envelope_to_add
  1515. return_path_add
  1516. group = mail
  1517. mode = 0660
  1518. mode_fail_narrower = false
  1519.  
  1520. #####################################################
  1521. ### end transport/30_exim4-config_mail_spool
  1522. #####################################################
  1523. #####################################################
  1524. ### transport/30_exim4-config_maildir_home
  1525. #####################################################
  1526.  
  1527. ### transport/30_exim4-config_maildir_home
  1528. #################################
  1529.  
  1530. # Use this instead of mail_spool if you want to to deliver to Maildir in
  1531. # home-directory - change the definition of LOCAL_DELIVERY
  1532. #
  1533. maildir_home:
  1534. debug_print = "T: maildir_home for $local_part@$domain"
  1535. driver = appendfile
  1536. .ifdef MAILDIR_HOME_MAILDIR_LOCATION
  1537. directory = MAILDIR_HOME_MAILDIR_LOCATION
  1538. .else
  1539. directory = $home/Maildir
  1540. .endif
  1541. .ifdef MAILDIR_HOME_CREATE_DIRECTORY
  1542. create_directory
  1543. .endif
  1544. .ifdef MAILDIR_HOME_CREATE_FILE
  1545. create_file = MAILDIR_HOME_CREATE_FILE
  1546. .endif
  1547. delivery_date_add
  1548. envelope_to_add
  1549. return_path_add
  1550. maildir_format
  1551. .ifdef MAILDIR_HOME_DIRECTORY_MODE
  1552. directory_mode = MAILDIR_HOME_DIRECTORY_MODE
  1553. .else
  1554. directory_mode = 0700
  1555. .endif
  1556. .ifdef MAILDIR_HOME_MODE
  1557. mode = MAILDIR_HOME_MODE
  1558. .else
  1559. mode = 0600
  1560. .endif
  1561. mode_fail_narrower = false
  1562. # This transport always chdirs to $home before trying to deliver. If
  1563. # $home is not accessible, this chdir fails and prevents delivery.
  1564. # If you are in a setup where home directories might not be
  1565. # accessible, uncomment the current_directory line below.
  1566. # current_directory = /
  1567. #####################################################
  1568. ### end transport/30_exim4-config_maildir_home
  1569. #####################################################
  1570. #####################################################
  1571. ### transport/30_exim4-config_maildrop_pipe
  1572. #####################################################
  1573.  
  1574. maildrop_pipe:
  1575. debug_print = "T: maildrop_pipe for $local_part@$domain"
  1576. driver = pipe
  1577. path = "/bin:/usr/bin:/usr/local/bin"
  1578. command = "/usr/bin/maildrop"
  1579. return_path_add
  1580. delivery_date_add
  1581. envelope_to_add
  1582.  
  1583. #####################################################
  1584. ### end transport/30_exim4-config_maildrop_pipe
  1585. #####################################################
  1586. #####################################################
  1587. ### transport/30_exim4-config_procmail_pipe
  1588. #####################################################
  1589.  
  1590. procmail_pipe:
  1591. debug_print = "T: procmail_pipe for $local_part@$domain"
  1592. driver = pipe
  1593. path = "/bin:/usr/bin:/usr/local/bin"
  1594. command = "/usr/bin/procmail"
  1595. return_path_add
  1596. delivery_date_add
  1597. envelope_to_add
  1598.  
  1599. #####################################################
  1600. ### end transport/30_exim4-config_procmail_pipe
  1601. #####################################################
  1602. #####################################################
  1603. ### transport/30_exim4-config_remote_smtp
  1604. #####################################################
  1605.  
  1606. ### transport/30_exim4-config_remote_smtp
  1607. #################################
  1608. # This transport is used for delivering messages over SMTP connections.
  1609.  
  1610. remote_smtp:
  1611. debug_print = "T: remote_smtp for $local_part@$domain"
  1612. driver = smtp
  1613. .ifdef REMOTE_SMTP_HOSTS_AVOID_TLS
  1614. hosts_avoid_tls = REMOTE_SMTP_HOSTS_AVOID_TLS
  1615. .endif
  1616. .ifdef REMOTE_SMTP_HEADERS_REWRITE
  1617. headers_rewrite = REMOTE_SMTP_HEADERS_REWRITE
  1618. .endif
  1619. .ifdef REMOTE_SMTP_RETURN_PATH
  1620. return_path = REMOTE_SMTP_RETURN_PATH
  1621. .endif
  1622. .ifdef REMOTE_SMTP_HELO_DATA
  1623. helo_data=REMOTE_SMTP_HELO_DATA
  1624. .endif
  1625. .ifdef DKIM_DOMAIN
  1626. dkim_domain = DKIM_DOMAIN
  1627. .endif
  1628. .ifdef DKIM_SELECTOR
  1629. dkim_selector = DKIM_SELECTOR
  1630. .endif
  1631. .ifdef DKIM_PRIVATE_KEY
  1632. dkim_private_key = DKIM_PRIVATE_KEY
  1633. .endif
  1634. .ifdef DKIM_CANON
  1635. dkim_canon = DKIM_CANON
  1636. .endif
  1637. .ifdef DKIM_STRICT
  1638. dkim_strict = DKIM_STRICT
  1639. .endif
  1640. .ifdef DKIM_SIGN_HEADERS
  1641. dkim_sign_headers = DKIM_SIGN_HEADERS
  1642. .endif
  1643. .ifdef TLS_DH_MIN_BITS
  1644. tls_dh_min_bits = TLS_DH_MIN_BITS
  1645. .endif
  1646. .ifdef REMOTE_SMTP_TLS_CERTIFICATE
  1647. tls_certificate = REMOTE_SMTP_TLS_CERTIFICATE
  1648. .endif
  1649. .ifdef REMOTE_SMTP_PRIVATEKEY
  1650. tls_privatekey = REMOTE_SMTP_PRIVATEKEY
  1651. .endif
  1652. #####################################################
  1653. ### end transport/30_exim4-config_remote_smtp
  1654. #####################################################
  1655. #####################################################
  1656. ### transport/30_exim4-config_remote_smtp_smarthost
  1657. #####################################################
  1658.  
  1659. ### transport/30_exim4-config_remote_smtp_smarthost
  1660. #################################
  1661.  
  1662. # This transport is used for delivering messages over SMTP connections
  1663. # to a smarthost. The local host tries to authenticate.
  1664. # This transport is used for smarthost and satellite configurations.
  1665.  
  1666. remote_smtp_smarthost:
  1667. debug_print = "T: remote_smtp_smarthost for $local_part@$domain"
  1668. driver = smtp
  1669. hosts_try_auth = <; ${if exists{CONFDIR/passwd.client} \
  1670. {\
  1671. ${lookup{$host}nwildlsearch{CONFDIR/passwd.client}{$host_address}}\
  1672. }\
  1673. {} \
  1674. }
  1675. .ifdef REMOTE_SMTP_SMARTHOST_HOSTS_AVOID_TLS
  1676. hosts_avoid_tls = REMOTE_SMTP_SMARTHOST_HOSTS_AVOID_TLS
  1677. .endif
  1678. .ifdef REMOTE_SMTP_HEADERS_REWRITE
  1679. headers_rewrite = REMOTE_SMTP_HEADERS_REWRITE
  1680. .endif
  1681. .ifdef REMOTE_SMTP_RETURN_PATH
  1682. return_path = REMOTE_SMTP_RETURN_PATH
  1683. .endif
  1684. .ifdef REMOTE_SMTP_HELO_DATA
  1685. helo_data=REMOTE_SMTP_HELO_DATA
  1686. .endif
  1687. .ifdef TLS_DH_MIN_BITS
  1688. tls_dh_min_bits = TLS_DH_MIN_BITS
  1689. .endif
  1690. .ifdef REMOTE_SMTP_SMARTHOST_TLS_CERTIFICATE
  1691. tls_certificate = REMOTE_SMTP_SMARTHOST_TLS_CERTIFICATE
  1692. .endif
  1693. .ifdef REMOTE_SMTP_SMARTHOST_PRIVATEKEY
  1694. tls_privatekey = REMOTE_SMTP_SMARTHOST_PRIVATEKEY
  1695. .endif
  1696. #####################################################
  1697. ### end transport/30_exim4-config_remote_smtp_smarthost
  1698. #####################################################
  1699. #####################################################
  1700. ### transport/35_exim4-config_address_directory
  1701. #####################################################
  1702. # This transport is used for handling file addresses generated by alias
  1703. # or .forward files if the path ends in "/", which causes it to be treated
  1704. # as a directory name rather than a file name.
  1705.  
  1706. address_directory:
  1707. debug_print = "T: address_directory for $local_part@$domain"
  1708. driver = appendfile
  1709. delivery_date_add
  1710. envelope_to_add
  1711. return_path_add
  1712. check_string = ""
  1713. escape_string = ""
  1714. maildir_format
  1715.  
  1716. #####################################################
  1717. ### end transport/35_exim4-config_address_directory
  1718. #####################################################
  1719. #####################################################
  1720. ### retry/00_exim4-config_header
  1721. #####################################################
  1722.  
  1723. ######################################################################
  1724. # RETRY CONFIGURATION #
  1725. ######################################################################
  1726.  
  1727. begin retry
  1728.  
  1729. #####################################################
  1730. ### end retry/00_exim4-config_header
  1731. #####################################################
  1732. #####################################################
  1733. ### retry/30_exim4-config
  1734. #####################################################
  1735.  
  1736. ### retry/30_exim4-config
  1737. #################################
  1738.  
  1739. # This single retry rule applies to all domains and all errors. It specifies
  1740. # retries every 15 minutes for 2 hours, then increasing retry intervals,
  1741. # starting at 1 hour and increasing each time by a factor of 1.5, up to 16
  1742. # hours, then retries every 6 hours until 4 days have passed since the first
  1743. # failed delivery.
  1744.  
  1745. # Please note that these rules only limit the frequency of retries, the
  1746. # effective retry-time depends on the frequency of queue-running, too.
  1747. # See QUEUEINTERVAL in /etc/default/exim4.
  1748.  
  1749. # Address or Domain Error Retries
  1750. # ----------------- ----- -------
  1751.  
  1752. * * F,2h,15m; G,16h,1h,1.5; F,4d,6h
  1753.  
  1754. #####################################################
  1755. ### end retry/30_exim4-config
  1756. #####################################################
  1757. #####################################################
  1758. ### rewrite/00_exim4-config_header
  1759. #####################################################
  1760.  
  1761. ######################################################################
  1762. # REWRITE CONFIGURATION #
  1763. ######################################################################
  1764.  
  1765. begin rewrite
  1766.  
  1767. #####################################################
  1768. ### end rewrite/00_exim4-config_header
  1769. #####################################################
  1770. #####################################################
  1771. ### rewrite/31_exim4-config_rewriting
  1772. #####################################################
  1773.  
  1774. ### rewrite/31_exim4-config_rewriting
  1775. #################################
  1776.  
  1777. # This rewriting rule is particularily useful for dialup users who
  1778. # don't have their own domain, but could be useful for anyone.
  1779. # It looks up the real address of all local users in a file
  1780. .ifndef NO_EAA_REWRITE_REWRITE
  1781. *@+local_domains "${lookup{${local_part}}lsearch{/etc/email-addresses}\
  1782. {$value}fail}" Ffrs
  1783. # identical rewriting rule for /etc/mailname
  1784. *@ETC_MAILNAME "${lookup{${local_part}}lsearch{/etc/email-addresses}\
  1785. {$value}fail}" Ffrs
  1786. .endif
  1787.  
  1788.  
  1789. #####################################################
  1790. ### end rewrite/31_exim4-config_rewriting
  1791. #####################################################
  1792. #####################################################
  1793. ### auth/00_exim4-config_header
  1794. #####################################################
  1795.  
  1796. ######################################################################
  1797. # AUTHENTICATION CONFIGURATION #
  1798. ######################################################################
  1799.  
  1800. begin authenticators
  1801.  
  1802.  
  1803. #####################################################
  1804. ### end auth/00_exim4-config_header
  1805. #####################################################
  1806. #####################################################
  1807. ### auth/30_exim4-config_examples
  1808. #####################################################
  1809.  
  1810. ### auth/30_exim4-config_examples
  1811. #################################
  1812.  
  1813. # The examples below are for server side authentication, when the
  1814. # local exim is SMTP server and clients authenticate to the local exim.
  1815.  
  1816. # They allow two styles of plain-text authentication against an
  1817. # CONFDIR/passwd file whose syntax is described in exim4_passwd(5).
  1818.  
  1819. # Hosts that are allowed to use AUTH are defined by the
  1820. # auth_advertise_hosts option in the main configuration. The default is
  1821. # "*", which allows authentication to all hosts over all kinds of
  1822. # connections if there is at least one authenticator defined here.
  1823. # Authenticators which rely on unencrypted clear text passwords don't
  1824. # advertise on unencrypted connections by default. Thus, it might be
  1825. # wise to set up TLS to allow encrypted connections. If TLS cannot be
  1826. # used for some reason, you can set AUTH_SERVER_ALLOW_NOTLS_PASSWORDS to
  1827. # advertise unencrypted clear text password based authenticators on all
  1828. # connections. As this is severely reducing security, using TLS is
  1829. # preferred over allowing clear text password based authenticators on
  1830. # unencrypted connections.
  1831.  
  1832. # PLAIN authentication has no server prompts. The client sends its
  1833. # credentials in one lump, containing an authorization ID (which we do not
  1834. # use), an authentication ID, and a password. The latter two appear as
  1835. # $auth2 and $auth3 in the configuration and should be checked against a
  1836. # valid username and password. In a real configuration you would typically
  1837. # use $auth2 as a lookup key, and compare $auth3 against the result of the
  1838. # lookup, perhaps using the crypteq{}{} condition.
  1839.  
  1840. # plain_server:
  1841. # driver = plaintext
  1842. # public_name = PLAIN
  1843. # server_condition = "${if crypteq{$auth3}{${extract{1}{:}{${lookup{$auth2}lsearch{CONFDIR/passwd}{$value}{*:*}}}}}{1}{0}}"
  1844. # server_set_id = $auth2
  1845. # server_prompts = :
  1846. # .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
  1847. # server_advertise_condition = ${if eq{$tls_in_cipher}{}{}{*}}
  1848. # .endif
  1849.  
  1850. # LOGIN authentication has traditional prompts and responses. There is no
  1851. # authorization ID in this mechanism, so unlike PLAIN the username and
  1852. # password are $auth1 and $auth2. Apart from that you can use the same
  1853. # server_condition setting for both authenticators.
  1854.  
  1855. # login_server:
  1856. # driver = plaintext
  1857. # public_name = LOGIN
  1858. # server_prompts = "Username:: : Password::"
  1859. # server_condition = "${if crypteq{$auth2}{${extract{1}{:}{${lookup{$auth1}lsearch{CONFDIR/passwd}{$value}{*:*}}}}}{1}{0}}"
  1860. # server_set_id = $auth1
  1861. # .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
  1862. # server_advertise_condition = ${if eq{$tls_in_cipher}{}{}{*}}
  1863. # .endif
  1864. #
  1865. # cram_md5_server:
  1866. # driver = cram_md5
  1867. # public_name = CRAM-MD5
  1868. # server_secret = ${extract{2}{:}{${lookup{$auth1}lsearch{CONFDIR/passwd}{$value}fail}}}
  1869. # server_set_id = $auth1
  1870.  
  1871. # Here is an example of CRAM-MD5 authentication against PostgreSQL:
  1872. #
  1873. # psqldb_auth_server:
  1874. # driver = cram_md5
  1875. # public_name = CRAM-MD5
  1876. # server_secret = ${lookup pgsql{SELECT pw FROM users WHERE username = '${quote_pgsql:$auth1}'}{$value}fail}
  1877. # server_set_id = $auth1
  1878.  
  1879. # Authenticate against local passwords using sasl2-bin
  1880. # Requires exim_uid to be a member of sasl group, see README.Debian.gz
  1881. # plain_saslauthd_server:
  1882. # driver = plaintext
  1883. # public_name = PLAIN
  1884. # server_condition = ${if saslauthd{{$auth2}{$auth3}}{1}{0}}
  1885. # server_set_id = $auth2
  1886. # server_prompts = :
  1887. # .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
  1888. # server_advertise_condition = ${if eq{$tls_in_cipher}{}{}{*}}
  1889. # .endif
  1890. #
  1891. # login_saslauthd_server:
  1892. # driver = plaintext
  1893. # public_name = LOGIN
  1894. # server_prompts = "Username:: : Password::"
  1895. # # don't send system passwords over unencrypted connections
  1896. # server_condition = ${if saslauthd{{$auth1}{$auth2}}{1}{0}}
  1897. # server_set_id = $auth1
  1898. # .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
  1899. # server_advertise_condition = ${if eq{$tls_in_cipher}{}{}{*}}
  1900. # .endif
  1901. #
  1902. # ntlm_sasl_server:
  1903. # driver = cyrus_sasl
  1904. # public_name = NTLM
  1905. # server_realm = <short main hostname>
  1906. # server_set_id = $auth1
  1907. # .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
  1908. # server_advertise_condition = ${if eq{$tls_in_cipher}{}{}{*}}
  1909. # .endif
  1910. #
  1911. # digest_md5_sasl_server:
  1912. # driver = cyrus_sasl
  1913. # public_name = DIGEST-MD5
  1914. # server_realm = <short main hostname>
  1915. # server_set_id = $auth1
  1916. # .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
  1917. # server_advertise_condition = ${if eq{$tls_in_cipher}{}{}{*}}
  1918. # .endif
  1919.  
  1920. # Authentcate against cyrus-sasl
  1921. # This is mainly untested, please report any problems to
  1922. # pkg-exim4-users@lists.alioth.debian.org.
  1923. # cram_md5_sasl_server:
  1924. # driver = cyrus_sasl
  1925. # public_name = CRAM-MD5
  1926. # server_realm = <short main hostname>
  1927. # server_set_id = $auth1
  1928. #
  1929. # plain_sasl_server:
  1930. # driver = cyrus_sasl
  1931. # public_name = PLAIN
  1932. # server_realm = <short main hostname>
  1933. # server_set_id = $auth1
  1934. # .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
  1935. # server_advertise_condition = ${if eq{$tls_in_cipher}{}{}{*}}
  1936. # .endif
  1937. #
  1938. # login_sasl_server:
  1939. # driver = cyrus_sasl
  1940. # public_name = LOGIN
  1941. # server_realm = <short main hostname>
  1942. # server_set_id = $auth1
  1943. # .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
  1944. # server_advertise_condition = ${if eq{$tls_in_cipher}{}{}{*}}
  1945. # .endif
  1946.  
  1947. # Authenticate against courier authdaemon
  1948.  
  1949. # This is now the (working!) example from
  1950. # http://www.exim.org/eximwiki/FAQ/Policy_controls/Q0730
  1951. # Possible pitfall: access rights on /var/run/courier/authdaemon/socket.
  1952. # plain_courier_authdaemon:
  1953. # driver = plaintext
  1954. # public_name = PLAIN
  1955. # server_condition = \
  1956. # ${extract {ADDRESS} \
  1957. # {${readsocket{/var/run/courier/authdaemon/socket} \
  1958. # {AUTH ${strlen:exim\nlogin\n$auth2\n$auth3\n}\nexim\nlogin\n$auth2\n$auth3\n} }} \
  1959. # {yes} \
  1960. # fail}
  1961. # server_set_id = $auth2
  1962. # .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
  1963. # server_advertise_condition = ${if eq{$tls_in_cipher}{}{}{*}}
  1964. # .endif
  1965.  
  1966. # login_courier_authdaemon:
  1967. # driver = plaintext
  1968. # public_name = LOGIN
  1969. # server_prompts = Username:: : Password::
  1970. # server_condition = \
  1971. # ${extract {ADDRESS} \
  1972. # {${readsocket{/var/run/courier/authdaemon/socket} \
  1973. # {AUTH ${strlen:exim\nlogin\n$auth1\n$auth2\n}\nexim\nlogin\n$auth1\n$auth2\n} }} \
  1974. # {yes} \
  1975. # fail}
  1976. # server_set_id = $auth1
  1977. # .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
  1978. # server_advertise_condition = ${if eq{$tls_in_cipher}{}{}{*}}
  1979. # .endif
  1980.  
  1981. # This one is a bad hack to support the broken version 4.xx of
  1982. # Microsoft Outlook Express which violates the RFCs by demanding
  1983. # "250-AUTH=" instead of "250-AUTH ".
  1984. # If your list of offered authenticators is other than PLAIN and LOGIN,
  1985. # you need to adapt the public_name line manually.
  1986. # It has to be the last authenticator to work and has not been tested
  1987. # well. Use at your own risk.
  1988. # See the thread entry point from
  1989. # http://www.exim.org/mail-archives/exim-users/Week-of-Mon-20050214/msg00213.html
  1990. # for the related discussion on the exim-users mailing list.
  1991. # Thanks to Fred Viles for this great work.
  1992.  
  1993. # support_broken_outlook_express_4_server:
  1994. # driver = plaintext
  1995. # public_name = "\r\n250-AUTH=PLAIN LOGIN"
  1996. # server_prompts = User Name : Password
  1997. # server_condition = no
  1998. # .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
  1999. # server_advertise_condition = ${if eq{$tls_in_cipher}{}{}{*}}
  2000. # .endif
  2001.  
  2002. ##############
  2003. # See /usr/share/doc/exim4-base/README.Debian.gz
  2004. ##############
  2005.  
  2006. # These examples below are the equivalent for client side authentication.
  2007. # They get the passwords from CONFDIR/passwd.client, whose format is
  2008. # defined in exim4_passwd_client(5)
  2009.  
  2010. # Because AUTH PLAIN and AUTH LOGIN send the password in clear, we
  2011. # only allow these mechanisms over encrypted connections by default.
  2012. # You can set AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS to allow unencrypted
  2013. # clear text password authentication on all connections.
  2014.  
  2015. cram_md5:
  2016. driver = cram_md5
  2017. public_name = CRAM-MD5
  2018. client_name = ${extract{1}{:}{${lookup{$host}nwildlsearch{CONFDIR/passwd.client}{$value}fail}}}
  2019. client_secret = ${extract{2}{:}{${lookup{$host}nwildlsearch{CONFDIR/passwd.client}{$value}fail}}}
  2020.  
  2021. # this returns the matching line from passwd.client and doubles all ^
  2022. PASSWDLINE=${sg{\
  2023. ${lookup{$host}nwildlsearch{CONFDIR/passwd.client}{$value}fail}\
  2024. }\
  2025. {\\N[\\^]\\N}\
  2026. {^^}\
  2027. }
  2028.  
  2029. plain:
  2030. driver = plaintext
  2031. public_name = PLAIN
  2032. .ifndef AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS
  2033. client_send = "<; ${if !eq{$tls_out_cipher}{}\
  2034. {^${extract{1}{:}{PASSWDLINE}}\
  2035. ^${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}\
  2036. }fail}"
  2037. .else
  2038. client_send = "<; ^${extract{1}{:}{PASSWDLINE}}\
  2039. ^${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}"
  2040. .endif
  2041.  
  2042. login:
  2043. driver = plaintext
  2044. public_name = LOGIN
  2045. .ifndef AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS
  2046. # Return empty string if not non-TLS AND looking up $host in passwd-file
  2047. # yields a non-empty string; fail otherwise.
  2048. client_send = "<; ${if and{\
  2049. {!eq{$tls_out_cipher}{}}\
  2050. {!eq{PASSWDLINE}{}}\
  2051. }\
  2052. {}fail}\
  2053. ; ${extract{1}{::}{PASSWDLINE}}\
  2054. ; ${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}"
  2055. .else
  2056. # Return empty string if looking up $host in passwd-file yields a
  2057. # non-empty string; fail otherwise.
  2058. client_send = "<; ${if !eq{PASSWDLINE}{}\
  2059. {}fail}\
  2060. ; ${extract{1}{::}{PASSWDLINE}}\
  2061. ; ${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}"
  2062. .endif
  2063. #####################################################
  2064. ### end auth/30_exim4-config_examples
  2065. #####################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement