Advertisement
Guest User

Untitled

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