Advertisement
Guest User

Untitled

a guest
May 26th, 2017
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.81 KB | None | 0 0
  1. primary_hostname = x0.hostname.com
  2. hide mysql_servers = localhost/vexim/vexim/PASSWORD
  3.  
  4. auth_advertise_hosts = *
  5.  
  6. daemon_smtp_ports = 25 : 26
  7.  
  8. tls_advertise_hosts = *
  9. tls_certificate = /etc/exim/ssl/exim.crt
  10. tls_privatekey = /etc/exim/ssl/exim.key
  11.  
  12.  
  13. domainlist local_domains = ${lookup mysql{SELECT `domain` \
  14. FROM `domain` WHERE \
  15. `domain`='${quote_mysql:$domain}' AND \
  16. `active`='1'}} : lsearch;/etc/localdomains
  17.  
  18. domainlist relay_to_domains = ${lookup mysql{SELECT `domain` \
  19. FROM `domain` WHERE \
  20. `domain`='${quote_mysql:$domain}' AND \
  21. `active`='1'}}
  22.  
  23. hostlist relay_from_hosts = localhost:127.0.0.0/8:192.168.0.0/16 #add the hosts from which you allow relaying here
  24.  
  25. acl_smtp_rcpt = acl_check_rcpt
  26. acl_smtp_data = acl_check_data
  27.  
  28. av_scanner = clamd:/var/run/clamav/clamd.sock
  29.  
  30. # spamd_address = 127.0.0.1 783
  31.  
  32.  
  33. allow_domain_literals = false
  34. exim_user = exim
  35. exim_group = exim
  36. never_users = root
  37. rfc1413_query_timeout = 0s
  38.  
  39. sender_unqualified_hosts = +relay_from_hosts
  40. recipient_unqualified_hosts = +relay_from_hosts
  41.  
  42. ignore_bounce_errors_after = 45m
  43. timeout_frozen_after = 15d
  44. helo_accept_junk_hosts = 192.168.0.0/16
  45. auto_thaw = 1h
  46. smtp_banner = "${primary_hostname} ESMTP Exim \
  47. \#${compile_number} ${tod_full} \n\
  48. We do not authorize the use of this system to transport unsolicited, \n\
  49. and/or bulk e-mail."
  50. smtp_accept_max = 50
  51. smtp_accept_max_per_connection = 25
  52. smtp_connect_backlog = 30
  53. smtp_accept_max_per_host = 20
  54. split_spool_directory = true
  55. remote_max_parallel = 15
  56. return_size_limit = 70k
  57. message_size_limit = 64M
  58. helo_allow_chars = _
  59. smtp_enforce_sync = true
  60.  
  61. log_selector = \
  62. +all_parents \
  63. +connection_reject \
  64. +incoming_interface \
  65. +lost_incoming_connection \
  66. +received_sender \
  67. +received_recipients \
  68. +smtp_confirmation \
  69. +smtp_syntax_error \
  70. +smtp_protocol_error \
  71. -queue_run
  72.  
  73. syslog_timestamp = no
  74.  
  75. begin acl
  76.  
  77. acl_check_rcpt:
  78. accept hosts = :
  79. deny message = "incorrect symbol in address"
  80. domains = +local_domains
  81. local_parts = ^[.] : ^.*[@%!/|]
  82.  
  83. deny message = "incorrect symbol in address"
  84. domains = !+local_domains
  85. local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
  86.  
  87. accept local_parts = postmaster
  88. domains = +local_domains
  89.  
  90. deny message = "HELO/EHLO required by SMTP RFC"
  91. condition = ${if eq{$sender_helo_name}{}{yes}{no}}
  92.  
  93. accept authenticated = *
  94.  
  95. deny message = "Your IP in HELO - access denied!"
  96. hosts = * : !+relay_from_hosts : !81-196.lissyara.su
  97. condition = ${if eq{$sender_helo_name}\
  98. {$sender_host_address}{true}{false}}
  99.  
  100. deny condition = ${if eq{$sender_helo_name}\
  101. {$interface_address}{yes}{no}}
  102. hosts = !127.0.0.1 : !localhost : *
  103. message = "My IP in your HELO! Access denied!"
  104.  
  105. deny condition = ${if match{$sender_helo_name}\
  106. {\N^\d+$\N}{yes}{no}}
  107. hosts = !127.0.0.1 : !localhost : *
  108. message = "Incorrect HELO string"
  109.  
  110. # filter spammers from dynamic ips
  111. deny message = "your hostname is bad (adsl, poll, ppp & etc)."
  112. condition = ${if match{$sender_host_name} \
  113. {adsl|dialup|pool|peer|dhcp} \
  114. {yes}{no}}
  115.  
  116. warn
  117. set acl_m0 = 30s
  118. warn
  119. hosts = +relay_from_hosts:4.3.2.1/32:192.168.0.0/16 #disable waits for 'friendly' hosts
  120. set acl_m0 = 0s
  121. warn
  122. logwrite = Delay $acl_m0 for $sender_host_name \
  123. [$sender_host_address] with HELO=$sender_helo_name. Mail \
  124. from $sender_address to $local_part@$domain.
  125. delay = $acl_m0
  126.  
  127.  
  128. accept domains = +local_domains
  129. endpass
  130. message = "No such user"
  131. verify = recipient
  132.  
  133. accept domains = +relay_to_domains
  134. endpass
  135. message = "i don't know how to relay to this address"
  136. verify = recipient
  137.  
  138. # deny message = "you in blacklist - $dnslist_domain \n $dnslist_text"
  139. # dnslists = opm.blitzed.org : \
  140. # cbl.abuseat.org : \
  141. # bl.csma.biz
  142.  
  143. accept hosts = +relay_from_hosts
  144.  
  145. deny message = $sender_fullhost is currently not permitted to \
  146. relay through this server. Perhaps you \
  147. have not logged into the pop/imap server in the \
  148. last 30 minutes or do not have SMTP Authentication turned on in your email client.
  149.  
  150. acl_check_data:
  151.  
  152. # check for viruses
  153. deny malware = *
  154. message = "Your message contains viruses: $malware_name"
  155.  
  156. # if needed - add spam filtering here
  157.  
  158. # permit everything else
  159. accept
  160.  
  161. begin routers
  162.  
  163. dnslookup:
  164. driver = dnslookup
  165. domains = ! +local_domains
  166. transport = remote_smtp
  167. ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
  168. no_more
  169.  
  170. system_aliases:
  171. driver = redirect
  172. allow_fail
  173. allow_defer
  174. data = ${lookup mysql{SELECT `goto` FROM `alias` WHERE \
  175. `address`='${quote_mysql:$local_part@$domain}' OR \
  176. `address`='${quote_mysql:@$domain}'}}
  177.  
  178. dovecot_forward:
  179. driver = redirect
  180. condition = ${lookup mysql{SELECT `goto` FROM \
  181. `alias` WHERE \
  182. `address`='${quote_mysql:$local_part@$domain}' OR \
  183. `address`='${quote_mysql:@$domain}'}{yes}{no}}
  184. user = exim
  185. file = /home/vmail/${domain}/${local_part}/.forward
  186. router_home_directory = /home/vmail/${domain}/${local_part}
  187. pipe_transport = address_pipe
  188.  
  189. dovecot_user:
  190. driver = accept
  191. condition = ${lookup mysql{SELECT `goto` FROM \
  192. `alias` WHERE \
  193. `address`='${quote_mysql:$local_part@$domain}' OR \
  194. `address`='${quote_mysql:@$domain}'}{yes}{no}}
  195. transport = dovecot_delivery
  196.  
  197. localuser:
  198. driver = accept
  199. check_local_user
  200. # local_part_suffix = +* : -*
  201. # local_part_suffix_optional
  202. transport = local_delivery
  203. cannot_route_message = Unknown user
  204.  
  205. begin transports
  206.  
  207. #remote_smtp:
  208. # driver = smtp
  209. # interface = 64.120.134.136
  210.  
  211. remote_smtp:
  212. driver = smtp
  213. interface = 64.120.134.136
  214. dk_private_key = "/etc/exim/domain_keys/private/${dk_domain}"
  215. dk_canon = nofws
  216. dk_selector = default
  217.  
  218. dovecot_delivery:
  219. driver = pipe
  220. command = /usr/libexec/dovecot/deliver -d $local_part@$domain
  221. message_prefix =
  222. message_suffix =
  223. delivery_date_add
  224. envelope_to_add
  225. return_path_add
  226. log_output
  227. user = exim
  228.  
  229. address_pipe:
  230. driver = pipe
  231. return_output
  232.  
  233. address_reply:
  234. driver = autoreply
  235.  
  236. local_delivery:
  237. driver = appendfile
  238. file = /var/mail/$local_part
  239. delivery_date_add
  240. envelope_to_add
  241. return_path_add
  242. group = mail
  243. mode = 0660
  244.  
  245. begin retry
  246.  
  247. * * F,2h,15m; G,16h,1h,1.5; F,4d,6h
  248.  
  249. begin rewrite
  250.  
  251. begin authenticators
  252.  
  253. auth_plain:
  254. driver = plaintext
  255. public_name = PLAIN
  256. server_condition = ${if and { \
  257. {!eq{$auth2}{}} \
  258. {!eq{$auth3}{}} \
  259. { crypteq{$auth3}{\{crypt\}${lookup mysql{SELECT password FROM mailbox WHERE username='${quote_mysql:$auth2}' AND active=1;}{$value}fail}} } \
  260. } {yes}{no}}
  261.  
  262. server_prompts = :
  263. server_set_id = $auth2
  264.  
  265. auth_login:
  266. driver = plaintext
  267. public_name = LOGIN
  268. server_condition = ${if and { \
  269. {!eq{$auth1}{}} \
  270. {!eq{$auth2}{}} \
  271. { crypteq{$auth2}{\{crypt\}${lookup mysql{SELECT password FROM mailbox WHERE username='${quote_mysql:$auth1}' AND active=1;}{$value}fail}} } \
  272. } {yes}{no}}
  273. server_prompts = Username:: : Password::
  274. server_set_id = $auth1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement