Advertisement
Guest User

Untitled

a guest
Feb 9th, 2017
798
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.71 KB | None | 0 0
  1. # SpamBlockerTechnology* powered exim.conf, Version 4.4.6
  2. # Dec 5, 2015
  3. # Exim configuration file for DirectAdmin
  4. # Requires exim.pl as distributed by DirectAdmin here:
  5. # http://files.directadmin.com/services/exim.pl version 21 or higher
  6. # ClamAV optional
  7. # SpamAssassin optional
  8. # Dovecot/IMAP Mandatory
  9. # *SpamBlockerTechnology is a Trademark of NoBaloney Internet Services:
  10. # http://www.nobaloney.net
  11. #
  12. # WARNING! Do NOT use this exim.conf Exim configuration file unless you
  13. # make the required modifications to your Exim configuration
  14. # following the instructions in the README file included in this
  15. # distribution:
  16. # README-SpamBlockerVersion4exim.conf.txt
  17. #
  18. # The original exim.conf file distributed with Exim 4, includes the
  19. # following copyright notice:
  20. #
  21. # Copyright (C) 2002 University of Cambridge, Cambridge, UK
  22. #
  23. # Portions of the file are taken from the exim.conf file as
  24. # distributed with DirectAdmin (http://www.directadmin.com/)
  25. #
  26. # Copyright (C) 2003-2011 JBMC Software, St Albert, AB, Canada
  27. #
  28. # Portions of this file are written by NoBaloney Internet Services
  29. # and are copyright as follows:
  30. #
  31. # Copyright (C) 2004-2011 NoBaloney Internet Services, Riverside, Calif., USA
  32. #
  33. # The entire Exim 4 distribution, including the exim.conf file, is
  34. # distributed under the GNU GENERAL PUBLIC LICENSE, Version 2,
  35. # June 1991. If you do not have a copy of the GNU GENERAL PUBLIC LICENSE
  36. # you may download it, in it's entirety, from the website at:
  37. #
  38. # http://www.nobaloney.net/exim/gnu-gpl-v2.txt
  39. #
  40. # Thanks to all the members of the DirectAdmin community and of the exim
  41. # community who have given their # much needed and appreciated help.
  42. #
  43. # The most recent version of this file may always downloaded from the website
  44. # at: http://www.nobaloney.net/downloads/spamblocker
  45. #
  46. # MODIFICATION INSTRUCTIONS
  47. #
  48. # YOU MUST MAKE THE CHANGES TO THIS
  49. # SpamBlockerTechnology* powered exim.conf, Version 4.0
  50. # file as documented in the README file.
  51. #
  52. # The README file for this version is named:
  53. # README-SpamBlockerVersion4exim.conf.txt
  54.  
  55. # CONFIGURATION STARTS HERE
  56.  
  57. #EDIT#1:
  58. # primary_hostname =
  59. smtp_active_hostname = ${if exists{/etc/virtual/helo_data}{${lookup{$interface_address}iplsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}}{$primary_hostname}}
  60.  
  61. #EDIT#2-CLAMAV:
  62. # av_scanner = clamd:/var/run/clamav/clamd
  63. .include_if_exists /etc/exim.clamav.load.conf
  64.  
  65. #Block Cracking variables
  66. .include_if_exists /etc/exim.blockcracking/variables.conf
  67.  
  68. #Easy Spam Figher variables
  69. .include_if_exists /etc/exim.easy_spam_fighter/variables.conf
  70.  
  71. #SRS
  72. .include_if_exists /etc/exim.srs.conf
  73.  
  74. #EDIT#3:
  75. # qualify_domain =
  76.  
  77. #EDIT#4:
  78. perl_startup = do '/etc/exim.pl'
  79.  
  80. #EDIT#5:
  81. system_filter = /etc/system_filter.exim
  82.  
  83. #EDIT#6:
  84. untrusted_set_sender = *
  85.  
  86. #EDIT#7:
  87. daemon_smtp_ports = 25 : 587 : 465
  88. tls_on_connect_ports = 465
  89.  
  90. #EDIT#8:
  91. local_from_check = false
  92.  
  93. RBL_DNS_LIST=\
  94. cbl.abuseat.org : \
  95. bl.spamcop.net : \
  96. combined.rbl.msrbl.net : \
  97. b.barracudacentral.org : \
  98. zen.spamhaus.org : \
  99. hostkarma.junkemailfilter.com=127.0.0.2
  100.  
  101. .include /etc/exim.variables.conf
  102. .include /etc/exim.strings.conf
  103. .include_if_exists /etc/exim.strings.conf.custom
  104.  
  105. #EDIT#10:
  106. helo_allow_chars = _
  107.  
  108. #EDIT#11:
  109. log_selector = \
  110. +delivery_size \
  111. +sender_on_delivery \
  112. +received_recipients \
  113. +received_sender \
  114. +smtp_confirmation \
  115. +subject \
  116. +smtp_incomplete_transaction \
  117. -dnslist_defer \
  118. -host_lookup_failed \
  119. -queue_run \
  120. -rejected_header \
  121. -retry_defer \
  122. -skip_delivery \
  123. +arguments
  124.  
  125. #EDIT#12:
  126. syslog_duplication = false
  127.  
  128. #EDIT#13:
  129. acl_not_smtp = acl_script
  130. acl_smtp_auth = acl_check_auth
  131. acl_smtp_connect = acl_connect
  132. acl_smtp_helo = acl_check_helo
  133. acl_smtp_mail = ${if ={$interface_port}{587} {accept}{acl_check_mail}}
  134. acl_smtp_rcpt = acl_check_recipient
  135. acl_smtp_dkim = ${if ={$interface_port}{587} {accept}{acl_check_dkim}}
  136. acl_smtp_data = acl_check_message
  137. acl_smtp_mime = acl_check_mime
  138.  
  139. #EDIT#14:
  140. addresslist whitelist_senders = nwildlsearch;/etc/virtual/whitelist_senders
  141. addresslist blacklist_senders = nwildlsearch;/etc/virtual/blacklist_senders
  142. domainlist blacklist_domains = nwildlsearch;/etc/virtual/blacklist_domains
  143. domainlist whitelist_domains = nwildlsearch;/etc/virtual/whitelist_domains
  144. domainlist local_domains = lsearch;/etc/virtual/domains
  145. domainlist relay_domains = lsearch;/etc/virtual/domains
  146. domainlist use_rbl_domains = lsearch;/etc/virtual/use_rbl_domains
  147. domainlist skip_rbl_domains = nwildlsearch;/etc/virtual/skip_rbl_domains
  148. hostlist skip_rbl_hosts = ${if exists{/etc/virtual/skip_rbl_hosts}{wildlsearch;/etc/virtual/skip_rbl_hosts}}
  149. hostlist skip_rbl_hosts_ip = ${if exists{/etc/virtual/skip_rbl_hosts_ip}{/etc/virtual/skip_rbl_hosts_ip}}
  150. hostlist auth_relay_hosts = *
  151. hostlist bad_sender_hosts = nwildlsearch;/etc/virtual/bad_sender_hosts
  152. hostlist bad_sender_hosts_ip = /etc/virtual/bad_sender_hosts_ip
  153. hostlist whitelist_hosts = nwildlsearch;/etc/virtual/whitelist_hosts
  154. hostlist whitelist_hosts_ip = /etc/virtual/whitelist_hosts_ip
  155. BLACKLIST_USERNAMES = /etc/virtual/blacklist_usernames
  156. BLACKLIST_SMTP_USERNAMES = /etc/virtual/blacklist_smtp_usernames
  157. BLACKLIST_SCRIPT_USERNAMES = /etc/virtual/blacklist_script_usernames
  158.  
  159. #EDIT#15:
  160. #domainlist skip_av_domains = nwildlsearch;/etc/virtual/skip_av_domains
  161.  
  162. #EDIT#16:
  163. hostlist relay_hosts = net-lsearch;/etc/virtual/pophosts
  164.  
  165. #EDIT#17:
  166. never_users = root
  167.  
  168. #EDIT#18:
  169. host_lookup = *
  170.  
  171. #EDIT#19:
  172. rfc1413_hosts = *
  173. rfc1413_query_timeout = 0s
  174.  
  175. #EDIT#20:
  176. #exim.variables.conf
  177.  
  178. #EDIT#21:
  179. #exim.variables.conf
  180.  
  181. #EDIT#22:
  182. #exim.variables.conf
  183.  
  184. #EDIT#23:
  185. tls_certificate = /etc/exim.cert
  186. tls_privatekey = /etc/exim.key
  187. openssl_options = +no_sslv2 +no_sslv3
  188. tls_require_ciphers = ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP
  189. tls_advertise_hosts = *
  190. #auth_over_tls_hosts = *
  191.  
  192. .include_if_exists /etc/exim.variables.conf.post
  193.  
  194. ##################################################################################
  195. # Access Control Lists
  196. ##################################################################################
  197. begin acl
  198.  
  199.  
  200. ######################################
  201. # ACL CONNECT
  202. ######################################
  203. #EDIT#24:
  204. acl_connect:
  205. warn set acl_m_spam_assassin_has_run = 0
  206. warn set acl_m_is_whitelisted = 0
  207. .include_if_exists /etc/exim.easy_spam_fighter/connect.conf
  208. accept hosts = *
  209.  
  210.  
  211. ######################################
  212. # ACL CHECK MAIL
  213. ######################################
  214. acl_check_mail:
  215. accept condition = ${if eq{$acl_m_is_whitelisted}{1}{1}{0}}
  216.  
  217. #EDIT#31:
  218. accept sender_domains = +whitelist_domains
  219. logwrite = $sender_host_address whitelisted in local domains whitelist
  220. set acl_m_is_whitelisted = 1
  221. accept hosts = +whitelist_hosts
  222. logwrite = $sender_host_address whitelisted in local hosts whitelist
  223. set acl_m_is_whitelisted = 1
  224. accept hosts = +whitelist_hosts_ip
  225. logwrite = $sender_host_address whitelisted in local hosts IP whitelist
  226. set acl_m_is_whitelisted = 1
  227. # accept if envelope sender is in whitelist
  228. accept senders = +whitelist_senders
  229. logwrite = $sender_host_address whitelisted in local sender whitelist
  230. set acl_m_is_whitelisted = 1
  231.  
  232. .include_if_exists /etc/exim.easy_spam_fighter/check_mail.conf
  233. accept
  234.  
  235.  
  236. ######################################
  237. # ACL CHECK AUTH
  238. ######################################
  239. #EDIT#24.5#
  240. acl_check_auth:
  241. drop set acl_m_authcount = ${eval10:0$acl_m_authcount+1}
  242. condition = ${if >{$acl_m_authcount}{2}}
  243. delay = 10s
  244. message = ONLY_ONE_AUTH_PER_CONN
  245.  
  246. accept
  247.  
  248.  
  249. ######################################
  250. # ACL CHECK HELO
  251. ######################################
  252. #EDIT#25:
  253. acl_check_helo:
  254. # accept mail originating on this server unconditionally
  255. accept hosts = @[] : @
  256. # deny if the HELO pretends to be this host
  257. deny message = HELO_HOST_IMPERSANATION
  258. condition = ${if or { \
  259. {eq{$sender_helo_name}{$smtp_active_hostname}} \
  260. {eq{$sender_helo_name}{[$interface_address]}} \
  261. } {true}{false} }
  262. # deny if the HELO is an IP address
  263. deny message = HELO_IS_IP
  264. condition = ${if eq{$interface_port}{25}}
  265. condition = ${if isip{$sender_helo_name}}
  266. # deny if hostname if ylmf-pc, which accounts for a HUGE percentage of BF attacks
  267. deny message = HELO_BLOCKED_FOR_ABUSE
  268. condition = ${if eq{$sender_helo_name}{ylmf-pc}}
  269. # deny if the HELO pretends to be one of the domains hosted on the server
  270. deny message = HELO_IS_LOCAL_DOMAIN
  271. condition = ${if match_domain{$sender_helo_name}{+local_domains}{true}{false}}
  272. hosts = ! +relay_hosts
  273. accept
  274.  
  275.  
  276. ######################################
  277. # ACL SCRIPT
  278. ######################################
  279. acl_script:
  280. discard set acl_m_uid = ${perl{find_uid}}
  281. set acl_m_username = ${perl{get_username}{$acl_m_uid}}
  282. condition = ${if !eq {$acl_m_uid}{-1}{yes}{no}}
  283. condition = ${if >{${perl{hit_limit_user}{$acl_m_username}}}{1}}
  284. message = USER_TOO_MANY
  285.  
  286. discard condition = ${if !eq{$originator_uid}{$exim_uid}}
  287. condition = ${if exists{BLACKLIST_USERNAMES}}
  288. condition = ${lookup{$acl_m_username}lsearch{BLACKLIST_USERNAMES}{1}{0}}
  289. message = USER_ON_BLACKLIST_SCRIPT BLACKLIST_USERNAMES
  290.  
  291. discard condition = ${if !eq{$originator_uid}{$exim_uid}}
  292. condition = ${if exists{BLACKLIST_SCRIPT_USERNAMES}}
  293. condition = ${lookup{$acl_m_username}lsearch{BLACKLIST_SCRIPT_USERNAMES}{1}{0}}
  294. message = USER_ON_BLACKLIST_SCRIPT BLACKLIST_SCRIPT_USERNAMES
  295.  
  296. .include_if_exists /etc/exim.blockcracking/script.conf
  297.  
  298. accept
  299.  
  300. .include_if_exists /etc/exim.blockcracking/script.recipients.conf
  301.  
  302.  
  303. ######################################
  304. # ACL CHECK RECIPIENT
  305. ######################################
  306. #EDIT#26:
  307. acl_check_recipient:
  308. # block certain well-known exploits, Deny for local domains if
  309. # local parts begin with a dot or contain @ % ! / |
  310. deny domains = +local_domains
  311. local_parts = ^[.] : ^.*[@%!/|]
  312. # Prevents unencrypted mail submission.
  313. accept encrypted = *
  314. drop message = Your connection must be encrypted.
  315. log_message = Connection from \
  316. [$sender_host_address]($authenticated_id) was \
  317. not encrypted.
  318. # If you've hit the limit, you can't send anymore. Requires exim.pl 17+
  319. drop message = AUTH_TOO_MANY
  320. condition = ${perl{auth_hit_limit_acl}}
  321. authenticated = *
  322.  
  323. drop message = MULTIPLE_BOUNCE_RECIPIENTS
  324. senders = : postmaster@*
  325. condition = ${if >{$recipients_count}{0}{true}{false}}
  326.  
  327. drop message = TOO_MANY_FAILED_RECIPIENTS
  328. log_message = REJECTED - Too many failed recipients - count = $rcpt_fail_count
  329. condition = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
  330. !verify = recipient/callout=2m,defer_ok,use_sender
  331.  
  332. drop message = DOMAIN_SUSPENDED
  333. domains = +local_domains
  334. condition = ${if exists{/etc/virtual/${domain}_off}{yes}{no}}
  335.  
  336. drop authenticated = *
  337. condition = ${if exists{BLACKLIST_USERNAMES}}
  338. set acl_m_uid = ${perl{find_uid_auth_id}{$authenticated_id}}
  339. set acl_m_username = ${perl{get_username}{$acl_m_uid}}
  340. condition = ${if !eq {$acl_m_uid}{-1}{yes}{no}}
  341. condition = ${lookup{$acl_m_username}lsearch{BLACKLIST_USERNAMES}{1}{0}}
  342. message = USER_ON_BLACKLIST_SMTP
  343. logwrite = User account $acl_m_username is blocked via BLACKLIST_USERNAMES
  344.  
  345. drop authenticated = *
  346. condition = ${if exists{BLACKLIST_SMTP_USERNAMES}}
  347. set acl_m_uid = ${perl{find_uid_auth_id}{$authenticated_id}}
  348. set acl_m_username = ${perl{get_username}{$acl_m_uid}}
  349. condition = ${if !eq {$acl_m_uid}{-1}{yes}{no}}
  350. condition = ${lookup{$acl_m_username}lsearch{BLACKLIST_SMTP_USERNAMES}{1}{0}}
  351. message = USER_ON_BLACKLIST_SMTP
  352. logwrite = User account $acl_m_username is blocked via BLACKLIST_SMTP_USERNAMES
  353.  
  354. accept condition = ${if eq{$acl_m_is_whitelisted}{1}{1}{0}}
  355.  
  356. #Block Cracking - https://github.com/Exim/exim/wiki/BlockCracking
  357. .include_if_exists /etc/exim.blockcracking/auth.conf
  358.  
  359. # restrict port 587 to authenticated users only
  360. # see also daemon_smtp_ports above
  361. accept hosts = +auth_relay_hosts
  362. condition = ${if eq {$interface_port}{587} {yes}{no}}
  363. endpass
  364. message = RELAY_NOT_PERMITTED_AUTH
  365. authenticated = *
  366. # Deny all Mailer-Daemon messages not for us:
  367. deny message = We didn't send the message
  368. senders = :
  369. domains = !+relay_domains
  370.  
  371. # Deny if the recipient doesn't exist:
  372. deny message = NO_SUCH_RECIPIENT
  373. domains = +local_domains
  374. !verify = recipient
  375. # Remaining Mailer-Daemon messages must be for us
  376. accept senders = :
  377. domains = +relay_domains
  378.  
  379. #EDIT#27:
  380. # 1st deny checks if it's a hostname or IPV4 address with dots or IPV6 address
  381. deny message = R1: HELO_SHOULD_BE_FQDN
  382. !authenticated = *
  383. condition = ${if match{$sender_helo_name}{\N^\[\N}{no}{yes}}
  384. condition = ${if match{$sender_helo_name}{\N\.\N}{no}{yes}}
  385. ## 2nd deny makes sure the hostname doesn't end with a dot (invalid)
  386. # deny message = R2: HELO_SHOULD_BE_FQDN
  387. # !authenticated = *
  388. # condition = ${if match{$sender_helo_name}{\N\.$\N}}
  389. # 3rd deny makes sure the hostname has no double-dots (invalid)
  390. deny message = R3: HELO_SHOULD_BE_FQDN
  391. !authenticated = *
  392. condition = ${if match{$sender_helo_name}{\N\.\.\N}}
  393. ## 4th deny make sure the hostname doesn't end in .home (invalid domain)
  394. # deny message = R4: HELO_SHOULD_BE_FQDN
  395. # !authenticated = *
  396. # condition = ${if match{$sender_helo_name}{\N\.home$\N}}
  397.  
  398. #EDIT#28:
  399. # warn domains = +skip_av_domains
  400. # set acl_m0 = $tod_epoch
  401.  
  402. #EDIT#29:
  403. deny domains = !+local_domains
  404. local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
  405.  
  406. #EDIT#30:
  407. accept hosts = :
  408. logwrite = Whitelisted as having local origination
  409.  
  410. #EDIT#32:
  411. deny message = 554 denied. 5.7.1 BLOCKED_DUE_TO_SPAM_SENDER
  412. domains = +use_rbl_domains
  413. domains = !+skip_rbl_domains
  414. hosts = !+skip_rbl_hosts : !+skip_rbl_hosts_ip
  415. senders = +blacklist_senders
  416.  
  417. #EDIT#33:
  418. deny message = 554 denied. 5.7.1 BLOCKED_DUE_TO_SPAM_HOST
  419. # only for domains that do want to be tested against RBLs
  420. domains = +use_rbl_domains
  421. domains = !+skip_rbl_domains
  422. hosts = !+skip_rbl_hosts : !+skip_rbl_hosts_ip
  423. hosts = +bad_sender_hosts
  424.  
  425. #EDIT#34:
  426. deny message = 554 denied. 5.7.1 BLOCKED_DUE_TO_SPAM_IP
  427. hosts = +bad_sender_hosts_ip
  428.  
  429. #EDIT#35:
  430. accept domains = +local_domains
  431. sender_domains = !+blacklist_domains
  432. hosts = !+bad_sender_hosts
  433. hosts = !+bad_sender_hosts_ip
  434. dnslists = list.dnswl.org&0.0.0.2
  435. dnslists = list.dnswl.org!=127.0.0.255
  436. logwrite = $sender_host_address whitelisted in list.dnswl.org
  437.  
  438. #EDIT#36:
  439. # accept domains = +local_domains
  440. # dnslists = hostkarma.junkemailfilter.com=127.0.0.1
  441. # logwrite = $sender_host_address whitelisted in hostkarma.junkemailfilter.com
  442.  
  443. #EDIT#37:
  444. # accept local_parts = whitelist
  445. # domains = example.com
  446.  
  447. #EDIT#38:
  448. require verify = sender
  449.  
  450. #EDIT#39:
  451. deny message = 554 denied. 5.7.1 BLOCKED_DUE_TO_SPAM_DOMAIN
  452. domains = +use_rbl_domains
  453. domains = !+skip_rbl_domains
  454. hosts = !+skip_rbl_hosts : !+skip_rbl_hosts_ip
  455. sender_domains = +blacklist_domains
  456.  
  457. #EDIT#40:
  458. # deny message = 554 denied. 5.7.1 Forged Paypal Mail, not sent from PayPal.
  459. # senders = *@paypal.com
  460. # condition = ${if match {$sender_host_name}{\Npaypal.com$\N}{no}{yes}}
  461.  
  462. #EDIT#41:
  463. warn hosts = +skip_rbl_hosts
  464. logwrite = $sender_host_address RBL whitelisted in skip_rbl_hosts
  465. warn hosts = +skip_rbl_hosts_ip
  466. logwrite = $sender_host_address RBL whitelisted in skip_rbl_hosts_ip
  467. warn domains = +skip_rbl_domains
  468. logwrite = $sender_host_address RBL whitelisted $domain in skip_rbl_domains
  469.  
  470. deny message = RBL_BLOCKED_BY_LIST
  471. hosts = !+relay_hosts
  472. domains = +use_rbl_domains
  473. domains = !+skip_rbl_domains
  474. hosts = !+skip_rbl_hosts : !+skip_rbl_hosts_ip
  475. !authenticated = *
  476. dnslists = RBL_DNS_LIST
  477.  
  478. .include_if_exists /etc/exim.easy_spam_fighter/check_rcpt.conf
  479.  
  480. #COMMENT#43:
  481. # ACCEPT EMAIL BEGINNING HERE
  482. # accept if address is in a local domain as long as recipient can be verified
  483. accept domains = +local_domains
  484. endpass
  485. message = UNKNOWN_USER
  486. verify = recipient
  487. #COMMENT#44
  488. # accept if address is in a domain for which we relay as long as recipient
  489. # can be verified
  490. accept domains = +relay_domains
  491. endpass
  492. verify = recipient
  493. #EDIT#45:
  494. accept hosts = +relay_hosts
  495. add_header = X-Relay-Host: $sender_host_address
  496.  
  497. accept hosts = +auth_relay_hosts
  498. endpass
  499. message = AUTH_REQUIRED
  500. authenticated = *
  501.  
  502. # FINAL DENY EMAIL BEFORE DATA BEGINS HERE
  503. # default at end of acl causes a "deny", but line below will give
  504. # an explicit error message:
  505. deny message = RELAY_NOT_PERMITTED
  506.  
  507.  
  508. ######################################
  509. # ACL CHECK DKIM
  510. ######################################
  511. acl_check_dkim:
  512. accept condition = ${if eq{$acl_m_is_whitelisted}{1}{1}{0}}
  513.  
  514. .include_if_exists /etc/exim.easy_spam_fighter/check_dkim.conf
  515. accept
  516.  
  517.  
  518. ######################################
  519. # ACL CHECK MESSAGE
  520. ######################################
  521. # ACL that is used after the DATA command (ClamAV)
  522. acl_check_message:
  523. accept condition = ${if eq{$acl_m_is_whitelisted}{1}{1}{0}}
  524.  
  525. .include_if_exists /etc/exim.easy_spam_fighter/check_message.conf
  526.  
  527. #EDIT#46:
  528. .include_if_exists /etc/exim.clamav.conf
  529.  
  530. accept
  531.  
  532.  
  533. ######################################
  534. # ACL that is used for each MIME attachment in the email.
  535. acl_check_mime:
  536.  
  537. .include_if_exists /etc/exim.check_mime.conf.custom
  538. .include_if_exists /etc/exim.easy_spam_fighter/check_mime.conf
  539.  
  540. accept
  541.  
  542.  
  543. ##################################################################################
  544. # AUTHENTICATION CONFIGURATION
  545. ##################################################################################
  546. begin authenticators
  547.  
  548. plain:
  549. driver = plaintext
  550. public_name = PLAIN
  551. server_prompts = :
  552. server_condition = "${perl{smtpauth}{0}}"
  553. server_set_id = $2
  554.  
  555. login:
  556. driver = plaintext
  557. public_name = LOGIN
  558. server_prompts = "Username:: : Password::"
  559. server_condition = "${perl{smtpauth}{0}}"
  560. server_set_id = $1
  561.  
  562. #EDIT#47:
  563. # REWRITE CONFIGURATION
  564. # There is no rewriting specification in this exim.conf file. If your
  565. # configuration requires one, it would go here
  566.  
  567.  
  568.  
  569. ##################################################################################
  570. # ROUTERS CONFIGURATION
  571. ##################################################################################
  572. begin routers
  573. #EDIT#48:
  574.  
  575. lookuphost:
  576. driver = dnslookup
  577. domains = ! +local_domains
  578. ignore_target_hosts = 127.0.0.0/8
  579. condition = "${perl{check_limits}}"
  580. transport = remote_smtp
  581. no_more
  582.  
  583. # RELATED: http://help.directadmin.com/item.php?id=153
  584. # smart_route:
  585. # driver = manualroute
  586. # domains = ! +local_domains
  587. # ignore_target_hosts = 127.0.0.0/8
  588. # condition = "${perl{check_limits}}"
  589. # route_list = !+local_domains HOSTNAME-or-IP#
  590. # transport = remote_smtp
  591.  
  592. #COMMENT#49:
  593. #DIRECTORS CONFIGURATION
  594.  
  595. .include_if_exists /etc/exim.spamassassin.conf
  596.  
  597. #EDIT#50:
  598. # Spam Assassin
  599. #spamcheck_director removed. Use the exim.spamassassin.conf
  600.  
  601. majordomo_aliases:
  602. driver = redirect
  603. allow_defer
  604. allow_fail
  605. data = ${if exists{/etc/virtual/${domain}/majordomo/list.aliases}{${lookup{$local_part}lsearch{/etc/virtual/${domain}/majordomo/list.aliases}}}}
  606. domains = lsearch;/etc/virtual/domainowners
  607. file_transport = address_file
  608. group = daemon
  609. pipe_transport = majordomo_pipe
  610. retry_use_local_part
  611. no_rewrite
  612. user = majordomo
  613.  
  614. majordomo_private:
  615. driver = redirect
  616. allow_defer
  617. allow_fail
  618. #condition = "${if eq {$received_protocol} {local} {true} {false} }"
  619. condition = "${if or { {eq {$received_protocol} {local}} \
  620. {eq {$received_protocol} {spam-scanned}} } {true} {false} }"
  621. data = ${if exists{/etc/virtual/${domain}/majordomo/private.aliases}{${lookup{$local_part}lsearch{/etc/virtual/${domain}/majordomo/private.aliases}}}}
  622. domains = lsearch;/etc/virtual/domainowners
  623. file_transport = address_file
  624. group = daemon
  625. pipe_transport = majordomo_pipe
  626. retry_use_local_part
  627. user = majordomo
  628.  
  629. domain_filter:
  630. driver = redirect
  631. allow_filter
  632. no_check_local_user
  633. condition = "${if exists{/etc/virtual/${domain}/filter}{yes}{no}}"
  634. user = "${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}"
  635. group = "mail"
  636. file = /etc/virtual/${domain}/filter
  637. directory_transport = address_file
  638. pipe_transport = virtual_address_pipe
  639. retry_use_local_part
  640. no_verify
  641.  
  642. uservacation:
  643. # uservacation reply to all except errors, bounces, lists
  644. driver = accept
  645. condition = ${lookup{$local_part} lsearch {/etc/virtual/${domain}/vacation.conf}{yes}{no}}
  646. condition = ${if match{$h_X-Spam-Status:}{\N^Yes\N}{no}{yes}}
  647. require_files = /etc/virtual/${domain}/reply/${local_part}.msg
  648. # do not reply to errors and bounces or lists
  649. senders = " ! ^.*-request@.*:\
  650. ! ^owner-.*@.*:\
  651. ! ^postmaster@.*:\
  652. ! ^listmaster@.*:\
  653. ! ^mailer-daemon@.*\
  654. ! ^root@.*"
  655. transport = uservacation
  656. unseen
  657.  
  658. userautoreply:
  659. driver = accept
  660. condition = ${lookup{$local_part} lsearch {/etc/virtual/${domain}/autoresponder.conf}{yes}{no}}
  661. condition = ${if match{$h_X-Spam-Status:}{\N^Yes\N}{no}{yes}}
  662. require_files = /etc/virtual/${domain}/reply/${local_part}.msg
  663. # do not reply to errors and bounces or lists
  664. senders = " ! ^.*-request@.*:\
  665. ! ^owner-.*@.*:\
  666. ! ^postmaster@.*:\
  667. ! ^listmaster@.*:\
  668. ! ^mailer-daemon@.*\
  669. ! ^root@.*"
  670. transport = userautoreply
  671. unseen
  672.  
  673. virtual_aliases_nostar:
  674. driver = redirect
  675. .include_if_exists /etc/exim.srs.forward.conf
  676. allow_defer
  677. allow_fail
  678. data = ${if exists{/etc/virtual/${domain}/aliases}{${lookup{$local_part}lsearch{/etc/virtual/${domain}/aliases}}}}
  679. file_transport = address_file
  680. group = mail
  681. pipe_transport = virtual_address_pipe
  682. retry_use_local_part
  683. unseen
  684. #include_domain = true
  685.  
  686. virtual_user:
  687. driver = accept
  688. condition = ${perl{save_virtual_user}}
  689. domains = lsearch;/etc/virtual/domainowners
  690. group = mail
  691. retry_use_local_part
  692. transport = dovecot_lmtp_udp
  693.  
  694. # accept only if local_part is not in the aliases file
  695. # (this implements catch-all)
  696. virtual_aliases:
  697. driver = redirect
  698. .include_if_exists /etc/exim.srs.forward.conf
  699. allow_defer
  700. allow_fail
  701. condition = ${if eq {}{${if exists{/etc/virtual/${domain}/aliases}{${lookup{$local_part}lsearch{/etc/virtual/${domain}/aliases}}}}}{yes}{no}}
  702. data = ${if exists{/etc/virtual/$domain/aliases}{${lookup{$local_part}lsearch*{/etc/virtual/$domain/aliases}}}}
  703. file_transport = address_file
  704. group = mail
  705. pipe_transport = virtual_address_pipe
  706. retry_use_local_part
  707. #include_domain = true
  708.  
  709. #COMMENT#51:
  710. drop_solo_alias:
  711. driver = redirect
  712. allow_defer
  713. allow_fail
  714. data = ${if exists{/etc/virtual/$domain/aliases}{${lookup{$local_part}lsearch{/etc/virtual/$domain/aliases}}}}
  715. file_transport = devnull
  716. group = mail
  717. pipe_transport = devnull
  718. retry_use_local_part
  719. #include_domain = true
  720.  
  721. srs_router:
  722. driver = redirect
  723. srs = reverseandforward
  724. data = ${srs_recipient}
  725.  
  726. #COMMENT#52:
  727. userforward:
  728. driver = redirect
  729. allow_filter
  730. check_ancestor
  731. check_local_user
  732. no_expn
  733. file = $home/.forward
  734. file_transport = address_file
  735. pipe_transport = address_pipe
  736. reply_transport = address_reply
  737. no_verify
  738.  
  739. system_aliases:
  740. driver = redirect
  741. allow_defer
  742. allow_fail
  743. data = ${lookup{$local_part}lsearch{/etc/aliases}}
  744. file_transport = address_file
  745. pipe_transport = address_pipe
  746. retry_use_local_part
  747. # user = exim
  748.  
  749. localuser:
  750. driver = accept
  751. check_local_user
  752. condition = "${if eq {$domain} {$primary_hostname} {yes} {no}}"
  753. transport = local_delivery
  754.  
  755. #COMMENT#53:
  756. ##################################################################################
  757. # TRANSPORTS CONFIGURATION
  758. ##################################################################################
  759. begin transports
  760.  
  761. #COMMENT#54:
  762. spamcheck:
  763. driver = pipe
  764. batch_max = 100
  765. command = /usr/sbin/exim -oMr spam-scanned -bS
  766. current_directory = "/tmp"
  767. group = mail
  768. home_directory = "/tmp"
  769. log_output
  770. message_prefix =
  771. message_suffix =
  772. return_fail_output
  773. no_return_path_add
  774. transport_filter = /usr/bin/spamc -u ${lookup{$domain}lsearch*{/etc/virtual/domainowners}{$value}}
  775. use_bsmtp
  776. user = mail
  777.  
  778. #COMMENT#55:
  779. majordomo_pipe:
  780. driver = pipe
  781. group = daemon
  782. return_fail_output
  783. user = majordomo
  784.  
  785. #COMMENT#56:
  786. local_delivery:
  787. driver = appendfile
  788. delivery_date_add
  789. envelope_to_add
  790. directory = /home/$local_part/Maildir/
  791. directory_mode = 770
  792. create_directory = true
  793. maildir_format
  794. group = mail
  795. mode = 0660
  796. return_path_add
  797. user = ${local_part}
  798.  
  799. #COMMENT#57:
  800. virtual_localdelivery:
  801. driver = appendfile
  802. create_directory
  803. delivery_date_add
  804. directory_mode = 770
  805. envelope_to_add
  806. directory = /home/${lookup{$domain}lsearch*{/etc/virtual/domainowners}{$value}}/imap/${domain}/${local_part}/Maildir
  807. maildir_format
  808. group = mail
  809. mode = 660
  810. return_path_add
  811. user = "${lookup{$domain}lsearch*{/etc/virtual/domainowners}{$value}}"
  812. quota = ${if exists{/etc/virtual/${domain}/quota}{${lookup{$local_part}lsearch*{/etc/virtual/${domain}/quota}{$value}{0}}}{0}}
  813.  
  814. #EDIT#58:
  815. uservacation:
  816. driver = autoreply
  817. file = /etc/virtual/${domain}/reply/${local_part}.msg
  818. from = "${local_part}@${domain}"
  819. log = /etc/virtual/${domain}/reply/${local_part}.log
  820. no_return_message
  821. headers = ${if exists{/etc/virtual/${domain}/reply/${local_part}.headers}{${readfile{/etc/virtual/${domain}/reply/${local_part}.headers}}}}
  822. subject = ${if def:h_Subject: {\
  823. ${if exists{/etc/virtual/${domain}/reply/${local_part}.subject}\
  824. {${readfile{/etc/virtual/${domain}/reply/${local_part}.subject}{}}}\
  825. {Autoreply}\
  826. }: ${quote:${escape:${length_60:$h_Subject:}}}}\
  827. {I am on vacation}}
  828. to = "${sender_address}"
  829. user = mail
  830. once = /etc/virtual/${domain}/reply/${local_part}.once
  831. once_file_size = 100K
  832. once_repeat = ${if exists{/etc/virtual/${domain}/reply/${local_part}.once_time}{${readfile{/etc/virtual/${domain}/reply/${local_part}.once_time}{}}}{2d}}
  833.  
  834. #COMMENT#59:
  835. userautoreply:
  836. driver = autoreply
  837. bcc = ${lookup{${local_part}} lsearch {/etc/virtual/${domain}/autoresponder.conf}{$value}}
  838. file = /etc/virtual/${domain}/reply/${local_part}.msg
  839. from = "${local_part}@${domain}"
  840. log = /etc/virtual/${domain}/reply/${local_part}.log
  841. no_return_message
  842. headers = ${if exists{/etc/virtual/${domain}/reply/${local_part}.headers}{${readfile{/etc/virtual/${domain}/reply/${local_part}.headers}}}}
  843. subject = ${if def:h_Subject: {\
  844. ${if exists{/etc/virtual/${domain}/reply/${local_part}.subject}\
  845. {${readfile{/etc/virtual/${domain}/reply/${local_part}.subject}{}}}\
  846. {Autoreply}\
  847. }: ${quote:${escape:${length_60:$h_Subject:}}}}\
  848. {Autoreply Message}}
  849. to = "${sender_address}"
  850. user = mail
  851. once = /etc/virtual/${domain}/reply/${local_part}.once
  852. once_file_size = 100K
  853. once_repeat = ${if exists{/etc/virtual/${domain}/reply/${local_part}.once_time}{${readfile{/etc/virtual/${domain}/reply/${local_part}.once_time}{}}}{2d}}
  854.  
  855. #COMMENT#60:
  856. devnull:
  857. driver = appendfile
  858. file = /dev/null
  859.  
  860. #COMMENT#61:
  861. remote_smtp:
  862. driver = smtp
  863. headers_add = "${if def:authenticated_id{X-Authenticated-Id: ${authenticated_id}}}"
  864. interface = <; ${if exists{/etc/virtual/domainips}{${lookup{$sender_address_domain}lsearch*{/etc/virtual/domainips}}}}
  865. helo_data = ${if exists{/etc/virtual/helo_data}{${lookup{$sending_ip_address}iplsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}}{$primary_hostname}}
  866. .include_if_exists /etc/exim.dkim.conf
  867.  
  868. #EDIT#62:
  869. address_pipe:
  870. driver = pipe
  871. return_output
  872.  
  873. virtual_address_pipe:
  874. driver = pipe
  875. group = nobody
  876. return_output
  877. user = "${lookup{$domain}lsearch* {/etc/virtual/domainowners}{$value}}"
  878. .include_if_exists /etc/exim.cagefs.pipe.conf
  879.  
  880. #COMMENT#63:
  881. address_file:
  882. driver = appendfile
  883. delivery_date_add
  884. envelope_to_add
  885. return_path_add
  886.  
  887. #COMMENT#64:
  888. address_reply:
  889. driver = autoreply
  890.  
  891. dovecot_lmtp_udp:
  892. driver = lmtp
  893. socket = /var/run/dovecot/lmtp
  894. #maximum number of deliveries per batch, default 1
  895. batch_max = 200
  896. delivery_date_add
  897. envelope_to_add
  898. return_path_add
  899. user = mail
  900.  
  901. ##################################################################################
  902. # RETRY CONFIGURATION
  903. ##################################################################################
  904. #EDIT#65:
  905. # Domain Error Retries
  906. # ------ ----- -------
  907. begin retry
  908. * quota
  909. * * F,2h,15m; G,16h,1h,1.5; F,4d,8h
  910. # End of Exim 4 configuration
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement