Advertisement
Guest User

Untitled

a guest
Sep 7th, 2016
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.73 KB | None | 0 0
  1. root@server:/home/admin# cat /etc/exim4/exim4.conf.template
  2. ######################################################################
  3. # #
  4. # Exim configuration file for Vesta Control Panel #
  5. # #
  6. ######################################################################
  7.  
  8. #SPAMASSASSIN = yes
  9. #SPAM_SCORE = 50
  10. #CLAMD = yes
  11.  
  12. domainlist local_domains = dsearch;/etc/exim4/domains/
  13. domainlist relay_to_domains = dsearch;/etc/exim4/domains/
  14. hostlist relay_from_hosts = 127.0.0.1
  15. hostlist whitelist = net-iplsearch;/etc/exim4/white-blocks.conf
  16. hostlist spammers = net-iplsearch;/etc/exim4/spam-blocks.conf
  17. no_local_from_check
  18. untrusted_set_sender = *
  19. acl_smtp_connect = acl_check_spammers
  20. acl_smtp_mail = acl_check_mail
  21. acl_smtp_rcpt = acl_check_rcpt
  22. acl_smtp_data = acl_check_data
  23. acl_smtp_mime = acl_check_mime
  24.  
  25. .ifdef SPAMASSASSIN
  26. spamd_address = 127.0.0.1 783
  27. .endif
  28.  
  29. .ifdef CLAMD
  30. av_scanner = clamd: /var/run/clamav/clamd.ctl
  31. .endif
  32.  
  33. tls_advertise_hosts = *
  34. tls_certificate = /usr/local/vesta/ssl/certificate.crt
  35. tls_privatekey = /usr/local/vesta/ssl/certificate.key
  36.  
  37. daemon_smtp_ports = 25 : 465 : 587 : 2525
  38. tls_on_connect_ports = 465
  39. never_users = root
  40. host_lookup = *
  41. rfc1413_hosts = *
  42. rfc1413_query_timeout = 5s
  43. ignore_bounce_errors_after = 2d
  44. timeout_frozen_after = 7d
  45.  
  46. DKIM_DOMAIN = ${lc:${domain:$h_from:}}
  47. DKIM_FILE = /etc/exim4/domains/${lc:${domain:$h_from:}}/dkim.pem
  48. DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}}
  49.  
  50.  
  51.  
  52. ######################################################################
  53. # ACL CONFIGURATION #
  54. # Specifies access control lists for incoming SMTP mail #
  55. ######################################################################
  56. begin acl
  57.  
  58. acl_check_spammers:
  59. accept hosts = +whitelist
  60.  
  61. drop message = Your host in blacklist on this server.
  62. log_message = Host in blacklist
  63. hosts = +spammers
  64.  
  65. accept
  66.  
  67.  
  68. acl_check_mail:
  69. deny condition = ${if eq{$sender_helo_name}{}}
  70. message = HELO required before MAIL
  71.  
  72. drop message = Helo name contains a ip address (HELO was $sender_helo_name) and not is valid
  73. condition = ${if match{$sender_helo_name}{\N((\d{1,3}[.-]\d{1,3}[.-]\d{1,3}[.-]\d{1,3})|([0-9a-f]{8})|([0-9A-F]{8}))\N}{yes}{no}}
  74. condition = ${if match {${lookup dnsdb{>: defer_never,ptr=$sender_host_address}}\}{$sender_helo_name}{no}{yes}}
  75. delay = 45s
  76.  
  77. drop condition = ${if isip{$sender_helo_name}}
  78. message = Access denied - Invalid HELO name (See RFC2821 4.1.3)
  79.  
  80. drop condition = ${if eq{[$interface_address]}{$sender_helo_name}}
  81. message = $interface_address is _my_ address
  82.  
  83. accept
  84.  
  85.  
  86. acl_check_rcpt:
  87. accept hosts = :
  88.  
  89. deny message = Restricted characters in address
  90. domains = +local_domains
  91. local_parts = ^[.] : ^.*[@%!/|]
  92.  
  93. deny message = Restricted characters in address
  94. domains = !+local_domains
  95. local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
  96.  
  97. require verify = sender
  98.  
  99. accept hosts = +relay_from_hosts
  100. control = submission
  101.  
  102. accept authenticated = *
  103. control = submission/domain=
  104.  
  105. deny message = Rejected because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text
  106. hosts = !+whitelist
  107. dnslists = ${readfile {/etc/exim4/dnsbl.conf}{:}}
  108.  
  109. require message = relay not permitted
  110. domains = +local_domains : +relay_to_domains
  111.  
  112. deny message = smtp auth requried
  113. sender_domains = +local_domains
  114. !authenticated = *
  115.  
  116. require verify = recipient
  117.  
  118. .ifdef CLAMD
  119. warn set acl_m0 = no
  120.  
  121. warn condition = ${if exists {/etc/exim4/domains/$domain/antivirus}{yes}{no}}
  122. set acl_m0 = yes
  123. .endif
  124.  
  125. .ifdef SPAMASSASSIN
  126. warn set acl_m1 = no
  127.  
  128. warn condition = ${if exists {/etc/exim4/domains/$domain/antispam}{yes}{no}}
  129. set acl_m1 = yes
  130. .endif
  131.  
  132. accept
  133.  
  134.  
  135. acl_check_data:
  136. .ifdef CLAMD
  137. deny message = Message contains a virus ($malware_name) and has been rejected
  138. malware = *
  139. condition = ${if eq{$acl_m0}{yes}{yes}{no}}
  140. .endif
  141.  
  142. .ifdef SPAMASSASSIN
  143. warn !authenticated = *
  144. hosts = !+relay_from_hosts
  145. condition = ${if < {$message_size}{100K}}
  146. condition = ${if eq{$acl_m1}{yes}{yes}{no}}
  147. spam = nobody:true/defer_ok
  148. add_header = X-Spam-Score: $spam_score_int
  149. add_header = X-Spam-Bar: $spam_bar
  150. add_header = X-Spam-Report: $spam_report
  151. set acl_m2 = $spam_score_int
  152.  
  153. warn condition = ${if !eq{$acl_m2}{} {yes}{no}}
  154. condition = ${if >{$acl_m2}{SPAM_SCORE} {yes}{no}}
  155. add_header = X-Spam-Status: Yes
  156. message = SpamAssassin detected spam (from $sender_address to $recipients).
  157. .endif
  158.  
  159. accept
  160.  
  161.  
  162. acl_check_mime:
  163. deny message = Blacklisted file extension detected
  164. condition = ${if match {${lc:$mime_filename}}{\N(\.ade|\.adp|\.bat|\.chm|\.cmd|\.com|\.cpl|\.exe|\.hta|\.ins|\.isp|\.jse|\.lib|\.lnk|\.mde|\.msc|\.msp|\.mst|\.pif|\.scr|\.sct|\.shb|\.sys|\.vb|\.vbe|\.vbs|\.vxd|\.wsc|\.wsf|\.wsh)$\N}{1}{0}}
  165.  
  166. accept
  167.  
  168.  
  169.  
  170. ######################################################################
  171. # AUTHENTICATION CONFIGURATION #
  172. ######################################################################
  173. begin authenticators
  174.  
  175. dovecot_plain:
  176. driver = dovecot
  177. public_name = PLAIN
  178. server_socket = /var/run/dovecot/auth-client
  179. server_set_id = $auth1
  180.  
  181. dovecot_login:
  182. driver = dovecot
  183. public_name = LOGIN
  184. server_socket = /var/run/dovecot/auth-client
  185. server_set_id = $auth1
  186.  
  187.  
  188.  
  189. ######################################################################
  190. # ROUTERS CONFIGURATION #
  191. # Specifies how addresses are handled #
  192. ######################################################################
  193. begin routers
  194.  
  195. #smarthost:
  196. # driver = manualroute
  197. # domains = ! +local_domains
  198. # transport = remote_smtp
  199. # route_list = * smartrelay.vestacp.com
  200. # no_more
  201. # no_verify
  202.  
  203. dnslookup:
  204. driver = dnslookup
  205. domains = !+local_domains
  206. transport = remote_smtp
  207. no_more
  208.  
  209. userforward:
  210. driver = redirect
  211. check_local_user
  212. file = $home/.forward
  213. allow_filter
  214. no_verify
  215. no_expn
  216. check_ancestor
  217. file_transport = address_file
  218. pipe_transport = address_pipe
  219. reply_transport = address_reply
  220.  
  221. procmail:
  222. driver = accept
  223. check_local_user
  224. require_files = ${local_part}:+${home}/.procmailrc:/usr/bin/procmail
  225. transport = procmail
  226. no_verify
  227.  
  228. autoreplay:
  229. driver = accept
  230. require_files = /etc/exim4/domains/$domain/autoreply.${local_part}.msg
  231. condition = ${if exists{/etc/exim4/domains/$domain/autoreply.${local_part}.msg}}{yes}{no}}
  232. retry_use_local_part
  233. transport = userautoreply
  234. unseen
  235.  
  236. aliases:
  237. driver = redirect
  238. headers_add = X-redirected: yes
  239. data = ${extract{1}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim4/domains/$domain/aliases}}}}
  240. require_files = /etc/exim4/domains/$domain/aliases
  241. redirect_router = dnslookup
  242. pipe_transport = address_pipe
  243. unseen
  244.  
  245. localuser_fwd_only:
  246. driver = accept
  247. transport = devnull
  248. condition = ${if exists{/etc/exim4/domains/$domain/fwd_only}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/fwd_only}{true}{false}}}}
  249.  
  250. localuser_spam:
  251. driver = accept
  252. transport = local_spam_delivery
  253. condition = ${if eq {${if match{$h_X-Spam-Status:}{\N^Yes\N}{yes}{no}}} {${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}{yes}{no_such_user}}}}
  254.  
  255. localuser:
  256. driver = accept
  257. transport = local_delivery
  258. condition = ${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}{true}{false}}
  259.  
  260. catchall:
  261. driver = redirect
  262. headers_add = X-redirected: yes
  263. require_files = /etc/exim4/domains/$domain/aliases
  264. data = ${extract{1}{:}{${lookup{*@$domain}lsearch{/etc/exim4/domains/$domain/aliases}}}}
  265. file_transport = local_delivery
  266. redirect_router = dnslookup
  267.  
  268. terminate_alias:
  269. driver = accept
  270. transport = devnull
  271. condition = ${lookup{$local_part@$domain}lsearch{/etc/exim4/domains/$domain/aliases}{true}{false}}
  272.  
  273.  
  274.  
  275. ######################################################################
  276. # TRANSPORTS CONFIGURATION #
  277. ######################################################################
  278. begin transports
  279.  
  280. remote_smtp:
  281. driver = smtp
  282. #helo_data = $sender_address_domain
  283. dkim_domain = DKIM_DOMAIN
  284. dkim_selector = mail
  285. dkim_private_key = DKIM_PRIVATE_KEY
  286. dkim_canon = relaxed
  287. dkim_strict = 0
  288.  
  289. procmail:
  290. driver = pipe
  291. command = "/usr/bin/procmail -d $local_part"
  292. return_path_add
  293. delivery_date_add
  294. envelope_to_add
  295. user = $local_part
  296. initgroups
  297. return_output
  298.  
  299. local_delivery:
  300. driver = appendfile
  301. maildir_format
  302. maildir_use_size_file
  303. user = ${extract{2}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}
  304. group = mail
  305. create_directory
  306. directory_mode = 770
  307. mode = 660
  308. use_lockfile = no
  309. delivery_date_add
  310. envelope_to_add
  311. return_path_add
  312. directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/$domain/$local_part"
  313. quota = ${extract{6}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}M
  314. quota_warn_threshold = 75%
  315.  
  316. local_spam_delivery:
  317. driver = appendfile
  318. maildir_format
  319. maildir_use_size_file
  320. user = ${extract{2}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}
  321. group = mail
  322. create_directory
  323. directory_mode = 770
  324. mode = 660
  325. use_lockfile = no
  326. delivery_date_add
  327. envelope_to_add
  328. return_path_add
  329. directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/$domain/$local_part/.Spam"
  330. quota = ${extract{6}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}M
  331. quota_directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/$domain/$local_part"
  332. quota_warn_threshold = 75%
  333.  
  334. address_pipe:
  335. driver = pipe
  336. return_output
  337.  
  338. address_file:
  339. driver = appendfile
  340. delivery_date_add
  341. envelope_to_add
  342. return_path_add
  343.  
  344. address_reply:
  345. driver = autoreply
  346.  
  347. userautoreply:
  348. driver = autoreply
  349. file = /etc/exim4/domains/$domain/autoreply.${local_part}.msg
  350. from = "${local_part}@${domain}"
  351. subject = "${if def:h_Subject: {Autoreply: ${quote:${escape:$h_Subject:}}} {Autoreply Message}}"
  352. to = "${sender_address}"
  353.  
  354. devnull:
  355. driver = appendfile
  356. file = /dev/null
  357.  
  358.  
  359.  
  360. ######################################################################
  361. # RETRY CONFIGURATION #
  362. ######################################################################
  363. begin retry
  364.  
  365. # Address or Domain Error Retries
  366. # ----------------- ----- -------
  367. * * F,2h,15m; G,16h,1h,1.5; F,4d,6h
  368.  
  369.  
  370.  
  371. ######################################################################
  372. # REWRITE CONFIGURATION #
  373. ######################################################################
  374. begin rewrite
  375.  
  376.  
  377.  
  378. ######################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement