Advertisement
Guest User

exim

a guest
Feb 21st, 2019
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.51 KB | None | 0 0
  1. driver = mysql
  2. connect = host=localhost dbname=exim user=exim password=3091610k
  3. default_pass_scheme = CRAM-MD5
  4. password_query = SELECT `username` as `user`, `password` FROM `mailbox` WHERE `username` = '%n@%d' AND `active`='1'
  5. user_query = SELECT 93 AS `uid`, 93 AS `gid` FROM `mailbox` WHERE `username` = '%n@%d' AND `active`='1'
  6.  
  7. same here for exim - install it, backup a default conf and create a new one:
  8.  
  9. yum -y install exim exim-mysql cyrus-sasl
  10. mv /etc/exim/exim.conf /etc/exim/exim.conf-orig
  11. vi /etc/exim/exim.conf
  12.  
  13. primary_hostname = mail.judebm.com
  14.  
  15. hide mysql_servers = localhost/exim/exim/3091610k
  16.  
  17. domainlist local_domains = ${lookup mysql{SELECT `domain` \
  18. FROM `domain` WHERE \
  19. `domain`='${quote_mysql:$domain}' AND \
  20. `active`='1'}}
  21. domainlist relay_to_domains = ${lookup mysql{SELECT `domain` \
  22. FROM `domain` WHERE \
  23. `domain`='${quote_mysql:$domain}' AND \
  24. `active`='1'}}
  25.  
  26. hostlist relay_from_hosts = localhost:127.0.0.0/8:192.168.1.0/24
  27. auth_advertise_hosts = *
  28.  
  29. acl_not_smtp = acl_not_smtp
  30. acl_smtp_rcpt = acl_check_rcpt
  31. acl_smtp_data = acl_check_data
  32.  
  33. qualify_domain = judebm.com
  34. qualify_recipient = judebm.com
  35. allow_domain_literals = true
  36. exim_user = exim
  37. exim_group = exim
  38. never_users = root
  39. rfc1413_query_timeout = 0s
  40.  
  41. sender_unqualified_hosts = +relay_from_hosts
  42. recipient_unqualified_hosts = +relay_from_hosts
  43.  
  44. ignore_bounce_errors_after = 45m
  45. timeout_frozen_after = 15d
  46. helo_accept_junk_hosts = 192.168.1.0/24
  47. auto_thaw = 1h
  48. smtp_banner = "$primary_hostname, ESMTP EXIM $version_number"
  49. smtp_accept_max = 50
  50. smtp_accept_max_per_connection = 25
  51. smtp_connect_backlog = 30
  52. smtp_accept_max_per_host = 20
  53. split_spool_directory = true
  54. remote_max_parallel = 15
  55. return_size_limit = 70k
  56. message_size_limit = 64M
  57. helo_allow_chars = _
  58. smtp_enforce_sync = true
  59.  
  60. log_selector = \
  61. +all_parents \
  62. +connection_reject \
  63. +incoming_interface \
  64. +lost_incoming_connection \
  65. +received_sender \
  66. +received_recipients \
  67. +smtp_confirmation \
  68. +smtp_syntax_error \
  69. +smtp_protocol_error \
  70. -queue_run
  71.  
  72. syslog_timestamp = no
  73.  
  74. begin acl
  75.  
  76. acl_not_smtp:
  77. deny message = Sender rate overlimit - $sender_rate / $sender_rate_period
  78. ratelimit = 50 / 1h / strict
  79. accept
  80.  
  81. acl_check_rcpt:
  82. deny message = "Lookup failed"
  83. condition = ${if eq{$host_lookup_failed}{1}}
  84.  
  85. accept hosts = :
  86. deny message = "incorrect symbol in address"
  87. domains = +local_domains
  88. local_parts = ^[.] : ^.*[@%!/|]
  89.  
  90. deny message = "incorrect symbol in address"
  91. domains = !+local_domains
  92. local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
  93.  
  94. accept local_parts = postmaster
  95. domains = +local_domains
  96.  
  97. deny message = "HELO/EHLO required by SMTP RFC"
  98. condition = ${if eq{$sender_helo_name}{}{yes}{no}}
  99.  
  100. accept authenticated = *
  101.  
  102. deny condition = ${if eq{$sender_helo_name}\
  103. {$interface_address}{yes}{no}}
  104. hosts = !127.0.0.1 : !localhost : *
  105. message = "My IP in your HELO! Access denied!"
  106.  
  107. deny condition = ${if match{$sender_helo_name}\
  108. {\N^\d+$\N}{yes}{no}}
  109. hosts = !127.0.0.1 : !localhost : *
  110. message = "Incorrect HELO string"
  111.  
  112. warn
  113. set acl_m0 = 30s
  114. warn
  115. hosts = +relay_from_hosts:4.3.2.1/32:192.168.1.0/24 #disable waits for 'friendly' hosts
  116. set acl_m0 = 0s
  117. warn
  118. logwrite = Delay $acl_m0 for $sender_host_name \
  119. [$sender_host_address] with HELO=$sender_helo_name. Mail \
  120. from $sender_address to $local_part@$domain.
  121. delay = $acl_m0
  122.  
  123. accept domains = +local_domains
  124. endpass
  125. message = "No such user"
  126. verify = recipient
  127.  
  128. accept domains = +relay_to_domains
  129. endpass
  130. message = "i don't know how to relay to this address"
  131. verify = recipient
  132.  
  133. deny message = "you in blacklist - $dnslist_domain \n $dnslist_text"
  134. dnslists = opm.blitzed.org : \
  135. cbl.abuseat.org : \
  136. bl.csma.biz
  137.  
  138. accept hosts = +relay_from_hosts
  139.  
  140. deny message = "Homo hominus lupus est"
  141.  
  142. acl_check_data:
  143.  
  144. deny malware = */defer_ok
  145. message = "Your message contains viruses: $malware_name"
  146.  
  147. accept
  148.  
  149. begin routers
  150.  
  151. dnslookup:
  152. driver = dnslookup
  153. domains = ! +local_domains
  154. transport = remote_smtp
  155. ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
  156. no_more
  157.  
  158. system_aliases:
  159. driver = redirect
  160. allow_fail
  161. allow_defer
  162. data = ${lookup mysql{SELECT `goto` FROM `alias` WHERE \
  163. `address`='${quote_mysql:$local_part@$domain}' OR \
  164. `address`='${quote_mysql:@$domain}'}}
  165.  
  166. dovecot_user:
  167. driver = accept
  168. condition = ${lookup mysql{SELECT `goto` FROM \
  169. `alias` WHERE \
  170. `address`='${quote_mysql:$local_part@$domain}' OR \
  171. `address`='${quote_mysql:@$domain}'}{yes}{no}}
  172. transport = dovecot_delivery
  173.  
  174.  
  175. begin transports
  176.  
  177. remote_smtp:
  178. driver = smtp
  179.  
  180. dovecot_delivery:
  181. driver = pipe
  182. command = /usr/libexec/dovecot/deliver -d $local_part@$domain
  183. message_prefix =
  184. message_suffix =
  185. delivery_date_add
  186. envelope_to_add
  187. return_path_add
  188. log_output
  189. user = exim
  190.  
  191. address_pipe:
  192. driver = pipe
  193. return_output
  194.  
  195. address_reply:
  196. driver = autoreply
  197.  
  198. begin retry
  199.  
  200. * * F,2h,15m; G,16h,1h,1.5; F,4d,6h
  201.  
  202. begin rewrite
  203.  
  204. begin authenticators
  205.  
  206. auth_plain:
  207. driver = dovecot
  208. public_name = PLAIN
  209. server_socket = /var/run/dovecot/auth-client
  210. server_set_id = $auth1
  211.  
  212. auth_login:
  213. driver = dovecot
  214. public_name = LOGIN
  215. server_socket = /var/run/dovecot/auth-client
  216. server_set_id = $auth1
  217.  
  218. auth_cram_md5:
  219. driver = dovecot
  220. public_name = CRAM-MD5
  221. server_socket = /var/run/dovecot/auth-client
  222. server_set_id = $auth1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement