exim4.conf.j2 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190
  1. ######################################################################
  2. # Runtime configuration file for Exim #
  3. ######################################################################
  4. # This file is divided into several parts, all but the first of which are
  5. # headed by a line starting with the word "begin". Only those parts that
  6. # are required need to be present. Blank lines, and lines starting with #
  7. # are ignored.
  8. exim_group = {{ exim_user_name }}
  9. exim_user = {{ exim_group_name }}
  10. keep_environment = HOME : LANG : USER
  11. add_environment = PATH=/sbin::/usr/sbin::/bin::/usr/bin
  12. ######################################################################
  13. # MAIN CONFIGURATION SETTINGS #
  14. ######################################################################
  15. # Specify your host's canonical name here. This should normally be the fully
  16. # qualified "official" name of your host. If this option is not set, the
  17. # uname() function is called to obtain the name. In many cases this does
  18. # the right thing and you need not set anything explicitly.
  19. primary_hostname = {{ exim_server_name }}
  20. smtp_banner = {{ exim_server_name }} ESMTP Exim $version_number $tod_full
  21. # The next three settings create two lists of domains and one list of hosts.
  22. # These lists are referred to later in this configuration using the syntax
  23. # +local_domains, +relay_to_domains, and +relay_from_hosts, respectively. They
  24. # are all colon-separated lists:
  25. {% if exim_mailman_transport %}
  26. domainlist mailman_domains = mail.ivimey.org
  27. {% endif %}
  28. domainlist local_domains = {{ exim_local_domains | join(" : ") }}
  29. hostlist relay_from_hosts = {{ exim_relay_from_nets | join(" : ") }}
  30. hostlist relay_to_domains = {{ exim_relay_to_domains | join(" : ") }}
  31. hostlist no_lookup_hosts = {{ exim_no_lookup_hosts | join(" : ") }}
  32. hostlist whitelist_hosts = {{ exim_whitelist_hosts | join(" : ") }}
  33. hostlist blacklist_hosts = {{ exim_blacklist_hosts | join(" : ") }}
  34. hostlist no_greylisting = {{ exim_no_greylist_hosts | join(" : ") }}
  35. {% for vtag, vdomain in exim_virtual_domains.iteritems() %}
  36. domainlist {{ vtag }}_domains = {{ vdomain.domains | join(" : ") }}
  37. {% endfor %}
  38. # DKIM setup
  39. DKIM_CANON = {{ exim_dkim_canon }}
  40. DKIM_SELECTOR = {{ exim_dkim_selector }}
  41. # Get the domain from the outgoing mail.
  42. DKIM_DOMAIN = ${lc:${domain:$h_from:}}
  43. # The file is based on the outgoing domain-name in the from-header.
  44. DKIM_FILE = /etc/exim4/dkim/${lc:${domain:$h_from:}}.pem
  45. # If key exists then use it, if not don't.
  46. DKIM_PRIVATE_KEY = ${if exists {DKIM_FILE} {DKIM_FILE} {0} }
  47. # All three of these lists may contain many different kinds of item, including
  48. # wildcarded names, regular expressions, and file lookups. See the reference
  49. # manual for details. The lists above are used in the access control lists for
  50. # checking incoming messages. The names of these ACLs are defined here:
  51. acl_smtp_connect = acl_check_connect
  52. acl_smtp_mail = acl_check_mail
  53. acl_smtp_rcpt = acl_check_rcpt
  54. acl_smtp_data = acl_check_data
  55. acl_smtp_mime = acl_check_mime
  56. acl_smtp_dkim = acl_check_dkim
  57. # You should not change those settings until you understand how ACLs work.
  58. # Verify sites known to sign mail with DKIM
  59. KNOWN_DKIM_SIGNERS = = {{ exim_dkim_known_signers | join(" : ") }}
  60. dkim_verify_signers = $dkim_signers : KNOWN_DKIM_SIGNERS
  61. # If you are running a version of Exim that was compiled with the content-
  62. # scanning extension, you can cause incoming messages to be automatically
  63. # scanned for viruses. You have to modify the configuration in two places to
  64. # set this up. The first of them is here, where you define the interface to
  65. # your scanner. This example is typical for ClamAV; see the manual for details
  66. # of what to set for other virus scanners. The second modification is in the
  67. # acl_check_data access control list (see below).
  68. #av_scanner = clamd:/var/run/clamd.exim/clamd.sock
  69. #av_scanner = cmdline:/usr/local/f-prot/f-prot %s:Infection:Infection. (.+)$
  70. # For spam scanning, there is a similar option that defines the interface to
  71. # SpamAssassin. You do not need to set this if you are using the default, which
  72. # is shown in this commented example. As for virus scanning, you must also
  73. # modify the acl_check_data access control list to enable spam scanning.
  74. # spamd_address = 127.0.0.1 783
  75. # If Exim is compiled with support for TLS, you may want to enable the
  76. # following options so that Exim allows clients to make encrypted
  77. # connections. In the authenticators section below, there are template
  78. # configurations for plaintext username/password authentication. This kind
  79. # of authentication is only safe when used within a TLS connection, so the
  80. # authenticators will only work if the following TLS settings are turned on
  81. # as well.
  82. # Allow any client to use TLS.
  83. tls_advertise_hosts = *
  84. # Specify the location of the Exim server's TLS certificate and private key.
  85. # The private key must not be encrypted (password protected). You can put
  86. # the certificate and private key in the same file, in which case you only
  87. # need the first setting, or in separate files, in which case you need both
  88. # options.
  89. tls_certificate = {{ exim_tls_certificate }}
  90. tls_privatekey = {{ exim_tls_privatekey }}
  91. # The mysql_servers, pgsql_servers, oracle_servers, or ibase_servers option
  92. # (as appropriate) must be set to a colon-separated list of server information.
  93. # Each item in the list is a slash-separated list of four items: host name,
  94. # database name, user name, and password.
  95. hide mysql_servers = {{ exim_mysql_hostname }}/{{ exim_mysql_database }}/{{ exim_mysql_user }}/N7wa24WpewdTLH7v
  96. # In order to support roaming users who wish to send email from anywhere,
  97. # you may want to make Exim listen on other ports as well as port 25, in
  98. # case these users need to send email from a network that blocks port 25.
  99. # The standard port for this purpose is port 587, the "message submission"
  100. # port. See RFC 4409 for details. Microsoft MUAs cannot be configured to
  101. # talk the message submission protocol correctly, so if you need to support
  102. # them you should also allow TLS-on-connect on the traditional but
  103. # non-standard port 465.
  104. local_interfaces = <; 192.168.32.1 ; 82.68.47.198 ; 127.0.0.1
  105. daemon_smtp_ports = 25 : 465 : 587
  106. tls_on_connect_ports = 465
  107. # By default, Exim expects all envelope addresses to be fully qualified, that
  108. # is, they must contain both a local part and a domain. If you want to accept
  109. # unqualified addresses (just a local part) from certain hosts, you can specify
  110. # these hosts by setting one or both of
  111. #
  112. # sender_unqualified_hosts =
  113. # recipient_unqualified_hosts =
  114. #
  115. # to control sender and recipient addresses, respectively. When this is done,
  116. # unqualified addresses are qualified using the settings of qualify_domain
  117. # and/or qualify_recipient (see above).
  118. # Specify the domain you want to be added to all unqualified addresses
  119. # here. An unqualified address is one that does not contain an "@" character
  120. # followed by a domain. For example, "caesar@rome.example" is a fully qualified
  121. # address, but the string "caesar" (i.e. just a login name) is an unqualified
  122. # email address. Unqualified addresses are accepted only from local callers by
  123. # default. See the recipient_unqualified_hosts option if you want to permit
  124. # unqualified addresses from remote sources. If this option is not set, the
  125. # primary_hostname value is used for qualification.
  126. qualify_domain = {{ exim_server_name }}
  127. # The following line must be uncommented if you want Exim to recognize
  128. # addresses of the form "user@[10.11.12.13]" that is, with a "domain literal"
  129. # (an IP address) instead of a named domain. The RFCs still require this form,
  130. # but it makes little sense to permit mail to be sent to specific hosts by
  131. # their IP address in the modern Internet. This ancient format has been used
  132. # by those seeking to abuse hosts by using them for unwanted relaying. If you
  133. # really do want to support domain literals, uncomment the following line, and
  134. # see also the "domain_literal" router below.
  135. # allow_domain_literals
  136. # No deliveries will ever be run under the uids of users specified by
  137. # never_users (a colon-separated list). An attempt to do so causes a panic
  138. # error to be logged, and the delivery to be deferred. This is a paranoic
  139. # safety catch. There is an even stronger safety catch in the form of the
  140. # FIXED_NEVER_USERS setting in the configuration for building Exim. The list of
  141. # users that it specifies is built into the binary, and cannot be changed. The
  142. # option below just adds additional users to the list. The default for
  143. # FIXED_NEVER_USERS is "root", but just to be absolutely sure, the default here
  144. # is also "root".
  145. # Note that the default setting means you cannot deliver mail addressed to root
  146. # as if it were a normal user. This isn't usually a problem, as most sites have
  147. # an alias for root that redirects such mail to a human administrator.
  148. never_users = root:bin:daemon:lp:sync:games:man:lp:uucp:proxy:nobody
  149. trusted_users = {{ exim_trusted_user }}
  150. # The setting below causes Exim to do a reverse DNS lookup on all incoming
  151. # IP calls, in order to get the true host name. If you feel this is too
  152. # expensive, you can specify the networks for which a lookup is done, or
  153. # remove the setting entirely.
  154. host_lookup = !+no_lookup_hosts:*
  155. # This setting, if uncommented, allows users to authenticate using
  156. # their system passwords against saslauthd if they connect over a
  157. # secure connection. If you have network logins such as NIS or
  158. # Kerberos rather than only local users, then you possibly also want
  159. # to configure /etc/sysconfig/saslauthd to use the 'pam' mechanism
  160. # too. Once a user is authenticated, the acl_check_rcpt ACL then
  161. # allows them to relay through the system.
  162. #
  163. #auth_advertise_hosts = ${if eq {$tls_cipher}{}{}{*}}
  164. #
  165. # By default, we set this option to allow SMTP AUTH from nowhere
  166. # (Exim's default would be to allow it from anywhere, even on an
  167. # unencrypted connection).
  168. #
  169. # Comment this one out if you uncomment the above. Did you make sure
  170. # saslauthd is actually running first?
  171. #
  172. auth_advertise_hosts = *
  173. # The settings below, which are actually the same as the defaults in the
  174. # code, cause Exim to make RFC 1413 (ident) callbacks for all incoming SMTP
  175. # calls. You can limit the hosts to which these calls are made, and/or change
  176. # the timeout that is used. If you set the timeout to zero, all RFC 1413 calls
  177. # are disabled. RFC 1413 calls are cheap and can provide useful information
  178. # for tracing problem messages, but some hosts and firewalls have problems
  179. # with them. This can result in a timeout instead of an immediate refused
  180. # connection, leading to delays on starting up SMTP sessions. (The default was
  181. # reduced from 30s to 5s for release 4.61.)
  182. #rfc1413_hosts = *
  183. rfc1413_query_timeout = 0s
  184. # If you want Exim to support the "percent hack" for certain domains,
  185. # uncomment the following line and provide a list of domains. The "percent
  186. # hack" is the feature by which mail addressed to x%y@z (where z is one of
  187. # the domains listed) is locally rerouted to x@y and sent on. If z is not one
  188. # of the "percent hack" domains, x%y is treated as an ordinary local part. This
  189. # hack is rarely needed nowadays; you should not enable it unless you are sure
  190. # that you really need it.
  191. #
  192. # percent_hack_domains =
  193. #
  194. # As well as setting this option you will also need to remove the test
  195. # for local parts containing % in the ACL definition below.
  196. # When Exim can neither deliver a message nor return it to sender, it "freezes"
  197. # the delivery error message (aka "bounce message"). There are also other
  198. # circumstances in which messages get frozen. They will stay on the queue for
  199. # ever unless one of the following options is set.
  200. # This option unfreezes frozen bounce messages after two days, tries
  201. # once more to deliver them, and ignores any delivery failures.
  202. ignore_bounce_errors_after = 2d
  203. # This option cancels (removes) frozen messages that are older than a week.
  204. timeout_frozen_after = 7d
  205. # By default, messages that are waiting on Exim's queue are all held in a
  206. # single directory called "input" which it itself within Exim's spool
  207. # directory. (The default spool directory is specified when Exim is built, and
  208. # is often /var/spool/exim/.) Exim works best when its queue is kept short, but
  209. # there are circumstances where this is not always possible. If you uncomment
  210. # the setting below, messages on the queue are held in 62 subdirectories of
  211. # "input" instead of all in the same directory. The subdirectories are called
  212. # 0, 1, ... A, B, ... a, b, ... z. This has two benefits: (1) If your file
  213. # system degrades with many files in one directory, this is less likely to
  214. # happen; (2) Exim can process the queue one subdirectory at a time instead of
  215. # all at once, which can give better performance with large queues.
  216. # split_spool_directory = true
  217. smtp_accept_max_nonmail = 25
  218. # Expand on "Administrative Prohibition" error messages.
  219. # http://www.exim.org/pipermail/exim-users/Week-of-Mon-20030428/053322.html
  220. # http://www.exim.org/pipermail/exim-users/Week-of-Mon-20030428/053243.html
  221. smtp_return_error_details = true
  222. # Don't insist on delivering only a certain number of messages per connection
  223. smtp_accept_queue_per_connection = 0
  224. # Don't insist on 7-bit ASCII mail; 8-bit is ok too.
  225. accept_8bitmime = true
  226. # callout address verification
  227. callout_negative_expire = 18h
  228. callout_positive_expire = 9d
  229. callout_domain_negative_expire = 18h
  230. callout_domain_positive_expire = 9d
  231. # reject huge messages
  232. message_size_limit = {{ exim_message_size_limit }}
  233. ######################################################################
  234. # ACL CONFIGURATION #
  235. # Specifies access control lists for incoming SMTP mail #
  236. ######################################################################
  237. begin acl
  238. acl_check_connect:
  239. deny hosts = +blacklist_hosts
  240. message = Mail not permitted from your IP
  241. accept
  242. ######################################################################
  243. acl_check_helo:
  244. # If the remote host greets with an IP address, then reject the mail.
  245. #
  246. deny
  247. message = $sender_helo_name is not valid as a HELO greeting.
  248. log_message = Remote host used IP address in HELO/EHLO greeting
  249. condition = ${if isip {$sender_helo_name}{true}{false}}
  250. # Accept messages from inside the network
  251. accept hosts = : +relay_from_hosts
  252. # Likewise if the peer greets with one of our own names
  253. #
  254. deny
  255. message = $sender_helo_name is my name, not your name.
  256. log_message = Remote host used my name in HELO/EHLO greeting.
  257. condition = ${if match_domain{$sender_helo_name}\
  258. {$primary_hostname:+local_domains:+relay_to_domains}\
  259. {true}{false}}
  260. # ok for now
  261. accept
  262. delay = {{ exim_intercommand_delay }}
  263. #-----------------------------------MAIL ACL------------------------------------------
  264. # This access control list is used for the MAIL command in an incoming
  265. # SMTP message.
  266. acl_check_mail:
  267. # Hosts are required to say HELO (or EHLO) before sending mail.
  268. # So don't allow them to use the MAIL command if they haven't
  269. # done so.
  270. deny condition = ${if eq{$sender_helo_name}{} {1}}
  271. message = Nice boys say HELO first
  272. accept message = Accepted: sender is whitelisted
  273. log_message = Mail Accepted from $sender_host_address through sender whitelist entry
  274. senders = @@lsearch;{{ exim_whitelist_sender_file }}
  275. # white- and black-lists for hosts (connecting IPs) and senders (MAIL FROM)
  276. # that we definitely do or don't want.
  277. accept message = Accepted through host whitelist entry
  278. log_message = Mail Accepted from $sender_host_address through host whitelist entry
  279. hosts = +whitelist_hosts
  280. # Use the lack of reverse DNS to trigger greylisting. Some people
  281. # even reject for it but that would be a little excessive.
  282. warn condition = ${if eq{$sender_host_name}{} {1}}
  283. set acl_m_greylistreasons = Host $sender_host_address lacks reverse DNS\n$acl_m_greylistreasons
  284. # Deny if the sender is in one of a number of domains I don't want mail from.
  285. deny sender_domains = partial-lsearch;{{ exim_bad_mailfrom_hosts }}
  286. message = Sorry, I do not accept mail from $sender_address.
  287. accept
  288. delay = {{ exim_intercommand_delay }}
  289. #-----------------------------------RCPT ACL------------------------------------------
  290. # This access control list is used for every RCPT command in an incoming
  291. # SMTP message.
  292. acl_check_rcpt:
  293. # Accept if the source is local SMTP (i.e. not over TCP/IP). We do this by
  294. # testing for an empty sending host field.
  295. # Deny if the sender is <> and there are more than 1 recipients
  296. deny senders = :
  297. message = Invalid use of null sender
  298. condition = ${if > {$rcpt_count} {1} {1} }
  299. ######
  300. # The following section of the ACL is concerned with local parts that contain
  301. # @ or % or ! or / or | or dots in unusual places.
  302. #
  303. # The characters other than dots are rarely found in genuine local parts, but
  304. # are often tried by people looking to circumvent relaying restrictions.
  305. # Therefore, although they are valid in local parts, these rules lock them
  306. # out, as a precaution.
  307. #
  308. # Empty components (two dots in a row) are not valid in RFC 2822, but Exim
  309. # allows them because they have been encountered. (Consider local parts
  310. # constructed as "firstinitial.secondinitial.familyname" when applied to
  311. # someone like me, who has no second initial.) However, a local part starting
  312. # with a dot or containing /../ can cause trouble if it is used as part of a
  313. # file name (e.g. for a mailing list). This is also true for local parts that
  314. # contain slashes. A pipe symbol can also be troublesome if the local part is
  315. # incorporated unthinkingly into a shell command line.
  316. #
  317. # Two different rules are used. The first one is stricter, and is applied to
  318. # messages that are addressed to one of the local domains handled by this
  319. # host. The line "domains = +local_domains" restricts it to domains that are
  320. # defined by the "domainlist local_domains" setting above. The rule blocks
  321. # local parts that begin with a dot or contain @ % ! / or |. If you have
  322. # local accounts that include these characters, you will have to modify this
  323. # rule.
  324. deny message = Restricted characters in address
  325. domains = +local_domains
  326. local_parts = ^[.] : ^.*[@%!/|]
  327. delay = {{ exim_error_delay }}
  328. # The second rule applies to all other domains, and is less strict. The line
  329. # "domains = !+local_domains" restricts it to domains that are NOT defined by
  330. # the "domainlist local_domains" setting above. The exclamation mark is a
  331. # negating operator. This rule allows your own users to send outgoing
  332. # messages to sites that use slashes and vertical bars in their local parts.
  333. # It blocks local parts that begin with a dot, slash, or vertical bar, but
  334. # allows these characters within the local part. However, the sequence /../
  335. # is barred. The use of @ % and ! is blocked, as before. The motivation here
  336. # is to prevent your users (or your users' viruses) from mounting certain
  337. # kinds of attack on remote sites.
  338. deny message = Restricted characters in address
  339. domains = !+local_domains
  340. local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
  341. delay = {{ exim_error_delay }}
  342. #
  343. #####
  344. # Accept mail coming from localhost (non-TCPIP)
  345. accept hosts = :
  346. # Accept mail to postmaster in any local domain, regardless of the source,
  347. # and without verifying the sender.
  348. accept local_parts = postmaster
  349. domains = +local_domains
  350. # white- and black-lists for hosts (connecting IPs) and senders (MAIL FROM)
  351. # that we definitely do or don't want.
  352. accept message = Accepted through host whitelist entry
  353. log_message = Mail Accepted from $sender_host_address through host whitelist entry
  354. hosts = +whitelist_hosts
  355. accept message = Accepted through sender whitelist entry
  356. log_message = Mail Accepted from $sender_host_address through sender whitelist entry
  357. senders = @@lsearch;{{ exim_whitelist_sender_file }}
  358. deny message = Mail not permitted from sender
  359. senders = @@lsearch;{{ exim_blacklist_sender_file }}
  360. deny message = Mail not permitted from host $sender_host_address.
  361. log_message = Mail not permitted from host $sender_host_address.
  362. hosts = +blacklist_hosts
  363. # Deny unless the sender address can be routed. For proper verification of the
  364. # address, read the documentation on callouts and add the /callout modifier.
  365. #require verify = sender
  366. # Accept if the message comes from one of the hosts for which we are an
  367. # outgoing relay. It is assumed that such hosts are most likely to be MUAs,
  368. # so we set control=submission to make Exim treat the message as a
  369. # submission. It will fix up various errors in the message, for example, the
  370. # lack of a Date: header line. If you are actually relaying out out from
  371. # MTAs, you may want to disable this. If you are handling both relaying from
  372. # MTAs and submissions from MUAs you should probably split them into two
  373. # lists, and handle them differently.
  374. # Recipient verification is omitted here, because in many cases the clients
  375. # are dumb MUAs that don't cope well with SMTP error responses. If you are
  376. # actually relaying out from MTAs, you should probably add recipient
  377. # verification here.
  378. # Note that, by putting this test before any DNS black list checks, you will
  379. # always accept from these hosts, even if they end up on a black list. The
  380. # assumption is that they are your friends, and if they get onto a black
  381. # list, it is a mistake.
  382. accept hosts = +relay_from_hosts
  383. control = submission
  384. # Accept if the message arrived over an authenticated connection, from
  385. # any host. Again, these messages are usually from MUAs, so recipient
  386. # verification is omitted, and submission mode is set. And again, we do this
  387. # check before any black list tests.
  388. accept authenticated = *
  389. control = submission
  390. # If reverse DNS lookup of the sender's host fails (i.e. there is
  391. # no rDNS entry, or a forward lookup of the resulting name does not
  392. # match the original IP address), then reject the message.
  393. #
  394. #deny message = reverse DNS lookup failed for host $sender_host_address.
  395. #!verify = reverse_host_lookup
  396. # Deny unless the sender address can be verified.
  397. warn message = <$sender_address> does not appear to be a valid sender.
  398. !verify = sender/callout=20s,defer_ok
  399. set acl_m_greylistreasons = Sender <$sender_address> failed callout check\n$acl_m_greylistreasons
  400. # Insist that any other recipient address that we accept is either in one of
  401. # our local domains, or is in a domain for which we explicitly allow
  402. # relaying. Any other domain is rejected as being unacceptable for relaying.
  403. require message = relay not permitted
  404. domains = +local_domains : +relay_to_domains
  405. # We also require all accepted addresses to be verifiable. This check will
  406. # do local part verification for local domains, but only check the domain
  407. # for remote domains. The only way to check local parts for the remote
  408. # relay domains is to use a callout (add /callout), but please read the
  409. # documentation about callouts before doing this.
  410. require verify = recipient
  411. #############################################################################
  412. # There are no default checks on DNS black lists because the domains that
  413. # contain these lists are changing all the time. However, here are two
  414. # examples of how you can get Exim to perform a DNS black list lookup at this
  415. # point. The first one denies, whereas the second just warns. The third
  416. # triggers greylisting for any host in the blacklist.
  417. #
  418. # deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text
  419. # dnslists = black.list.example
  420. #
  421. # warn dnslists = black.list.example
  422. # add_header = X-Warning: $sender_host_address is in a black list at $dnslist_domain
  423. # log_message = found in $dnslist_domain
  424. #
  425. # warn dnslists = black.list.example
  426. # set acl_m_greylistreasons = Host found in $dnslist_domain\n$acl_m_greylistreasons
  427. #
  428. #############################################################################
  429. #############################################################################
  430. # This check is commented out because it is recognized that not every
  431. # sysadmin will want to do it. If you enable it, the check performs
  432. # Client SMTP Authorization (csa) checks on the sending host. These checks
  433. # do DNS lookups for SRV records. The CSA proposal is currently (May 2005)
  434. # an Internet draft. You can, of course, add additional conditions to this
  435. # ACL statement to restrict the CSA checks to certain hosts only.
  436. #
  437. # require verify = csa
  438. #############################################################################
  439. # Alternatively, greylist for it:
  440. warn !verify = csa
  441. set acl_m_greylistreasons = Host failed CSA check\n$acl_m_greylistreasons
  442. # At this point, the address has passed all the checks that have been
  443. # configured, so we accept it unconditionally.
  444. accept
  445. #-----------------------------------DKIM ACL------------------------------------------
  446. acl_check_dkim:
  447. accept hosts = +relay_from_hosts
  448. accept authenticated = *
  449. accept dkim_status = none
  450. condition = ${if eq {$acl_c_dkim_hdr}{1} {no}{yes}}
  451. set acl_c_dkim_hdr = 1
  452. add_header = :at_start:X-DKIM: Exim 4 on $primary_hostname (no dkim signature)
  453. warn condition = ${if eq {$acl_c_dkim_hdr}{1} {no}{yes}}
  454. set acl_c_dkim_hdr = 1
  455. add_header = :at_start:X-DKIM: Exim 4 on $primary_hostname
  456. warn dkim_status = fail
  457. message = Rejected: $dkim_verify_reason
  458. add_header = :at_start:X-DKIM: Exim 4 on $primary_hostname (fail dkim signature)
  459. set acl_m_greylistreasons = Host failed DKIM check\n$acl_m_greylistreasons
  460. accept dkim_status = invalid
  461. add_header = :at_start:Authentication-Results: $primary_hostname $dkim_cur_signer ($dkim_verify_status); $dkim_verify_reason
  462. accept dkim_status = pass
  463. add_header = :at_start:Authentication-Results: $primary_hostname; dkim=$dkim_domain, header.i=@$dkim_cur_signer ($dkim_verify_status)
  464. accept
  465. #-----------------------------------DATA ACL------------------------------------------
  466. # This ACL is used after the contents of a message have been received. This
  467. # is the ACL in which you can test a message's headers or body, and in
  468. # particular, this is where you can invoke external virus or spam scanners.
  469. # Some suggested ways of configuring these tests are shown below, commented
  470. # out. Without any tests, this ACL accepts all messages. If you want to use
  471. # such tests, you must ensure that Exim is compiled with the content-scanning
  472. # extension (WITH_CONTENT_SCAN=yes in Local/Makefile).
  473. acl_check_data:
  474. # Accept mail coming from localhost (non-TCPIP)
  475. accept message = Accepted as local delivery
  476. hosts = :
  477. accept message = Accepted through host whitelist entry
  478. hosts = +whitelist_hosts
  479. accept message = Accepted through whitelist entry
  480. senders = @@lsearch;/etc/exim4/whitelist_senders
  481. # white- and black-lists for hosts (connecting IPs) and senders (MAIL FROM)
  482. # that we definitely do or don't want.
  483. # Note that, by putting this test before any DNS black list checks, you will
  484. # always accept from these hosts, even if they end up on a black list. The
  485. # assumption is that they are your friends, and if they get onto a black
  486. # list, it is a mistake.
  487. deny message = Mail not permitted from sender
  488. senders = @@lsearch;/etc/exim4/blacklist_senders
  489. accept message = Accepted as from relayable host
  490. hosts = +relay_from_hosts
  491. # Accept if the message arrived over an authenticated connection, from
  492. # any host. Again, these messages are usually from MUAs, so recipient
  493. # verification is omitted, and submission mode is set. And again, we do this
  494. # check before any black list tests.
  495. accept authenticated = *
  496. message = Accepted as authenticated
  497. # Deny partial (MIME message/partial) messages, which can easily be
  498. # used to circumvent content scanning.
  499. deny message = Message fragments administratively prohibited
  500. condition = ${if match \
  501. {$h_content-type:}{\N\bmessage/partial\b\N}{1}}
  502. # Insist that the messages are in English - well, not Russian
  503. deny message = Message administratively prohibited
  504. condition = ${if match \
  505. {$h_content-type:}{koi18r}{1}}
  506. # Insist no viagra!
  507. deny message = Message administratively prohibited
  508. condition = ${if match {$h_from:}{VIAGRA}{1}}
  509. # Insist that the message address headers make sense
  510. deny message = Your message headers contain invalid syntax: $acl_verify_message
  511. !verify = header_syntax
  512. # Put simple tests first. A good one is to check for the presence of a
  513. # Message-Id: header, which RFC2822 says SHOULD be present. Some broken
  514. # or misconfigured mailer software occasionally omits this from genuine
  515. # messages too, though -- although it's not hard for the offender to fix
  516. # after they receive a bounce because of it.
  517. #
  518. warn condition = ${if !def:h_Message-ID: {1}}
  519. log_message = Message is missing the Message-ID header.
  520. set acl_m_greylistreasons = Message is missing the Message-ID header. RFC2822 says that all mail SHOULD have one.
  521. # Bypass SpamAssassin checks if the message is too large (4 million).
  522. #
  523. accept condition = ${if >={$message_size}{4000000} {1}}
  524. add_header = X-Spam-Note: SpamAssassin run bypassed due to message size
  525. add_header = Subject: [L] $h_Subject:
  526. # Run SpamAssassin, but allow for it to fail or time out. Add a warning message
  527. # and accept the mail if that happens. Add an X-Spam-Flag: header if the SA
  528. # score exceeds the SA system threshold.
  529. #
  530. warn spam = nobody/defer_ok
  531. add_header = X-Spam-Flag: YES
  532. warn condition = ${if !def:spam_score_int {1}}
  533. add_header = X-Spam-Note: SpamAssassin invocation failed
  534. # Unconditionally add score and report headers
  535. #
  536. warn add_header = X-Spam-Score: $primary_hostname: $spam_score ($spam_bar)\n\
  537. X-Spam-Report: $spam_report
  538. # And reject if the SpamAssassin score is greater than 5.9
  539. #
  540. deny condition = ${if >{$spam_score_int}{59} {1}}
  541. message = Your message scored $spam_score SpamAssassin points. Report follows:\n\
  542. $spam_report
  543. # Trigger greylisting (if enabled) if the SpamAssassin score is greater than 2
  544. #
  545. warn condition = ${if >{$spam_score_int}{20} {1}}
  546. set acl_m_greylistreasons = Message has $spam_score SpamAssassin points\n$acl_m_greylistreasons
  547. # Tag the subject if the SpamAssassin score is greater than 4.9
  548. #
  549. warn condition = ${if >{$spam_score_int}{49} {1}}
  550. add_header = Subject: *SPAM* $h_Subject:
  551. # Deny non-local messages with no Message-ID, or no Date
  552. #
  553. # Note that some specialized MTAs, such as certain mailing list
  554. # servers, do not automatically generate a Message-ID for bounces.
  555. # Thus, we add the check for a non-empty sender.
  556. #
  557. deny message = Message is missing one or more required headers and so is not valid.
  558. log_message = Missing header lines
  559. !senders = : postmaster@*
  560. condition = ${if or { {!def:h_From:} {!def:h_Date:} } {true}{false} }
  561. # Warn unless there is a verifiable sender address in at least
  562. # one of the "Sender:", "Reply-To:", or "From:" header lines.
  563. #
  564. warn message = X-Sender-Verify-Failed: No valid sender in message header
  565. log_message = No valid sender in message header
  566. !verify = header_sender
  567. # Deny if the message contains a virus. Before enabling this check, you
  568. # must install a virus scanner and set the av_scanner option above.
  569. #
  570. # deny malware = *
  571. # message = This message contains a virus ($malware_name).
  572. # If you want to greylist _all_ mail rather than only mail which looks like there
  573. # might be something wrong with it, then you can do this...
  574. #
  575. # warn set acl_m_greylistreasons = We greylist all mail\n$acl_m_greylistreasons
  576. # Now, invoke the greylisting. For this you need to have installed the exim-greylist
  577. # package which contains this subroutine, and you need to uncomment the bit below
  578. # which includes it too. Whenever the $acl_m_greylistreasons variable is non-empty,
  579. # greylisting will kick in and will defer the mail to check if the sender is a
  580. # proper mail which which retries, or whether it's a zombie. For more details, see
  581. # the exim-greylist.conf.inc file itself.
  582. #
  583. accept message = Accepted as from non-greylistable host $sender_host_address:\n$acl_m_greylistreasons
  584. hosts = +no_greylisting
  585. require acl = greylist_mail
  586. accept
  587. # To enable the greylisting, also uncomment this line:
  588. .include /etc/exim4/exim-greylist.conf.inc
  589. acl_check_mime:
  590. # File extension filtering.
  591. deny message = Blacklisted file extension $mime_filename detected
  592. condition = ${if match \
  593. {${lc:$mime_filename}} \
  594. {\N(\.cmd|\.dll|\.url|\.vbs|\.btm|\.prf|\.pif|\.scr|\.lnk|\.msi)$\N} \
  595. {1}{0}}
  596. # File extension filtering.
  597. deny message = Mailserver does not accept Windows executables: resend as zip or tar file.
  598. condition = ${if match \
  599. {${lc:$mime_filename}} \
  600. {\N(\.exe|\.com|\.bat)$\N} \
  601. {1}{0}}
  602. accept
  603. #-----------------------------------END ACL------------------------------------------
  604. ######################################################################
  605. # ROUTERS CONFIGURATION #
  606. # Specifies how addresses are handled #
  607. ######################################################################
  608. # THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT! #
  609. # An address is passed to each router in turn until it is accepted. #
  610. ######################################################################
  611. begin routers
  612. # This router routes addresses that are not in local domains by doing a DNS
  613. # lookup on the domain name. The exclamation mark that appears in "domains = !
  614. # +local_domains" is a negating operator, that is, it can be read as "not". The
  615. # recipient's domain must not be one of those defined by "domainlist
  616. # local_domains" above for this router to be used.
  617. #
  618. # If the router is used, any domain that resolves to 0.0.0.0 or to a loopback
  619. # interface address (127.0.0.0/8) is treated as if it had no DNS entry. Note
  620. # that 0.0.0.0 is the same as 0.0.0.0/32, which is commonly treated as the
  621. # local host inside the network stack. It is not 0.0.0.0/0, the default route.
  622. # If the DNS lookup fails, no further routers are tried because of the no_more
  623. # setting, and consequently the address is unrouteable.
  624. dnslookup:
  625. driver = dnslookup
  626. domains = ! +local_domains
  627. transport = remote_smtp
  628. ignore_target_hosts = 0.0.0.0 : \
  629. 127.0.0.0/8 :\
  630. 10.0.0.0/8 :\
  631. 172.16.0.0/16 :\
  632. 192.168.32.0/16 :\
  633. 169.254.0.0/16
  634. no_more
  635. # Alternatively, comment out the above router and uncomment this one to
  636. # route all mail to a smarthost instead of sending it directly to the
  637. # intended recipients. If your smarthost requires authentication, change
  638. # 'remote_smtp' to 'remote_msa' and set up the 'client_auth' authenticator
  639. # later in this file. You might need to change the port number in the
  640. # remote_msa transport.
  641. #
  642. #smarthost:
  643. # driver = manualroute
  644. # domains = ! +local_domains
  645. # transport = remote_smtp
  646. # route_data = smarthost.myisp.net
  647. # no_more
  648. # The remaining routers handle addresses in the local domain(s), that is those
  649. # domains that are defined by "domainlist local_domains" above.
  650. {% if exim_mailman_transport %}
  651. # We want this router first in case we have a list named something like
  652. # mailman-owner
  653. mm21_main_route:
  654. driver = accept
  655. domains = +mailman_domains
  656. local_parts = *
  657. require_files = /var/lib/mailman/lists/${lc::$local_part}/config.pck
  658. transport = mm21_transport
  659. mm21_special_route:
  660. driver = accept
  661. domains = +mailman_domains
  662. local_parts = *
  663. local_part_suffix = "-bounces:-bounces+*:-confirm+*:-join:-leave:-owner:-request:-admin"
  664. require_files = /var/lib/mailman/lists/${lc::$local_part}/config.pck
  665. transport = mm21_transport
  666. mailman_ivimeyorg_users:
  667. driver = redirect
  668. allow_defer
  669. allow_fail
  670. data = ${lookup{$local_part}lsearch {/etc/exim4/mailman-ivimey-aliases} {$value} fail}
  671. domains = mail.ivimey.org
  672. retry_use_local_part
  673. file_transport = address_file
  674. pipe_transport = address_pipe
  675. no_rewrite
  676. {% endif %}
  677. #
  678. # The remaining routers handle addresses in the local domain(s).
  679. {% for vtag, vdomain in exim_virtual_domains.iteritems() %}
  680. {{ vtag }}_users:
  681. driver = redirect
  682. allow_defer
  683. allow_fail
  684. data = ${lookup{$local_part}lsearch{/etc/exim/{{ vtag }}-aliases}}
  685. domains = +{{ vtag }}_domains
  686. qualify_domain = {{ vdomain.domains[0] }}
  687. forbid_file
  688. forbid_pipe
  689. retry_use_local_part
  690. no_rewrite
  691. {% endfor %}
  692. # This router handles forwarding using traditional .forward files in users'
  693. # home directories. If you want it also to allow mail filtering when a forward
  694. # file starts with the string "# Exim filter" or "# Sieve filter", uncomment
  695. # the "allow_filter" option.
  696. # If you want this router to treat local parts with suffixes introduced by "-"
  697. # or "+" characters as if the suffixes did not exist, uncomment the two local_
  698. # part_suffix options. Then, for example, xxxx-foo@your.domain will be treated
  699. # in the same way as xxxx@your.domain by this router. You probably want to make
  700. # the same change to the localuser router.
  701. # The no_verify setting means that this router is skipped when Exim is
  702. # verifying addresses. Similarly, no_expn means that this router is skipped if
  703. # Exim is processing an EXPN command.
  704. # The check_ancestor option means that if the forward file generates an
  705. # address that is an ancestor of the current one, the current one gets
  706. # passed on instead. This covers the case where A is aliased to B and B
  707. # has a .forward file pointing to A.
  708. # The three transports specified at the end are those that are used when
  709. # forwarding generates a direct delivery to a file, or to a pipe, or sets
  710. # up an auto-reply, respectively.
  711. userforward:
  712. driver = redirect
  713. check_local_user
  714. # local_part_suffix = +* : -*
  715. # local_part_suffix_optional
  716. file = $home/.forward
  717. allow_filter
  718. no_verify
  719. no_expn
  720. check_ancestor
  721. file_transport = address_file
  722. pipe_transport = address_pipe
  723. reply_transport = address_reply
  724. {% if exim_procmail_transport %}
  725. procmail:
  726. driver = accept
  727. check_local_user
  728. require_files = ${local_part}:+${home}/.procmailrc:/usr/bin/procmail
  729. transport = procmail
  730. no_verify
  731. {% endif %}
  732. # This router matches local user mailboxes.
  733. {% for vtag, vdomain in exim_virtual_domains.iteritems() %}
  734. localuser_{{ vtag }}:
  735. driver = accept
  736. domains = {{ vdomain.domains | join(" : ") }}
  737. local_parts = lsearch;/etc/exim4/{{ vtag }}-imap-users
  738. transport = imap_delivery
  739. {% endfor %}
  740. #localuser:
  741. # driver = accept
  742. # check_local_user
  743. ## local_part_suffix = +* : -*
  744. ## local_part_suffix_optional
  745. # transport = local_delivery
  746. # cannot_route_message = Unknown user
  747. ######################################################################
  748. # TRANSPORTS CONFIGURATION #
  749. ######################################################################
  750. # ORDER DOES NOT MATTER #
  751. # Only one appropriate transport is called for each delivery. #
  752. ######################################################################
  753. # A transport is used only when referenced from a router that successfully
  754. # handles an address.
  755. begin transports
  756. # This transport is used for delivering messages over SMTP connections.
  757. remote_smtp:
  758. driver = smtp
  759. helo_data = {{ exim_server_name }}
  760. dkim_domain = DKIM_DOMAIN
  761. dkim_selector = DKIM_SELECTOR
  762. dkim_private_key = DKIM_PRIVATE_KEY
  763. dkim_canon = DKIM_CANON
  764. # This transport is used for delivering messages over LMTP to an IMAP server
  765. imap_delivery:
  766. driver = lmtp
  767. socket = {{ exim_imap_deliver }}
  768. batch_max = 50
  769. # This transport is used for delivering messages over SMTP using the
  770. # "message submission" port (RFC4409).
  771. remote_msa:
  772. driver = smtp
  773. port = 587
  774. hosts_require_auth = *
  775. {% if exim_procmail_transport %}
  776. # This transport invokes procmail to deliver mail
  777. procmail:
  778. driver = pipe
  779. command = "/usr/bin/procmail -d $local_part"
  780. return_path_add
  781. delivery_date_add
  782. envelope_to_add
  783. user = $local_part
  784. initgroups
  785. return_output
  786. {% endif %}
  787. {% if exim_mailman_transport %}
  788. ## Mailman 2.1 transport
  789. mm21_transport:
  790. driver = pipe
  791. command = /usr/lib/mailman/mail/mailman "${if def:local_part_suffix{${substr_2:{${sg{${lc:$local_part_suffix}}{\\\\\+.*}{}}}}{post}}" ${lc:$local_part}
  792. return_output
  793. initgroups
  794. current_directory = /usr/lib/mailman
  795. home_directory = /usr/lib/mailman
  796. user = list
  797. group = list
  798. {% endif %}
  799. # This transport is used for handling pipe deliveries generated by alias or
  800. # .forward files.
  801. address_pipe:
  802. driver = pipe
  803. return_output
  804. # This transport is used for handling deliveries directly to files that are
  805. # generated by aliasing or forwarding.
  806. address_file:
  807. driver = appendfile
  808. delivery_date_add
  809. envelope_to_add
  810. return_path_add
  811. # This transport is used for handling autoreplies generated by the filtering
  812. # option of the userforward router.
  813. address_reply:
  814. driver = autoreply
  815. ######################################################################
  816. # RETRY CONFIGURATION #
  817. ######################################################################
  818. begin retry
  819. # WARNING: If you do not have any retry rules at all (this section of the
  820. # configuration is non-existent or empty), Exim will not do any retries of
  821. # messages that fail to get delivered at the first attempt.
  822. # Address or Domain Error Retries
  823. # ----------------- ----- -------
  824. * * F,2h,15m; G,16h,1h,1.5; F,4d,6h
  825. ######################################################################
  826. # REWRITE CONFIGURATION #
  827. ######################################################################
  828. begin rewrite
  829. {% for vtag, vdomain in exim_virtual_domains.iteritems() %}
  830. # {{ vtag }}
  831. {% for vrewrite in vdomain.rewrites %}
  832. "{{ vrewrite.from }}" "{{ vrewrite.to }}" {{ vrewrite.opts }}
  833. {% endfor %}
  834. {% endfor %}
  835. ######################################################################
  836. # AUTHENTICATION CONFIGURATION #
  837. ######################################################################
  838. begin authenticators
  839. # This authenticator supports CRAM-MD5 username/password authentication
  840. # with Exim acting as a _client_, as it might when sending its outgoing
  841. # mail to a smarthost rather than directly to the final recipient.
  842. # Replace SMTPAUTH_USERNAME and SMTPAUTH_PASSWORD as appropriate.
  843. #client_auth:
  844. # driver = cram_md5
  845. # public_name = CRAM-MD5
  846. # client_name = SMTPAUTH_USERNAME
  847. # client_secret = SMTPAUTH_PASSWORD
  848. #
  849. # The following authenticators support plaintext username/password
  850. # authentication using the standard PLAIN mechanism and the traditional
  851. # but non-standard LOGIN mechanism, with Exim acting as the server.
  852. # PLAIN and LOGIN are enough to support most MUA software.
  853. #
  854. # These authenticators are not complete: you need to change the
  855. # server_condition settings to specify how passwords are verified.
  856. # They are set up to offer authentication to the client only if the
  857. # connection is encrypted with TLS, so you also need to add support
  858. # for TLS. See the global configuration options section at the start
  859. # of this file for more about TLS.
  860. #
  861. # The default RCPT ACL checks for successful authentication, and will accept
  862. # messages from authenticated users from anywhere on the Internet.
  863. #lookup_cram:
  864. # driver = cram_md5
  865. # public_name = CRAM-MD5
  866. # server_secret = ${lookup{$1}lsearch{/etc/exim4/authpwd}{$value}fail}
  867. # server_set_id = $1
  868. #
  869. # PLAIN authentication has no server prompts. The client sends its
  870. # credentials in one lump, containing an authorization ID (which we do not
  871. # use), an authentication ID, and a password. The latter two appear as
  872. # $auth2 and $auth3 in the configuration and should be checked against a
  873. # valid username and password. In a real configuration you would typically
  874. # use $auth2 as a lookup key, and compare $auth3 against the result of the
  875. # lookup, perhaps using the crypteq{}{} condition.
  876. #auth_plain:
  877. # driver = plaintext
  878. # public_name = PLAIN
  879. # server_set_id = $auth2
  880. # server_prompts = :
  881. # server_condition = ${if saslauthd{ {$2}{$3}{smtp} } {1}}
  882. # server_advertise_condition = ${if def:tls_cipher }
  883. SQL_AUTH_PLAIN_LOOKUP=SELECT MD5(u.password) \
  884. FROM users u \
  885. WHERE u.userid='${quote_mysql:${local_part:$auth2}}' AND \
  886. u.domain='${quote_mysql:${domain:$auth2}}' AND \
  887. u.enabled='Y';
  888. auth_plain:
  889. driver = plaintext
  890. public_name = PLAIN
  891. server_prompts = :
  892. server_advertise_condition = ${if def:tls_cipher }
  893. server_condition = ${if and { \
  894. {!eq{$auth2}{}} \
  895. {!eq{$auth3}{}} \
  896. { crypteq{$auth3}{\{md5\}${lookup mysql{SQL_AUTH_PLAIN_LOOKUP}{$value}fail}} } \
  897. } {1}{0}}
  898. # server_set_id = $auth2
  899. # LOGIN authentication has traditional prompts and responses. There is no
  900. # authorization ID in this mechanism, so unlike PLAIN the username and
  901. # password are $auth1 and $auth2. Apart from that you can use the same
  902. # server_condition setting for both authenticators.
  903. #LOGIN:
  904. # driver = plaintext
  905. # server_set_id = $auth1
  906. # server_prompts = <| Username: | Password:
  907. # server_condition = ${if saslauthd{ {$1}{$2}{smtp} } {1}}
  908. # server_advertise_condition = ${if def:tls_cipher }
  909. SQL_AUTH_LOGIN_LOOKUP=SELECT MD5(u.password) \
  910. FROM users u \
  911. WHERE u.userid='${quote_mysql:${local_part:$auth1}}' AND \
  912. u.domain='${quote_mysql:${domain:$auth1}}' AND \
  913. u.enabled='Y';
  914. LOGIN:
  915. driver = plaintext
  916. server_prompts = <| Username: | Password:
  917. server_advertise_condition = ${if def:tls_cipher }
  918. server_condition = ${if and { \
  919. {!eq{$auth1}{}} \
  920. {!eq{$auth2}{}} \
  921. { crypteq{$auth2}{\{md5\}${lookup mysql{SQL_AUTH_LOGIN_LOOKUP}{$value}fail}} } \
  922. } {1}{0}}
  923. ######################################################################
  924. # CONFIGURATION FOR local_scan() #
  925. ######################################################################
  926. # If you have built Exim to include a local_scan() function that contains
  927. # tables for private options, you can define those options here. Remember to
  928. # uncomment the "begin" line. It is commented by default because it provokes
  929. # an error with Exim binaries that are not built with LOCAL_SCAN_HAS_OPTIONS
  930. # set in the Local/Makefile.
  931. # begin local_scan
  932. # End of Exim configuration file