Advertisement
Guest User

Untitled

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