Guest User

Untitled

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