Advertisement
Guest User

Untitled

a guest
Dec 24th, 2013
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 64.54 KB | None | 0 0
  1. #!!# cPanel Exim 4 Config
  2.  
  3.  
  4. hostlist loopback = <; 127.0.0.0/8 ; 0.0.0.0 ; ::1 ; 0000:0000:0000:0000:0000:ffff:7f00:0000/8
  5.  
  6. hostlist senderverifybypass_hosts = net-iplsearch;/etc/senderverifybypasshosts
  7.  
  8. hostlist skipsmtpcheck_hosts = net-iplsearch;/etc/skipsmtpcheckhosts
  9.  
  10. hostlist spammeripblocks = net-iplsearch;/etc/spammeripblocks
  11.  
  12. hostlist backupmx_hosts = lsearch;/etc/backupmxhosts
  13.  
  14. hostlist trustedmailhosts = lsearch;/etc/trustedmailhosts
  15.  
  16. hostlist relay_hosts = net-iplsearch;/etc/relayhosts
  17.  
  18. domainlist user_domains = ${if exists{/etc/userdomains} {lsearch;/etc/userdomains} fail}
  19.  
  20. smtp_accept_queue_per_connection = 30
  21.  
  22. remote_max_parallel = 10
  23.  
  24. smtp_receive_timeout = 165s
  25.  
  26. ignore_bounce_errors_after = 1d
  27.  
  28. rfc1413_query_timeout = 0s
  29.  
  30. timeout_frozen_after = 5d
  31.  
  32. auto_thaw = 7d
  33.  
  34. callout_domain_negative_expire = 1h
  35.  
  36. callout_negative_expire = 1h
  37.  
  38. acl_not_smtp = acl_not_smtp
  39.  
  40. acl_smtp_connect = acl_smtp_connect
  41.  
  42. acl_smtp_data = acl_smtp_data
  43.  
  44. acl_smtp_mail = acl_smtp_mail
  45.  
  46. acl_smtp_quit = acl_smtp_quit    
  47.  
  48. acl_smtp_notquit = acl_smtp_notquit
  49.  
  50. acl_smtp_rcpt = acl_smtp_rcpt
  51.  
  52. acl_smtp_dkim = acl_smtp_dkim
  53.  
  54. message_body_newlines = true
  55.  
  56. deliver_queue_load_max = 6
  57.  
  58. queue_only_load = 12
  59.  
  60. daemon_smtp_ports = 25 : 465 : 587
  61.  
  62. tls_on_connect_ports = 465
  63.  
  64. system_filter_user = cpaneleximfilter
  65.  
  66. system_filter_group = cpaneleximfilter
  67.  
  68. tls_require_ciphers = ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP
  69.  
  70. spamd_address = 127.0.0.1 783
  71.  
  72. # +incoming_port, +smtp_connection are needed for cPanel email tracking.
  73. # -retry_defer, +subject, +arguments, +received_recipients are suggested settings that may be disabled.
  74. log_selector = +incoming_port +smtp_connection -retry_defer +subject +arguments +received_recipients
  75.  
  76.  
  77. system_filter = /etc/cpanel_exim_system_filter
  78.  
  79.  
  80.  
  81.  
  82. #!!# These options specify the Access Control Lists (ACLs) that
  83. #!!# are used for incoming SMTP messages - after the RCPT and DATA
  84. #!!# commands, respectively.
  85.  
  86.  
  87. #!!# This setting defines a named domain list called
  88. #!!# local_domains, created from the old options that
  89. #!!# referred to local domains. It will be referenced
  90. #!!# later on by the syntax "+local_domains".
  91. #!!# Other domain and host lists may follow.
  92.  
  93. domainlist local_domains = lsearch;/etc/localdomains
  94. domainlist outside_jail_domains = lsearch;/etc/outside_jail_domains
  95.  
  96. domainlist relay_domains = lsearch;/etc/localdomains : \
  97.     lsearch;/etc/secondarymx
  98. hostlist auth_relay_hosts = *
  99.  
  100. ######################################################################
  101. #                  Runtime configuration file for Exim               #
  102. ######################################################################
  103.  
  104.  
  105. # This is a default configuration file which will operate correctly in
  106. # uncomplicated installations. Please see the manual for a complete list
  107. # of all the runtime configuration options that can be included in a
  108. # configuration file. There are many more than are mentioned here. The
  109. # manual is in the file doc/spec.txt in the Exim distribution as a plain
  110. # ASCII file. Other formats (PostScript, Texinfo, HTML) are available from
  111. # the Exim ftp sites. The manual is also online via the Exim web sites.
  112.  
  113.  
  114. # This file is divided into several parts, all but the last of which are
  115. # terminated by a line containing the word "end". The parts must appear
  116. # in the correct order, and all must be present (even if some of them are
  117. # in fact empty). Blank lines, and lines starting with # are ignored.
  118.  
  119.  
  120.  
  121. ######################################################################
  122. #                    MAIN CONFIGURATION SETTINGS                     #
  123. ######################################################################
  124.  
  125. perl_startup = do '/etc/exim.pl'
  126.  
  127. #dns_retry = 1
  128. #dns_retrans = 1s
  129.  
  130. # Specify your host's canonical name here. This should normally be the fully
  131. # qualified "official" name of your host. If this option is not set, the
  132. # uname() function is called to obtain the name.
  133.  
  134. smtp_banner = "${primary_hostname} ESMTP Exim ${version_number} \
  135. \#${compile_number} ${tod_full} \n\
  136.  We do not authorize the use of this system to transport unsolicited, \n\
  137.  and/or bulk e-mail."
  138.  
  139.  
  140. #nobody as the sender seems to annoy people
  141. untrusted_set_sender = *
  142. local_from_check = false
  143.  
  144.  
  145.  
  146. split_spool_directory = yes
  147.  
  148. smtp_connect_backlog = 50
  149. smtp_accept_max = 100
  150.  
  151. # primary_hostname =
  152.  
  153. # Specify the domain you want to be added to all unqualified addresses
  154. # here. An unqualified address is one that does not contain an "@" character
  155. # followed by a domain. For example, "caesar@rome.ex" is a fully qualified
  156. # address, but the string "caesar" (i.e. just a login name) is an unqualified
  157. # email address. Unqualified addresses are accepted only from local callers by
  158. # default. See the receiver_unqualified_{hosts,nets} options if you want
  159. # to permit unqualified addresses from remote sources. If this option is
  160. # not set, the primary_hostname value is used for qualification.
  161.  
  162. # qualify_domain =
  163.  
  164.  
  165. # If you want unqualified recipient addresses to be qualified with a different
  166. # domain to unqualified sender addresses, specify the recipient domain here.
  167. # If this option is not set, the qualify_domain value is used.
  168.  
  169. # qualify_recipient =
  170.  
  171.  
  172. # Specify your local domains as a colon-separated list here. If this option
  173. # is not set (i.e. not mentioned in the configuration file), the
  174. # qualify_recipient value is used as the only local domain. If you do not want
  175. # to do any local deliveries, uncomment the following line, but do not supply
  176. # any data for it. This sets local_domains to an empty string, which is not
  177. # the same as not mentioning it at all. An empty string specifies that there
  178. # are no local domains; not setting it at all causes the default value (the
  179. # setting of qualify_recipient) to be used.
  180.  
  181.  
  182.  
  183. #!!# message_filter renamed system_filter
  184. message_body_visible = 5000
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191. # If you want to accept mail addressed to your host's literal IP address, for
  192. # example, mail addressed to "user@[111.111.111.111]", then uncomment the
  193. # following line, or supply the literal domain(s) as part of "local_domains"
  194. # above.
  195.  
  196. # local_domains_include_host_literals
  197.  
  198.  
  199. # No local deliveries will ever be run under the uids of these users (a colon-
  200. # separated list). An attempt to do so gets changed so that it runs under the
  201. # uid of "nobody" instead. This is a paranoic safety catch. Note the default
  202. # setting means you cannot deliver mail addressed to root as if it were a
  203. # normal user. This isn't usually a problem, as most sites have an alias for
  204. # root that redirects such mail to a human administrator.
  205.  
  206. never_users = root
  207.  
  208.  
  209. # The use of your host as a mail relay by any host, including the local host
  210. # calling its own SMTP port, is locked out by default. If you want to permit
  211. # relaying from the local host, you should set
  212. #
  213. # host_accept_relay = localhost
  214. #
  215. # If you want to permit relaying through your host from certain hosts or IP
  216. # networks, you need to set the option appropriately, for example
  217. #
  218. #
  219. #
  220. # If you are an MX backup or gateway of some kind for some domains, you must
  221. # set relay_domains to match those domains. This will allow any host to
  222. # relay through your host to those domains.
  223. #
  224. # See the section of the manual entitled "Control of relaying" for more
  225. # information.
  226.  
  227. # The setting below causes Exim to do a reverse DNS lookup on all incoming
  228. # IP calls, in order to get the true host name. If you feel this is too
  229. # expensive, you can specify the networks for which a lookup is done, or
  230. # remove the setting entirely.
  231.  
  232. #host_lookup = 0.0.0.0/0
  233.  
  234.  
  235. # By default, Exim expects all envelope addresses to be fully qualified, that
  236. # is, they must contain both a local part and a domain. If you want to accept
  237. # unqualified addresses (just a local part) from certain hosts, you can specify
  238. # these hosts by setting one or both of
  239. #
  240. # receiver_unqualified_hosts =
  241. # sender_unqualified_hosts =
  242. #
  243. # to control sender and receiver addresses, respectively. When this is done,
  244. # unqualified addresses are qualified using the settings of qualify_domain
  245. # and/or qualify_recipient (see above).
  246.  
  247.  
  248. # Exim contains support for the Realtime Blocking List (RBL) that is being
  249. # maintained as part of the DNS. See http://maps.vix.com/rbl/ for background.
  250. # Uncommenting the first line below will make Exim reject mail from any
  251. # host whose IP address is blacklisted in the RBL at maps.vix.com. Some
  252. # others have followed the RBL lead and have produced other lists: DUL is
  253. # a list of dial-up addresses, and ORBS is a list of open relay systems. The
  254. # second line below checks all three lists.
  255.  
  256. # rbl_domains = rbl.maps.vix.com
  257. # rbl_domains = rbl.maps.vix.com
  258.  
  259.  
  260. # If you want Exim to support the "percent hack" for all your local domains,
  261. # uncomment the following line. This is the feature by which mail addressed
  262. # to x%y@z (where z is one of your local domains) is locally rerouted to
  263. # x@y and sent on. Otherwise x%y is treated as an ordinary local part.
  264.  
  265. # percent_hack_domains = *
  266.  
  267. #sender_host_accept = +include_unknown:*
  268. #sender_host_reject = +include_unknown:lsearch*;/etc/spammers
  269.  
  270.  
  271.  
  272.  
  273.  
  274. tls_certificate = /etc/exim.crt
  275. tls_privatekey = /etc/exim.key
  276. tls_advertise_hosts = *
  277.  
  278. helo_accept_junk_hosts = *
  279.  
  280. smtp_enforce_sync = false
  281.  
  282.  
  283. #!!#######################################################!!#
  284. #!!# This new section of the configuration contains ACLs #!!#
  285. #!!# (Access Control Lists) derived from the Exim 3      #!!#
  286. #!!# policy control options.                             #!!#
  287. #!!#######################################################!!#
  288.  
  289. #!!# These ACLs are crudely constructed from Exim 3 options.
  290. #!!# They are almost certainly not optimal. You should study
  291. #!!# them and rewrite as necessary.
  292.  
  293. begin acl
  294.  
  295.  
  296.  
  297. ########################################################################################
  298. # DO NOT ALTER THIS BLOCK
  299. ########################################################################################
  300. #
  301. # cPanel Default ACL Template Version: 10.34
  302. # Template: universal.dist
  303. #
  304. ########################################################################################
  305. # DO NOT ALTER THIS BLOCK
  306. ########################################################################################
  307.  
  308. acl_not_smtp:
  309.  
  310. #BEGIN ACL_OUTGOING_NOTSMTP_CHECKALL_BLOCK
  311. # BEGIN INSERT resolve_vhost_owner
  312. warn
  313.         condition   = ${if eq{$originator_uid}{${perl{user2uid}{nobody}}}{1}{0}}
  314.         set acl_c_vhost_owner = ${perl{resolve_vhost_owner}}
  315.  
  316. # END INSERT resolve_vhost_owner
  317. # BEGIN INSERT end_default_outgoing_notsmtp_checkall
  318.     accept
  319.  
  320. # END INSERT end_default_outgoing_notsmtp_checkall
  321.  
  322. #END ACL_OUTGOING_NOTSMTP_CHECKALL_BLOCK
  323.  
  324. #BEGIN ACL_NOT_SMTP_BLOCK
  325.  
  326. #END ACL_NOT_SMTP_BLOCK
  327.  
  328. acl_not_smtp_mime:
  329.  
  330. #BEGIN ACL_NOT_SMTP_MIME_BLOCK
  331.  
  332. #END ACL_NOT_SMTP_MIME_BLOCK
  333.  
  334. acl_not_smtp_start:
  335.  
  336. #BEGIN ACL_NOT_SMTP_START_BLOCK
  337.  
  338. #END ACL_NOT_SMTP_START_BLOCK
  339.  
  340. acl_smtp_auth:
  341.  
  342. #BEGIN ACL_SMTP_AUTH_BLOCK
  343.  
  344. #END ACL_SMTP_AUTH_BLOCK
  345.  
  346. acl_smtp_connect:
  347.  
  348. #BEGIN ACL_CONNECT_BLOCK
  349. # BEGIN INSERT ratelimit
  350.  
  351.     accept
  352.         hosts = +trustedmailhosts
  353.  
  354.     accept
  355.         condition = ${if match_ip{$sender_host_address}{iplsearch;/etc/trustedmailhosts}{1}{0}}
  356.  
  357.  
  358. # ignore pop before smtp
  359.     accept
  360.         hosts = +relay_hosts : +loopback
  361.  
  362.     accept
  363.         hosts = +relay_hosts : +backupmx_hosts
  364.  
  365. #only rate limit port 25
  366.     accept
  367.         condition = ${if eq {$interface_port}{25}{no}{yes}}
  368.  
  369.     defer
  370.         message = The server has reached its limit for processing requests from your host.  Please try again later.
  371.         log_message = "Host is ratelimited ($sender_rate/$sender_rate_period max:$sender_rate_limit)"
  372.         ratelimit = 1.2 / 1h / strict / per_conn / noupdate
  373.  
  374.  
  375. # END INSERT ratelimit
  376. # BEGIN INSERT slow_fail_block
  377.    warn
  378.         # host had a success in the last hour
  379.         ratelimit = 1 / 1h / noupdate / per_conn / slow_fail_accept_$sender_host_address
  380.         set acl_m4 = 1
  381.  
  382.    defer
  383.         condition = ${if eq {${acl_m4}}{1}{0}{1}}
  384.         log_message = "Host is ratelimited due to multiple failure only connections ($sender_rate/$sender_rate_period max:$sender_rate_limit)"
  385.         ratelimit = 5 / 1h / noupdate / per_conn / slow_fail_block_$sender_host_address
  386.  
  387.  
  388. # END INSERT slow_fail_block
  389. # BEGIN INSERT spammerlist
  390.  
  391.  
  392. drop
  393.     message = Your host is not allowed to connect to this server.
  394.     log_message = Host is banned
  395.     hosts = +spammeripblocks
  396.  
  397.  
  398. # END INSERT spammerlist
  399.  
  400. #END ACL_CONNECT_BLOCK
  401.  
  402. #BEGIN ACL_CONNECT_POST_BLOCK
  403. # BEGIN INSERT default_connect_post
  404.  
  405. # do not change the comment in the line below, it is required for /usr/local/cpanel/bin/check_exim_config
  406. #acl_smtp_notquit is required for this to work (exim 4.68)
  407.     accept
  408.  
  409.  
  410. # END INSERT default_connect_post
  411.  
  412. #END ACL_CONNECT_POST_BLOCK
  413.  
  414. acl_smtp_data:
  415.  
  416. # exiscan only
  417.  
  418. # exiscan only
  419.  
  420. #BEGIN ACL_OUTGOING_SMTP_CHECKALL_BLOCK
  421.  
  422. #END ACL_OUTGOING_SMTP_CHECKALL_BLOCK
  423.  
  424. #BEGIN ACL_CHECK_MESSAGE_PRE_BLOCK
  425. # BEGIN INSERT default_check_message_pre
  426. #
  427. #  Enabling this will make the server non-rfc compliant
  428. #  require verify = header_sender
  429. #
  430.  
  431.     accept  hosts = +loopback : +relay_hosts
  432.  
  433.     accept  hosts = *
  434.             authenticated = *
  435.  
  436.     accept  hosts = +trustedmailhosts
  437.  
  438.     accept
  439.             condition = ${if match_ip{$sender_host_address}{iplsearch;/etc/trustedmailhosts}{1}{0}}
  440.  
  441.  
  442.  
  443. # END INSERT default_check_message_pre
  444.  
  445. #END ACL_CHECK_MESSAGE_PRE_BLOCK
  446.  
  447. #BEGIN ACL_PRE_SPAM_SCAN
  448. # BEGIN INSERT mailproviders
  449. # Research in Motion - Blackberry white list
  450.  accept
  451.      condition = ${if exists {/etc/mailproviders/rim/ips}{${if match_ip{$sender_host_address}{iplsearch;/etc/mailproviders/rim/ips}{1}{0}}}{0}}
  452.  
  453. # END INSERT mailproviders
  454.  
  455. #END ACL_PRE_SPAM_SCAN
  456.  
  457. #BEGIN ACL_SPAM_SCAN_BLOCK
  458. # BEGIN INSERT default_spam_scan
  459.  
  460.  
  461.   warn
  462.     condition = ${if eq {${acl_m0}}{1}{1}{0}}
  463.     spam =  ${acl_m1}/defer_ok
  464.     log_message = "SpamAssassin as ${acl_m1} detected message as spam ($spam_score)"
  465.     add_header = X-Spam-Subject: ***SPAM*** $h_subject
  466.     add_header = X-Spam-Status: Yes, score=$spam_score
  467.     add_header = X-Spam-Score: $spam_score_int
  468.     add_header = X-Spam-Bar: $spam_bar
  469.     add_header = X-Spam-Report: $spam_report
  470.     add_header = X-Spam-Flag: YES
  471.     set acl_m2 = 1
  472.  
  473.   warn
  474.       condition =  ${if eq {$spam_score_int}{}{0}{${if <= {${spam_score_int}}{8000}{${if >= {${spam_score_int}}{50}{${perl{store_spam}{$sender_host_address}{$spam_score}}}{0}}}{0}}}}
  475.  
  476.   warn
  477.   condition = ${if eq {${acl_m0}}{1}{${if eq {${acl_m2}}{1}{0}{1}}}{0}}
  478.   add_header = X-Spam-Status: No, score=$spam_score
  479.   add_header = X-Spam-Score: $spam_score_int
  480.   add_header = X-Spam-Bar: $spam_bar
  481.   add_header = X-Ham-Report: $spam_report
  482.   add_header = X-Spam-Flag: NO
  483.   log_message = "SpamAssassin as ${acl_m1} detected message as NOT spam ($spam_score)"
  484.  
  485.  
  486.  
  487. # END INSERT default_spam_scan
  488.  
  489. #END ACL_SPAM_SCAN_BLOCK
  490.  
  491. # exiscan only
  492.  
  493. # exiscan only
  494.  
  495. #BEGIN ACL_RATELIMIT_SPAM_BLOCK
  496.  
  497. #END ACL_RATELIMIT_SPAM_BLOCK
  498.  
  499. #BEGIN ACL_SPAM_BLOCK
  500.  
  501. #END ACL_SPAM_BLOCK
  502.  
  503. #BEGIN ACL_CHECK_MESSAGE_POST_BLOCK
  504. # BEGIN INSERT default_check_message_post
  505.  
  506.  accept
  507.  
  508. # END INSERT default_check_message_post
  509.  
  510. #END ACL_CHECK_MESSAGE_POST_BLOCK
  511.  
  512. acl_smtp_etrn:
  513.  
  514. #BEGIN ACL_SMTP_ETRN_BLOCK
  515.  
  516. #END ACL_SMTP_ETRN_BLOCK
  517.  
  518. acl_smtp_helo:
  519.  
  520. #BEGIN ACL_SMTP_HELO_BLOCK
  521.  
  522. #END ACL_SMTP_HELO_BLOCK
  523.  
  524. acl_smtp_mail:
  525.  
  526. #BEGIN ACL_MAIL_PRE_BLOCK
  527. # BEGIN INSERT default_mail_pre
  528.  
  529.     # ignore authenticated hosts
  530.     accept
  531.         authenticated = *
  532.  
  533.     warn
  534.         condition = ${if match_ip{$sender_host_address}{+loopback}{${perl{identify_local_connection}{$sender_host_address}{$sender_host_port}{$received_ip_address}{$received_port}{1}}}{0}}
  535.         set acl_c_authenticated_local_user = ${perl{get_identified_local_connection_user}}
  536.  
  537.     # ignore pop before smtp
  538.     accept
  539.         hosts = +loopback : +relay_hosts
  540.  
  541.  
  542.  
  543. # END INSERT default_mail_pre
  544.  
  545. #END ACL_MAIL_PRE_BLOCK
  546.  
  547. #BEGIN ACL_MAIL_BLOCK
  548. # BEGIN INSERT requirehelo
  549.  
  550. deny
  551.     condition = ${if eq{$sender_helo_name}{}}
  552.     message   = HELO required before MAIL
  553.  
  554.  
  555. # END INSERT requirehelo
  556. # BEGIN INSERT requirehelonoforge
  557.  
  558.  
  559. drop  
  560.     # if ($sender_helo_name eq $primary_hostname) {
  561.     #      if (defined $sender_host_address) {
  562.     #           return is_loopback($sender_host_address) ? 0 : 1;  #ok from localhost
  563.     #      } else {
  564.     #            return 0; #exim -bs
  565.     #      }
  566.     # } else {
  567.     #      return 0;
  568.     # }
  569.     condition = ${if eq{${lc:$sender_helo_name}}{${lc:$primary_hostname}}{${if def:sender_host_address {${if match_ip{$sender_host_address}{+loopback}{0}{1}}}{0}}}{0}}
  570.     message   = "REJECTED - Bad HELO - Host impersonating [$sender_helo_name]"
  571.  
  572.  
  573. drop
  574.     condition = ${if eq{[$interface_address]}{$sender_helo_name}}
  575.     message   = "REJECTED - Interface: $interface_address is _my_ address"
  576.  
  577. # END INSERT requirehelonoforge
  578. # BEGIN INSERT requirehelosyntax
  579.  
  580. drop
  581.     condition   = ${if isip{$sender_helo_name}}
  582.     message     = Access denied - Invalid HELO name (See RFC2821 4.1.3)
  583.  
  584. drop
  585.     # Required because "[IPv6:<address>]" will have no .s
  586.     condition   = ${if match{$sender_helo_name}{\N^\[\N}{no}{yes}}
  587.     condition   = ${if match{$sender_helo_name}{\N\.\N}{no}{yes}}
  588.     message     = Access denied - Invalid HELO name (See RFC2821 4.1.1.1)
  589.  
  590. drop
  591.     condition   = ${if match{$sender_helo_name}{\N\.$\N}}
  592.     message     = Access denied - Invalid HELO name (See RFC2821 4.1.1.1)
  593.    
  594. drop
  595.     condition   = ${if match{$sender_helo_name}{\N\.\.\N}}
  596.     message     = Access denied - Invalid HELO name (See RFC2821 4.1.1.1)
  597.  
  598. # END INSERT requirehelosyntax
  599.  
  600. #END ACL_MAIL_BLOCK
  601.  
  602. #BEGIN ACL_MAIL_POST_BLOCK
  603. # BEGIN INSERT default_mail_post
  604.  
  605.     accept
  606.  
  607.  
  608. # END INSERT default_mail_post
  609.  
  610. #END ACL_MAIL_POST_BLOCK
  611.  
  612. acl_smtp_mailauth:
  613.  
  614. #BEGIN ACL_SMTP_MAILAUTH_BLOCK
  615.  
  616. #END ACL_SMTP_MAILAUTH_BLOCK
  617.  
  618. acl_smtp_mime:
  619.  
  620. #BEGIN ACL_SMTP_MIME_BLOCK
  621.  
  622. #END ACL_SMTP_MIME_BLOCK
  623.  
  624. acl_smtp_notquit:
  625.  
  626. #BEGIN ACL_NOTQUIT_BLOCK
  627. # BEGIN INSERT ratelimit
  628.  
  629. # ignore authenticated hosts
  630. accept authenticated = *
  631.  
  632. # ignore pop before smtp
  633. accept hosts = +relay_hosts : +loopback
  634.  
  635. #only rate limit port 25
  636. accept condition = ${if eq {$interface_port}{25}{no}{yes}}
  637.  
  638. warn condition = ${if match {$smtp_notquit_reason}{command}{yes}{no}}
  639.     log_message = "Connection Ratelimit - $sender_fullhost because of notquit: $smtp_notquit_reason ($sender_rate/$sender_rate_period max:$sender_rate_limit)"    
  640.     ratelimit = 1.2 / 1h / strict / per_conn
  641.  
  642.  
  643. # END INSERT ratelimit
  644.  
  645. #END ACL_NOTQUIT_BLOCK
  646.  
  647. acl_smtp_predata:
  648.  
  649. #BEGIN ACL_SMTP_PREDATA_BLOCK
  650.  
  651. #END ACL_SMTP_PREDATA_BLOCK
  652.  
  653. acl_smtp_quit:
  654.  
  655. #BEGIN ACL_SMTP_QUIT_BLOCK
  656. # BEGIN INSERT slow_fail_block
  657.  
  658.   warn
  659.     log_message = "Detected session with all messages failed"
  660.     condition = ${if >= {${eval:$rcpt_count}}{1}{${if == {${eval:$rcpt_fail_count}}{${eval:$rcpt_count}}{yes}{no}}}{no}}
  661.     set acl_m6 = 1
  662.  
  663.   warn
  664.     condition = ${if eq {${acl_m6}}{1}{1}{0}}
  665.     ratelimit = 0 / 1h / strict / per_conn / slow_fail_block_$sender_host_address
  666.     log_message = "Increment slow_fail_block Ratelimit - $sender_fullhost because of all messages failed"
  667.  
  668.   warn
  669.     ratelimit = 1 / 1h / noupdate / per_conn / slow_fail_block_$sender_host_address
  670.     condition = ${if >= {${eval:$rcpt_count}}{1}{${if < {${eval:$rcpt_fail_count}}{${eval:$rcpt_count}}{yes}{no}}}{no}}
  671.     set acl_m5 = 1
  672.     log_message = "Detected session with ok message that previous had all failed"
  673.  
  674.   warn
  675.     condition = ${if eq {${acl_m5}}{1}{1}{0}}
  676.     ratelimit = 0 / 1h / strict / per_conn / slow_fail_accept_$sender_host_address
  677.     log_message = "Decrement slow_fail_lock Ratelimit - $sender_fullhost because one message was successful"
  678.  
  679.  
  680.  
  681. # END INSERT slow_fail_block
  682.  
  683. #END ACL_SMTP_QUIT_BLOCK
  684.  
  685. acl_smtp_rcpt:
  686.  
  687. #BEGIN ACL_RATELIMIT_BLOCK
  688.  
  689. #END ACL_RATELIMIT_BLOCK
  690.  
  691. #BEGIN ACL_PRE_RECIPIENT_BLOCK
  692.  
  693. #END ACL_PRE_RECIPIENT_BLOCK
  694.  
  695. #BEGIN ACL_RECIPIENT_BLOCK
  696. # BEGIN INSERT default_recipient
  697.   accept  hosts = :
  698.  
  699.   accept hosts = +skipsmtpcheck_hosts
  700.  
  701.  
  702.  
  703. # END INSERT default_recipient
  704.  
  705. #END ACL_RECIPIENT_BLOCK
  706. #mailman only
  707.  
  708. #BEGIN ACL_RECIPIENT_MAILMAN_BLOCK
  709. # BEGIN INSERT default_recipient_mailman
  710.  
  711.  # Accept bounces to lists even if callbacks or other checks would fail
  712.   warn     message      = X-WhitelistedRCPT-nohdrfromcallback: Yes
  713.            condition    = \
  714.            ${if and {{match{$local_part}{(.*)-bounces\+.*}} \
  715.                      {exists {/usr/local/cpanel/3rdparty/mailman/lists/${lc:$1}/config.pck}}} \
  716.                 {yes}{no}}
  717.  
  718.   accept   condition    = \
  719.            ${if and {{match{$local_part}{(.*)-bounces\+.*}} \
  720.                      {exists {/usr/local/cpanel/3rdparty/mailman/lists/${lc:$1}/config.pck}}} \
  721.                 {yes}{no}}
  722.  
  723.  
  724.   # Accept bounces to lists even if callbacks or other checks would fail
  725.   warn     message      = X-WhitelistedRCPT-nohdrfromcallback: Yes
  726.            condition    = \
  727.            ${if and {{match{$local_part}{(.*)-bounces\+.*}} \
  728.                      {exists {/usr/local/cpanel/3rdparty/mailman/lists/${lc:$1}_${lc:$domain}/config.pck}}} \
  729.                 {yes}{no}}
  730.  
  731.   accept   condition    = \
  732.            ${if and {{match{$local_part}{(.*)-bounces\+.*}} \
  733.                      {exists {/usr/local/cpanel/3rdparty/mailman/lists/${lc:$1}_${lc:$domain}/config.pck}}} \
  734.                 {yes}{no}}
  735.  
  736.   #if it gets here it isn't mailman
  737.  
  738.  
  739. # END INSERT default_recipient_mailman
  740.  
  741. #END ACL_RECIPIENT_MAILMAN_BLOCK
  742. #mailman only
  743.  
  744. #BEGIN ACL_IDENTIFY_SENDER_BLOCK
  745. # BEGIN INSERT default_identify_sender
  746.  
  747. # deny must be on the same line as hosts so it will get removed by buildeximconf if turned off
  748.    deny  hosts = ! +senderverifybypass_hosts
  749.         ! verify = sender
  750.  
  751.   accept  hosts = *
  752.           authenticated = *
  753.  
  754.   # if they used "pop before smtp" and its not bound for a localdomain we remember the relayhosts_domain
  755.   warn  hosts = +relay_hosts
  756.         domains = ! +local_domains
  757.         set acl_c_relayhosts_text_entry = ${perl{get_relayhosts_text_entry}{1}}
  758.         add_header = ${if exists{/etc/eximpopbeforesmtpwarning}{${perl{popbeforesmtpwarn}{$sender_host_address}}{}}
  759.  
  760.   # if they used "pop before smtp" then we just accept
  761.   accept  hosts = +relay_hosts
  762.  
  763.   # we need to check alwaysrelay since we don't require antirelayd to be enabled
  764.   warn
  765.     condition = ${if eq {$acl_c_relayhosts_text_entry}{}{${if exists {/etc/alwaysrelay}{${lookup{$sender_host_address}iplsearch{/etc/alwaysrelay}{1}{0}}}{0}}}{0}}
  766.     set acl_c_relayhosts_text_entry = ${perl{get_relayhosts_text_entry}{1}}
  767.     set acl_c_alwaysrelay = 1
  768.  
  769.   accept
  770.     condition = $acl_c_alwaysrelay
  771.  
  772.   #recipient verifications are now done after smtp auth and pop before smtp so the users get back bounces instead of
  773.   # a clogged outbox in outlook
  774.  
  775.    # If we skipped identifying the sender in acl_smtp_mail (ie !def:acl_c_authenticated_local_user)
  776.    # We need to do it here before we can test the two drops
  777.    warn
  778.        condition = ${if def:acl_c_authenticated_local_user {0}{${if match_ip{$sender_host_address}{+loopback}{${perl{identify_local_connection}{$sender_host_address}{$sender_host_port}{$received_ip_address}{$received_port}{1}}}{0}}}}
  779.        set acl_c_authenticated_local_user = ${perl{get_identified_local_connection_user}}
  780.  
  781.   # drop connections to localhost that are from demo accounts (required for manual connections)
  782.   drop
  783.        condition = ${if and {{match_ip{$sender_host_address}{+loopback}} \
  784.                              {def:acl_c_authenticated_local_user}} \
  785.                       {${lookup{$acl_c_authenticated_local_user}lsearch{/etc/demousers}{yes}{no}}}{no}}
  786.        message   = Demo accounts may not send mail
  787.  
  788.   # drop connections to localhost that fail auth (required for Horde)
  789.   drop
  790.        condition = ${if and {{match_ip{$sender_host_address}{+loopback}} \
  791.                              {def:authentication_failed}} \
  792.                       {$authentication_failed}{no}}
  793.        message   = Authentication failed
  794.  
  795.   # we learned this in the acl_smtp_mail block
  796.   accept
  797.     condition = ${if def:acl_c_authenticated_local_user {yes}{no}}
  798.  
  799.  
  800.  
  801. # END INSERT default_identify_sender
  802. # BEGIN INSERT default_message_submission
  803.  
  804. # Reject unauthenticated relay on port 587
  805.  drop
  806.     condition = ${if eq{$interface_port}{587}{1}{0}}
  807.     message = SMTP AUTH is required for message submission on port 587
  808.  
  809. # END INSERT default_message_submission
  810.  
  811. #END ACL_IDENTIFY_SENDER_BLOCK
  812.  
  813.  
  814.  
  815. #BEGIN ACL_RECP_VERIFY_BLOCK
  816. # BEGIN INSERT default_recp_verify
  817.    #recipient verifications are required for all messages that are not sent to the local machine    #this was done at multiple users requests
  818.     require verify = recipient
  819.  
  820.  
  821.  
  822. # END INSERT default_recp_verify
  823.  
  824. #END ACL_RECP_VERIFY_BLOCK
  825.  
  826. #BEGIN ACL_POST_RECP_VERIFY_BLOCK
  827. # BEGIN INSERT dictionary_attack
  828.  
  829.  
  830.   warn
  831.     log_message = "Detected Dictionary Attack (Let $rcpt_fail_count bad recipients though before engaging)"
  832.     condition = ${if > {${eval:$rcpt_fail_count}}{4}{yes}{no}}
  833.     set acl_m7 = 1
  834.  
  835.   warn
  836.     condition = ${if eq {${acl_m7}}{1}{1}{0}}
  837.     ratelimit = 0 / 1h / strict / per_conn
  838.     log_message = "Increment Connection Ratelimit - $sender_fullhost because of Dictionary Attack"
  839.  
  840.   drop
  841.     condition = ${if eq {${acl_m7}}{1}{1}{0}}
  842.     message = "Number of failed recipients exceeded.  Come back in a few hours."
  843.  
  844.  
  845. # END INSERT dictionary_attack
  846.  
  847. #END ACL_POST_RECP_VERIFY_BLOCK
  848.  
  849. #BEGIN ACL_TRUSTEDLIST_BLOCK
  850. # BEGIN INSERT trustedmailhosts
  851.  accept
  852.     hosts = +trustedmailhosts
  853.  
  854.  accept
  855.      condition = ${if match_ip{$sender_host_address}{iplsearch;/etc/trustedmailhosts}{1}{0}}
  856.  
  857. # END INSERT trustedmailhosts
  858.  
  859. #END ACL_TRUSTEDLIST_BLOCK
  860.  
  861. #BEGIN ACL_RBL_BLOCK
  862. # BEGIN INSERT spamcop_rbl
  863.  
  864.  deny message = JunkMail rejected - $sender_fullhost is in an RBL, see $dnslist_text
  865.      hosts = +backupmx_hosts
  866.      dnslists = bl.spamcop.net
  867.  
  868.  warn
  869.      
  870.      dnslists = bl.spamcop.net
  871.      set acl_m8 = 1
  872.      set acl_m9 = "JunkMail rejected - $sender_fullhost is in an RBL, see $dnslist_text"
  873.  
  874.  warn
  875.      condition = ${if eq {${acl_m8}}{1}{1}{0}}
  876.      ratelimit = 0 / 1h / strict / per_conn
  877.      log_message = "Increment Connection Ratelimit - $sender_fullhost because of RBL match"
  878.  
  879.  drop
  880.      condition = ${if eq {${acl_m8}}{1}{1}{0}}
  881.      message = ${acl_m9}
  882.  
  883.  
  884. # END INSERT spamcop_rbl
  885. # BEGIN INSERT spamhaus_rbl
  886.  
  887.  deny message = JunkMail rejected - $sender_fullhost is in an RBL, see $dnslist_text
  888.      hosts = +backupmx_hosts
  889.      dnslists = zen.spamhaus.org
  890.  
  891.  warn
  892.      
  893.      dnslists = zen.spamhaus.org
  894.      set acl_m8 = 1
  895.      set acl_m9 = "JunkMail rejected - $sender_fullhost is in an RBL, see $dnslist_text"
  896.  
  897.  warn
  898.      condition = ${if eq {${acl_m8}}{1}{1}{0}}
  899.      ratelimit = 0 / 1h / strict / per_conn
  900.      log_message = "Increment Connection Ratelimit - $sender_fullhost because of RBL match"
  901.  
  902.  drop
  903.      condition = ${if eq {${acl_m8}}{1}{1}{0}}
  904.      message = ${acl_m9}
  905.  
  906.  
  907. # END INSERT spamhaus_rbl
  908.  
  909. #END ACL_RBL_BLOCK
  910.  
  911. #BEGIN ACL_MAILAUTH_BLOCK
  912.  
  913. #END ACL_MAILAUTH_BLOCK
  914.  
  915. #BEGIN ACL_RCPT_HARD_LIMIT_BLOCK
  916.  
  917. #END ACL_RCPT_HARD_LIMIT_BLOCK
  918.  
  919. #BEGIN ACL_RCPT_SOFT_LIMIT_BLOCK
  920.  
  921. #END ACL_RCPT_SOFT_LIMIT_BLOCK
  922.  
  923. #BEGIN ACL_SPAM_SCAN_CHECK_BLOCK
  924. # BEGIN INSERT default_spam_scan_check
  925.  
  926.     # The only problem with this setup is that if the message is for multiple users on the same server
  927.     # and they are on different unix accounts, the settings for the first recipient which has spamassassin enabled will be used.
  928.     # This shouldn't be a problem 99.9% of the time, however its a very small price to pay for a massive speed increase.
  929.  
  930.  
  931.   warn  domains = ! ${primary_hostname} : +local_domains
  932.          condition = ${if <= {$message_size}{200K}{${if eq {${acl_m0}}{1}{0}{${if exists{/etc/global_spamassassin_enable}{1}{${if exists{${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/.spamassassinenable}{1}{0}}}}}}}{0}}
  933.          set acl_m0    = 1
  934.          set acl_m1    = ${lookup{$domain}lsearch*{/etc/userdomains}{$value}}
  935.  
  936.   warn  domains = ${primary_hostname}
  937.           condition = ${if <= {$message_size}{200K}{${if eq {${acl_m0}}{1}{0}{${if exists{/etc/global_spamassassin_enable}{1}{${if exists{${extract{5}{:}{${lookup passwd{$local_part}{$value}}}}/.spamassassinenable}{1}{0}}}}}}}{0}}
  938.           set acl_m0    = 1
  939.           set acl_m1    = $local_part
  940.  
  941.  
  942.  
  943. # END INSERT default_spam_scan_check
  944.  
  945. #END ACL_SPAM_SCAN_CHECK_BLOCK
  946.  
  947. #BEGIN ACL_POST_SPAM_SCAN_CHECK_BLOCK
  948. # BEGIN INSERT mailproviders
  949. # Research in Motion - Blackberry white list
  950.  warn
  951.      condition = ${if exists {/etc/mailproviders/rim/ips}{${if match_ip{$sender_host_address}{iplsearch;/etc/mailproviders/rim/ips}{1}{0}}}{0}}
  952.      set acl_m0 = 0
  953.  
  954. # END INSERT mailproviders
  955.  
  956. #END ACL_POST_SPAM_SCAN_CHECK_BLOCK
  957.  
  958. #BEGIN ACL_RECIPIENT_POST_BLOCK
  959. # BEGIN INSERT default_recipient_post
  960.  
  961.  
  962.  
  963.   accept  domains = +relay_domains
  964.  
  965.   deny    message = ${expand:${lookup{host_accept_relay}lsearch{/etc/eximrejects}{$value}}}
  966.  
  967.  
  968.  
  969. # END INSERT default_recipient_post
  970.  
  971. #END ACL_RECIPIENT_POST_BLOCK
  972.  
  973. acl_smtp_starttls:
  974.  
  975. #BEGIN ACL_SMTP_STARTTLS_BLOCK
  976.  
  977. #END ACL_SMTP_STARTTLS_BLOCK
  978.  
  979. acl_smtp_vrfy:
  980.  
  981. #BEGIN ACL_SMTP_SMTP_VRFY_BLOCK
  982.  
  983. #END ACL_SMTP_SMTP_VRFY_BLOCK
  984.  
  985. acl_smtp_dkim:
  986.  
  987. #BEGIN ACL_SMTP_DKIM_BLOCK
  988. # BEGIN INSERT dkim_bl
  989.  
  990.   deny message = DKIM: encountered the following problem validating $dkim_cur_signer: $dkim_verify_reason
  991.        dkim_status = invalid:fail
  992.  
  993.   accept
  994.  
  995. # END INSERT dkim_bl
  996.  
  997. #END ACL_SMTP_DKIM_BLOCK
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003. begin authenticators
  1004.  
  1005.  
  1006. dovecot_plain:
  1007.     driver = dovecot
  1008.     public_name = PLAIN
  1009.     server_socket = /var/run/dovecot/auth-client
  1010.     server_set_id = $auth1
  1011.     server_condition = ${if and {{!match {$auth1}{\N[/]\N}}{eq{${if match {$auth1}{\N[+%:@]\N}{${lookup{${extract{2}{+%:@}{$auth1}}}lsearch{/etc/demodomains}{yes}}}{${lookup{$auth1}lsearch{/etc/demousers}{yes}}}}}{}}}{true}{false}}
  1012.  
  1013.  
  1014.  
  1015. dovecot_login:
  1016.   driver = dovecot
  1017.   public_name = LOGIN
  1018.   server_socket = /var/run/dovecot/auth-client
  1019.   server_set_id = $auth1
  1020.   server_condition = ${if and {{!match {$auth1}{\N[/]\N}}{eq{${if match {$auth1}{\N[+%:@]\N}{${lookup{${extract{2}{+%:@}{$auth1}}}lsearch{/etc/demodomains}{yes}}}{${lookup{$auth1}lsearch{/etc/demousers}{yes}}}}}{}}}{true}{false}}
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027. ######################################################################
  1028. #                      REWRITE CONFIGURATION                         #
  1029. ######################################################################
  1030.  
  1031. # There are no rewriting specifications in this default configuration file.
  1032.  
  1033. begin rewrite
  1034.  
  1035.  
  1036.  
  1037.  
  1038. #!!#######################################################!!#
  1039. #!!# Here follow routers created from the old routers,   #!!#
  1040. #!!# for handling non-local domains.                     #!!#
  1041. #!!#######################################################!!#
  1042.  
  1043. begin routers
  1044.  
  1045.  
  1046.  
  1047.  
  1048. ######################################################################
  1049. #                      ROUTERS CONFIGURATION                         #
  1050. #            Specifies how remote addresses are handled              #
  1051. ######################################################################
  1052. #                          ORDER DOES MATTER                         #
  1053. #  A remote address is passed to each in turn until it is accepted.  #
  1054. ######################################################################
  1055.  
  1056. # Remote addresses are those with a domain that does not match any item
  1057. # in the "local_domains" setting above.
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064. mailman_virtual_router:
  1065.     driver = accept
  1066.     require_files = /usr/local/cpanel/3rdparty/mailman/mail/mailman : /usr/local/cpanel/3rdparty/mailman/lists/${lc::$local_part}_${lc::$domain}/config.pck
  1067.     local_part_suffix_optional
  1068.     local_part_suffix = -admin     : \
  1069.             -bounces   : -bounces+* : \
  1070.                         -confirm   : -confirm+* : \
  1071.             -join      : -leave     : \
  1072.             -owner     : -request   : \
  1073.             -subscribe : -unsubscribe
  1074.     transport = mailman_virtual_transport
  1075.  
  1076.  
  1077.  
  1078. mailman_virtual_router_nodns:
  1079.     driver = accept
  1080.     require_files = /usr/local/cpanel/3rdparty/mailman/mail/mailman : /usr/local/cpanel/3rdparty/mailman/lists/${lc::$local_part}/config.pck
  1081.     condition    = \
  1082.            ${if or {{match{$local_part}{.*_.*}} \
  1083.                      {eq{$local_part}{mailman}}} \
  1084.                 {1}{0}}
  1085.     local_part_suffix_optional
  1086.     local_part_suffix = -admin     : \
  1087.             -bounces   : -bounces+* : \
  1088.                         -confirm   : -confirm+* : \
  1089.             -join      : -leave     : \
  1090.             -owner     : -request   : \
  1091.             -subscribe : -unsubscribe
  1092.     domains = +local_domains
  1093.     transport = mailman_virtual_transport_nodns
  1094.  
  1095. democheck:
  1096.     driver = redirect
  1097.     require_files = "+/etc/demouids"
  1098.     condition = "${if eq {${lookup {$originator_uid} lsearch {/etc/demouids} {$value}}}{}{false}{true}}"
  1099.     allow_fail
  1100.     data = :fail: demo accounts are not permitted to relay email
  1101.  
  1102.  
  1103.  
  1104. # cPanel Mail Archiving is disabled
  1105.  
  1106.    
  1107.  
  1108.  
  1109.  
  1110. #
  1111. # Handles identification of messages, nobody and webspam and mail trap checks
  1112. # in check_mail_permissions and notifies if we are defering a message
  1113. #
  1114.  
  1115.  
  1116. boxtrapper_autowhitelist:
  1117.   driver = accept
  1118.   condition = ${if eq {$authenticated_id}{}{0}{${if eq {$sender_address}{$local_part@$domain}{0}{${if match{$received_protocol}{\N^e?smtps?a$\N}{${perl{checkbx_autowhitelist}{$authenticated_id}}}{${if eq{$received_protocol}{local}{${perl{checkbx_autowhitelist}{$sender_ident}}}{0}}}}}}}}
  1119.   require_files = "+/usr/local/cpanel/bin/boxtrapper"
  1120.   transport = boxtrapper_autowhitelist
  1121.   no_verify
  1122.   unseen
  1123.  
  1124.  
  1125. check_mail_permissions:
  1126.     domains = ! +local_domains
  1127.     condition = "${perl{check_mail_permissions}}"
  1128.     driver = redirect
  1129.     ignore_target_hosts = +loopback : 64.94.110.0/24
  1130.     allow_filter
  1131.     reply_transport = address_reply
  1132.     user = mailnull
  1133.     expn = false
  1134.     data = "${perl{check_mail_permissions_results}}"
  1135.  
  1136.  
  1137. #
  1138. #  discover_sender_information is not included
  1139. #  because from_rewrites are not enabled
  1140. #
  1141.  
  1142.  
  1143. #
  1144. # If check_mail_permissions needs to defer or fail a message it is done here
  1145. #
  1146. enforce_mail_permissions:
  1147.     domains = ! +local_domains
  1148.     condition = "${perl{enforce_mail_permissions}}"
  1149.     driver = redirect
  1150.     ignore_target_hosts = +loopback : 64.94.110.0/24
  1151.     allow_fail
  1152.     allow_defer
  1153.     expn = false
  1154.     data = "${perl{enforce_mail_permissions_results}}"
  1155.  
  1156. #
  1157. # Increments max emails per hour if needed
  1158. #
  1159. increment_max_emails_per_hour_if_needed:
  1160.     domains = ! +local_domains
  1161.     condition = "${perl{increment_max_emails_per_hour_if_needed}}"
  1162.     driver = redirect
  1163.     ignore_target_hosts = +loopback : 64.94.110.0/24
  1164.     allow_fail
  1165.     no_verify
  1166.     one_time
  1167.     expn = false
  1168.     data = ":unknown:"
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176. #
  1177. # Lookup host router for remote smtp and ignores verisign site finder 'service'
  1178. # and uses domain keys
  1179. # This matches lookup exactly except we look for X-Boxtrapper: so we can determine
  1180. # what is a boxtrapper generated message in the log.  Note: there is nothing to
  1181. # prevent X-Boxtrapper from being added to non-boxtrapper messages so this is for
  1182. # logging reasons only
  1183. #
  1184. boxtrapper_verify_dkim_lookuphost:
  1185.     driver = dnslookup
  1186.     domains = ! +local_domains
  1187.     condition = "${if eq {$h_X-Boxtrapper:}{}{0}{1}}"
  1188.     #ignore verisign to prevent waste of bandwidth
  1189.     ignore_target_hosts = +loopback : 64.94.110.0/24
  1190.     require_files = "+/var/cpanel/domain_keys/private/${sender_address_domain}"
  1191.     headers_add = "${perl{mailtrapheaders}}"
  1192.     transport = dkim_remote_smtp
  1193.  
  1194. #
  1195. # Lookup host router for remote smtp and ignores verisign site finder 'service' and uses domain keys
  1196. #
  1197.  
  1198.  
  1199. dkim_lookuphost:
  1200.     driver = dnslookup
  1201.     domains = ! +local_domains
  1202.     #ignore verisign to prevent waste of bandwidth
  1203.     ignore_target_hosts = +loopback : 64.94.110.0/24
  1204.     require_files = "+/var/cpanel/domain_keys/private/${sender_address_domain}"
  1205.     headers_add = "${perl{mailtrapheaders}}"
  1206.     transport = dkim_remote_smtp
  1207.  
  1208. #
  1209. # Lookup host router for remote smtp and ignores verisign site finder 'service'
  1210. # This matches lookup exactly except we look for X-Boxtrapper: so we can determine
  1211. # what is a boxtrapper generated message in the log.  Note: there is nothing to
  1212. # prevent X-Boxtrapper from being added to non-boxtrapper messages so this is for
  1213. # logging reasons only
  1214. #
  1215.  
  1216.  
  1217. boxtrapper_verify_lookuphost:
  1218.     driver = dnslookup
  1219.     domains = ! +local_domains
  1220.     condition = "${if eq {$h_X-Boxtrapper:}{}{0}{1}}"
  1221.     #ignore verisign to prevent waste of bandwidth
  1222.     ignore_target_hosts = +loopback : 64.94.110.0/24
  1223.     headers_add = "${perl{mailtrapheaders}}"
  1224.     transport = remote_smtp
  1225.  
  1226. #
  1227. # Lookup host router for remote smtp and ignores verisign site finder 'service'
  1228. #
  1229.  
  1230.  
  1231. lookuphost:
  1232.     driver = dnslookup
  1233.     domains = ! +local_domains
  1234.     #ignore verisign to prevent waste of bandwidth
  1235.     ignore_target_hosts = +loopback : 64.94.110.0/24
  1236.     headers_add = "${perl{mailtrapheaders}}"
  1237.     transport = remote_smtp
  1238.  
  1239.  
  1240. # This router routes to remote hosts over SMTP by explicit IP address,
  1241. # given as a "domain literal" in the form [nnn.nnn.nnn.nnn]. The RFCs
  1242. # require this facility, which is why it is enabled by default in Exim.
  1243. # If you want to lock it out, set forbid_domain_literals in the main
  1244. # configuration section above.
  1245.  
  1246.  
  1247. #
  1248. # Literal Transports .. ignores verisigns sitefinder service
  1249. #
  1250.  
  1251. literal:
  1252.     driver = ipliteral
  1253.     domains = ! +local_domains
  1254.     headers_add = "${perl{mailtrapheaders}}"
  1255.     ignore_target_hosts = +loopback : 64.94.110.0/24
  1256.     transport = remote_smtp
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263. #!!# This new router is put here to fail all domains that
  1264. #!!# were not in local_domains in the Exim 3 configuration.
  1265.  
  1266.  
  1267. #
  1268. # Trap Failures to Remote Domain
  1269. #
  1270.  
  1271. fail_remote_domains:
  1272.   driver = redirect
  1273.   domains = ! +local_domains : ! localhost : ! localhost.localdomain
  1274.   allow_fail
  1275.   data = ":fail: The mail server could not deliver mail to $local_part@$domain.  The account or domain may not exist, they may be blacklisted, or missing the proper dns entries."
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282. #!!#######################################################!!#
  1283. #!!# Here follow routers created from the old directors, #!!#
  1284. #!!# for handling local domains.                         #!!#
  1285. #!!#######################################################!!#
  1286.  
  1287. deliver_local_outside_jail:
  1288.     driver = manualroute
  1289.     domains = +outside_jail_domains
  1290.     # users outside the jail will not be in /etc/passwd => We need to check if $local_part is in /jail_owner
  1291.     # we can't just check to see if they exist
  1292.     # because we still want to be able to mail root
  1293.     condition = ${if exists {/jail_owner}{${if eq {$domain}{$primary_hostname}{${if eq {${readfile{/jail_owner}}}{$local_part}{0}{1}}}{1}}}{0}}
  1294.     transport = remote_smtp
  1295.     route_list = "* 127.0.0.1"
  1296.     # self = send allows us to send outside the jail
  1297.     # we make sure /home/virtfs does not exist before we get here
  1298.     # to be safe
  1299.     self = send
  1300.  
  1301. ######################################################################
  1302. #                      DIRECTORS CONFIGURATION                       #
  1303. #             Specifies how local addresses are handled              #
  1304. ######################################################################
  1305. #                          ORDER DOES MATTER                         #
  1306. #   A local address is passed to each in turn until it is accepted.  #
  1307. ######################################################################
  1308.  
  1309. # Local addresses are those with a domain that matches some item in the
  1310. # "local_domains" setting above, or those which are passed back from the
  1311. # routers because of a "self=local" setting (not used in this configuration).
  1312.  
  1313.  
  1314. # This director handles aliasing using a traditional /etc/aliases file.
  1315. # If any of your aliases expand to pipes or files, you will need to set
  1316. # up a user and a group for these deliveries to run under. You can do
  1317. # this by uncommenting the "user" option below (changing the user name
  1318. # as appropriate) and adding a "group" option if necessary. Alternatively, you
  1319. # can specify "user" on the transports that are used. Note that those
  1320. # listed below are the same as are used for .forward files; you might want
  1321. # to set up different ones for pipe and file deliveries from aliases.
  1322.  
  1323. #spam_filter:
  1324. #  driver = forwardfile
  1325. #  file = /etc/spam.filter
  1326. #  no_check_local_user
  1327. #  no_verify
  1328. #  filter
  1329. #  allow_system_actions
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337. #
  1338. # Optimized spamassassin router (not used if acl spam management is enabled)
  1339. #
  1340.  
  1341.  
  1342.  
  1343. virtual_user_maildir_overquota:
  1344.   driver = redirect
  1345.   domains = +user_domains
  1346.   router_home_directory = ${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch{/etc/userdomains}{$value}}}{$value}}}}
  1347.   require_files = $home/etc/$domain
  1348.   condition = "${if exists {$home/etc/$domain/quota}{${if > {${lookup{$local_part}lsearch{$home/etc/$domain/quota}{$value}{0}}}{0}{${perl{checkuserquota}{$domain}{$local_part}{$message_size}{${lookup{$local_part}lsearch{$home/etc/$domain/quota}{$value}{0}}}{$home/mail/$domain/$local_part/maildirsize}}}{false}}}{false}}"
  1349.   user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  1350.   data = :fail:Mailbox quota exceeded
  1351.   allow_fail
  1352.  
  1353.  
  1354.  
  1355.        
  1356.  
  1357.  
  1358.  
  1359.  
  1360. #
  1361. # Optimized spamassasin router (not used if acl spam management is enabled)
  1362. #
  1363.  
  1364.  
  1365.  
  1366.        
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375. #
  1376. # Account level filtering for everything but the main account
  1377. #
  1378.  
  1379. central_filter:
  1380.     driver = redirect
  1381.     allow_filter
  1382.     allow_fail
  1383.     forbid_filter_run
  1384.     forbid_filter_perl
  1385.     forbid_filter_lookup
  1386.     forbid_filter_readfile
  1387.     forbid_filter_readsocket
  1388.     no_check_local_user
  1389.     require_files = "+/etc/vfilters/${domain}"
  1390.     condition = "${extract{size}{${stat:/etc/vfilters/${domain}}}}"
  1391.     file = /etc/vfilters/${domain}
  1392.     file_transport = address_file
  1393.     directory_transport = address_directory
  1394.     domains = +user_domains
  1395.     pipe_transport = ${if forall{/bin/cagefs_enter:/usr/sbin/cagefsctl}{exists{$item}}{cagefs_virtual_address_pipe}{${if match{${extract{6}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}}{\N(jail|no)shell\N}{jailed_virtual_address_pipe}{virtual_address_pipe}}}}
  1396.     reply_transport = address_reply
  1397.     router_home_directory = ${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}
  1398.     user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  1399.     no_verify
  1400.  
  1401.  
  1402.  
  1403. #
  1404. # Account level filtering for the main account
  1405. #
  1406. # checks /etc/vfilters/maindomain if its a localuser (ie main acct)
  1407. #
  1408. mainacct_central_user_filter:
  1409.     driver = redirect  
  1410.     allow_filter  
  1411.     allow_fail
  1412.     forbid_filter_run
  1413.     forbid_filter_perl
  1414.     forbid_filter_lookup
  1415.     forbid_filter_readfile
  1416.     forbid_filter_readsocket
  1417.     check_local_user
  1418.     domains = ! +user_domains
  1419.     condition = ${if eq {${lookup{$local_part}lsearch{/etc/domainusers}{$value}}}{}{0}{${if exists {/etc/vfilters/${lookup{$local_part}lsearch{/etc/domainusers}{$value}}}{${extract{size}{${stat:/etc/vfilters/${lookup{$local_part}lsearch{/etc/domainusers}{$value}}}}}}{0}}}}
  1420.     file = "/etc/vfilters/${lookup{$local_part}lsearch{/etc/domainusers}{$value}}"
  1421.     directory_transport = address_directory
  1422.     file_transport = address_file  
  1423.     pipe_transport = ${if forall{/bin/cagefs_enter:/usr/sbin/cagefsctl}{exists{$item}}{cagefs_address_pipe}{${if match{${extract{6}{:}{${lookup passwd{$local_part}{$value}}}}}{\N(jail|no)shell\N}{jailed_address_pipe}{address_pipe}}}}
  1424.     reply_transport = address_reply
  1425.     retry_use_local_part  
  1426.     no_verify
  1427.  
  1428. #
  1429. # User Level Filtering for the main account
  1430. #
  1431.  
  1432.  
  1433. central_user_filter:
  1434.     driver = redirect
  1435.     allow_filter
  1436.     allow_fail
  1437.     forbid_filter_run
  1438.     forbid_filter_perl
  1439.     forbid_filter_lookup
  1440.     forbid_filter_readfile
  1441.     forbid_filter_readsocket
  1442.     check_local_user
  1443.     domains = ! +user_domains
  1444.     require_files = "+${extract{5}{::}{${lookup passwd{$local_part}{$value}}}}/etc/filter"
  1445.     condition = "${extract{size}{${stat:${extract{5}{:}{${lookup passwd{$local_part}{$value}}}}/etc/filter}}}"
  1446.     file = "${extract{5}{:}{${lookup passwd{$local_part}{$value}}}}/etc/filter"
  1447.     router_home_directory = ${extract{5}{:}{${lookup passwd{$local_part}{$value}}}}
  1448.     directory_transport = address_directory
  1449.     file_transport = address_file
  1450.     pipe_transport = ${if forall{/bin/cagefs_enter:/usr/sbin/cagefsctl}{exists{$item}}{cagefs_virtual_address_pipe}{${if match{${extract{6}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}}{\N(jail|no)shell\N}{jailed_virtual_address_pipe}{virtual_address_pipe}}}}
  1451.     reply_transport = address_reply
  1452.     retry_use_local_part
  1453.     no_verify
  1454.  
  1455. #
  1456. # User Level Filtering for virtual users
  1457. #
  1458.  
  1459.  
  1460. virtual_user_filter:
  1461.     driver = redirect
  1462.     allow_filter
  1463.     allow_fail
  1464.     forbid_filter_run
  1465.     forbid_filter_perl
  1466.     forbid_filter_lookup
  1467.     forbid_filter_readfile
  1468.     forbid_filter_readsocket
  1469.     no_check_local_user
  1470.     domains = +user_domains
  1471.     require_files = "+${extract{5}{::}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$domain/$local_part/filter"
  1472.     condition = "${extract{size}{${stat:${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$domain/$local_part/filter}}}"
  1473.     file = "${extract{5}{::}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$domain/$local_part/filter"
  1474.     router_home_directory = ${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}
  1475.     directory_transport = address_directory
  1476.     file_transport = address_file
  1477.     pipe_transport = ${if forall{/bin/cagefs_enter:/usr/sbin/cagefsctl}{exists{$item}}{cagefs_virtual_address_pipe}{${if match{${extract{6}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}}{\N(jail|no)shell\N}{jailed_virtual_address_pipe}{virtual_address_pipe}}}}
  1478.     reply_transport = address_reply
  1479.     user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  1480.     retry_use_local_part
  1481.     no_verify
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488. virtual_aliases_nostar:
  1489.   driver = redirect
  1490.   allow_defer
  1491.   allow_fail
  1492.   require_files = "+/etc/valiases/$domain"
  1493.   data = ${lookup{$local_part@$domain}lsearch{/etc/valiases/$domain}}
  1494.   file_transport = address_file
  1495.   group = mail
  1496.   pipe_transport = ${if forall{/bin/cagefs_enter:/usr/sbin/cagefsctl}{exists{$item}}{cagefs_virtual_address_pipe}{${if match{${extract{6}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}}{\N(jail|no)shell\N}{jailed_virtual_address_pipe}{virtual_address_pipe}}}}
  1497.   retry_use_local_part
  1498.   unseen
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505. #
  1506. # Virtual User Spam Boxes
  1507. #
  1508.  
  1509. virtual_user_spam:
  1510.     driver = accept
  1511.     domains = +user_domains
  1512.     require_files = "+${extract{5}{::}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/.spamassassinboxenable:+${extract{5}{::}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$domain/passwd"
  1513.     condition = ${if eq {${lookup {$local_part} lsearch {${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$domain/passwd}}}{}{false}{${if match{$h_X-Spam-Status:}{\N^Yes\N}{true}{false}}}}
  1514.     headers_remove="x-spam-exim"
  1515.     transport = virtual_userdelivery_spam
  1516.    
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522. virtual_boxtrapper_user:
  1523.   driver = accept
  1524.   domains = +user_domains
  1525.   require_files = "+/usr/local/cpanel/bin/boxtrapper:+${extract{5}{::}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$domain/passwd"
  1526.   condition = ${if eq {${lookup {$local_part} lsearch {${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$domain/passwd}}}{} {false}{${if exists {${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$domain/$local_part/.boxtrapperenable} {true} {false}}}}
  1527.   retry_use_local_part
  1528.   transport = virtual_boxtrapper_userdelivery
  1529.  
  1530. virtual_user:
  1531.   driver = accept
  1532.   headers_remove="x-spam-exim"
  1533.   domains = +user_domains
  1534.   require_files = "+${extract{5}{::}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$domain/passwd"
  1535.   condition = ${if eq {${lookup {$local_part} lsearch {${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$domain/passwd}}}{} {false}{true}}
  1536.   transport = virtual_userdelivery
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543. has_alias_but_no_mailbox_discarded_to_prevent_loop:
  1544.         driver = redirect
  1545.         require_files = "+/etc/valiases/$domain"
  1546.         domains = +user_domains
  1547.         condition = "${perl{checkvalias}{$domain}{$local_part}}"
  1548.         data="#Exim Filter\nseen finish"
  1549.         group = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  1550.         user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  1551.         allow_filter
  1552.         disable_logging = true
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560. valias_domain_file:
  1561.   driver = redirect
  1562.   allow_defer
  1563.   allow_fail
  1564.   require_files = +/etc/vdomainaliases/$domain
  1565.   condition = ${lookup {$domain} lsearch {/etc/vdomainaliases/$domain}{yes}{no} }
  1566.   data = $local_part@${lookup {$domain} lsearch {/etc/vdomainaliases/$domain} }
  1567.  
  1568. virtual_aliases:
  1569.     driver = redirect
  1570.     allow_defer
  1571.     allow_fail
  1572.     require_files = "+/etc/valiases/$domain"
  1573.     data = ${lookup{*}lsearch{/etc/valiases/$domain}}
  1574.     file_transport = address_file
  1575.     group = mail
  1576.     pipe_transport = ${if forall{/bin/cagefs_enter:/usr/sbin/cagefsctl}{exists{$item}}{cagefs_virtual_address_pipe}{${if match{${extract{6}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}}{\N(jail|no)shell\N}{jailed_virtual_address_pipe}{virtual_address_pipe}}}}
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584. # This director handles forwarding using traditional .forward files.
  1585. # If you want it also to allow mail filtering when a forward file
  1586. # starts with the string "# Exim filter", uncomment the "filter" option.
  1587. # The check_ancestor option means that if the forward file generates an
  1588. # address that is an ancestor of the current one, the current one gets
  1589. # passed on instead. This covers the case where A is aliased to B and B
  1590. # has a .forward file pointing to A. The three transports specified at the
  1591. # end are those that are used when forwarding generates a direct delivery
  1592. # to a file, or to a pipe, or sets up an auto-reply, respectively.
  1593.  
  1594. system_aliases:
  1595.   driver = redirect
  1596.   allow_defer
  1597.   allow_fail
  1598.   data = ${lookup{$local_part}lsearch{/etc/aliases}}
  1599.   file_transport = address_file
  1600.   pipe_transport = address_pipe
  1601.   retry_use_local_part
  1602. # user = exim
  1603.  
  1604.                                                                                                                                                                                                                                                        
  1605. local_aliases:
  1606.   driver = redirect
  1607.   allow_defer
  1608.   allow_fail
  1609.   data = ${lookup{$local_part}lsearch{/etc/localaliases}}
  1610.   file_transport = address_file
  1611.   pipe_transport = address_pipe
  1612.   check_local_user
  1613.                                                                                                                                                                                                                                                        
  1614.  
  1615.  
  1616.  
  1617.  
  1618. userforward:
  1619.   driver = redirect
  1620.   allow_filter
  1621.   allow_fail
  1622.   forbid_filter_run
  1623.   forbid_filter_perl
  1624.   forbid_filter_lookup
  1625.   forbid_filter_readfile
  1626.   forbid_filter_readsocket
  1627.   check_ancestor
  1628.   check_local_user
  1629.   domains = ! +user_domains
  1630.   no_expn
  1631.   require_files = "+$home/.forward"
  1632.   condition = "${extract{size}{${stat:$home/.forward}}}"
  1633.   file = $home/.forward
  1634.   file_transport = address_file
  1635.   pipe_transport = ${if forall{/bin/cagefs_enter:/usr/sbin/cagefsctl}{exists{$item}}{cagefs_address_pipe}{${if match{${extract{6}{:}{${lookup passwd{$local_part}{$value}}}}}{\N(jail|no)shell\N}{jailed_address_pipe}{address_pipe}}}}
  1636.   reply_transport = address_reply
  1637.   directory_transport = address_directory
  1638.   no_verify
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645. #
  1646. # Optimzied spambox router
  1647. #
  1648.  
  1649. localuser_spam:
  1650.     driver = accept
  1651.     headers_remove="x-spam-exim"
  1652.     domains = ! +user_domains
  1653.     require_files = "+$home/.spamassassinboxenable"
  1654.     condition = ${if match{$h_X-Spam-Status:}{\N^Yes\N}{true}{false}}
  1655.     check_local_user
  1656.     transport = local_delivery_spam
  1657.  
  1658.  
  1659.  
  1660.  
  1661. boxtrapper_localuser:
  1662.   driver = accept
  1663.   require_files = "+/usr/local/cpanel/bin/boxtrapper:+$home/etc/.boxtrapperenable"
  1664.   check_local_user
  1665.   domains = ! +user_domains
  1666.   transport = local_boxtrapper_delivery
  1667.  
  1668.  
  1669.  
  1670. localuser:
  1671.     driver = accept
  1672.     headers_remove="x-spam-exim"
  1673.     check_local_user
  1674.     domains = ! +user_domains
  1675.     transport = local_delivery
  1676.  
  1677.  
  1678.  
  1679.  
  1680. # This director matches local user mailboxes.
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688. ######################################################################
  1689. #                      TRANSPORTS CONFIGURATION                      #
  1690. ######################################################################
  1691. #                       ORDER DOES NOT MATTER                        #
  1692. #     Only one appropriate transport is called for each delivery.    #
  1693. ######################################################################
  1694.  
  1695. # A transport is used only when referenced from a director or a router that
  1696. # successfully handles an address.
  1697.  
  1698.  
  1699. # This transport is used for delivering messages over SMTP connections.
  1700.  
  1701. begin transports
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708. mailman_virtual_transport:
  1709.     driver = pipe
  1710.     command = /usr/local/cpanel/3rdparty/mailman/mail/mailman \
  1711.               '${if def:local_part_suffix \
  1712.                    {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} \
  1713.                    {post}}' \
  1714.               ${lc:$local_part}_${lc:$domain}
  1715.     current_directory = /usr/local/cpanel/3rdparty/mailman
  1716.     home_directory = /usr/local/cpanel/3rdparty/mailman
  1717.     user = mailman
  1718.     group = mailman
  1719.  
  1720.  
  1721.  
  1722.  
  1723. mailman_virtual_transport_nodns:
  1724.     driver = pipe
  1725.     command = /usr/local/cpanel/3rdparty/mailman/mail/mailman \
  1726.               '${if def:local_part_suffix \
  1727.                    {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} \
  1728.                    {post}}' \
  1729.               ${lc:$local_part}
  1730.     current_directory = /usr/local/cpanel/3rdparty/mailman
  1731.     home_directory = /usr/local/cpanel/3rdparty/mailman
  1732.     user = mailman
  1733.     group = mailman
  1734.  
  1735.  
  1736. remote_smtp:
  1737.   driver = smtp
  1738.   interface = ${if exists {/etc/mailips}{${lookup{$original_domain}lsearch{/etc/mailips}{$value}{${lookup{$sender_address_domain}lsearch{/etc/mailips}{$value}{${lookup{${perl{get_sender_from_uid}}}lsearch*{/etc/mailips}{$value}{}}}}}}}}
  1739.   helo_data = ${if exists {/etc/mailhelo}{${lookup{$original_domain}lsearch{/etc/mailhelo}{$value}{${lookup{$sender_address_domain}lsearch{/etc/mailhelo}{$value}{${lookup{${perl{get_sender_from_uid}}}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}}}}}{$primary_hostname}}
  1740.  
  1741.  
  1742.  
  1743. dkim_remote_smtp:
  1744.   driver = smtp
  1745.   interface = ${if exists {/etc/mailips}{${lookup{$original_domain}lsearch{/etc/mailips}{$value}{${lookup{$sender_address_domain}lsearch{/etc/mailips}{$value}{${lookup{${perl{get_sender_from_uid}}}lsearch*{/etc/mailips}{$value}{}}}}}}}}
  1746.   helo_data = ${if exists {/etc/mailhelo}{${lookup{$original_domain}lsearch{/etc/mailhelo}{$value}{${lookup{$sender_address_domain}lsearch{/etc/mailhelo}{$value}{${lookup{${perl{get_sender_from_uid}}}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}}}}}{$primary_hostname}}
  1747.   dkim_domain = $sender_address_domain
  1748.   dkim_selector = default
  1749.   dkim_private_key = "/var/cpanel/domain_keys/private/${dkim_domain}"
  1750.   dkim_canon = relaxed
  1751.  
  1752.  
  1753.  
  1754. # This transport is used for local delivery to user mailboxes. By default
  1755. # it will be run under the uid and gid of the local user, and requires
  1756. # the sticky bit to be set on the /var/mail directory. Some systems use
  1757. # the alternative approach of running mail deliveries under a particular
  1758. # group instead of using the sticky bit. The commented options below show
  1759. # how this can be done.
  1760.  
  1761.  
  1762.  
  1763. local_delivery:
  1764.     driver = appendfile
  1765.     delivery_date_add
  1766.     envelope_to_add
  1767.     directory = "${extract{5}{:}{${lookup passwd{$local_part}{$value}}}}/mail"
  1768.     maildir_use_size_file
  1769.     maildir_quota_directory_regex = ^(?:cur|new|\.(?!Trash$)[^\@]+)$
  1770.     maildir_format
  1771.     maildir_tag = ,S=$message_size
  1772.     quota_size_regex = ,S=(\d+)
  1773.     mode = 0660
  1774.     return_path_add
  1775.     group = ${extract{3}{:}{${lookup passwd{$local_part}{$value}}}}
  1776.     user = $local_part
  1777.     shadow_condition = ${if exists {${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/.cpanel/rim/bis/$local_part}{1}{0}}
  1778.     shadow_transport = rim_bis_notifier_local_user
  1779.  
  1780.  
  1781.  
  1782. rim_bis_notifier_local_user:
  1783.     driver = pipe
  1784.     headers_only
  1785.     command = /usr/local/cpanel/bin/rim_bis_notifier "${local_part}"
  1786.     group = ${extract{3}{:}{${lookup passwd{$local_part}{$value}}}}
  1787.     user = $local_part
  1788.     log_output = true
  1789.     current_directory = "/tmp"
  1790.     return_fail_output = true
  1791.     return_path_add = false
  1792.  
  1793.  
  1794.  
  1795. local_delivery_spam:
  1796.   driver = appendfile
  1797.   delivery_date_add
  1798.   envelope_to_add
  1799.   directory = "${extract{5}{:}{${lookup passwd{$local_part}{$value}}}}/mail/.spam"
  1800.   maildir_use_size_file
  1801.   maildir_quota_directory_regex = ^(?:cur|new|\.(?!Trash$)[^\@]+)$
  1802.   maildir_format
  1803.   maildir_tag = ,S=$message_size
  1804.   quota_size_regex = ,S=(\d+)
  1805.   group = ${extract{3}{:}{${lookup passwd{$local_part}{$value}}}}
  1806.   mode = 0660
  1807.   return_path_add
  1808.   user = $local_part
  1809.  
  1810.  
  1811.  
  1812.  
  1813.        
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820. # This transport is used for handling pipe deliveries generated by alias
  1821. # or .forward files. If the pipe generates any standard output, it is returned
  1822. # to the sender of the message as a delivery error. Set return_fail_output
  1823. # instead of return_output if you want this to happen only when the pipe fails
  1824. # to complete normally. You can set different transports for aliases and
  1825. # forwards if you want to - see the references to address_pipe below.
  1826.  
  1827.  
  1828. address_directory:
  1829.     driver        = appendfile
  1830.     maildir_tag = ,S=$message_size
  1831.     quota_size_regex = ,S=(\d+)
  1832.     maildir_format
  1833.     maildir_use_size_file
  1834.     maildir_quota_directory_regex = ^(?:cur|new|\.(?!Trash$)[^\@]+)$
  1835.     mode = 0660
  1836.     delivery_date_add
  1837.     envelope_to_add
  1838.     return_path_add
  1839.  
  1840. address_pipe:
  1841.   driver = pipe
  1842.   return_output
  1843.  
  1844. virtual_address_pipe:
  1845.   driver = pipe
  1846.   group = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  1847.   return_output
  1848.   user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  1849.  
  1850. jailed_address_pipe:
  1851.   driver = pipe
  1852.   force_command
  1853.   command = /usr/local/cpanel/bin/jailexec $address_pipe
  1854.   return_output
  1855.  
  1856. jailed_virtual_address_pipe:
  1857.   driver = pipe
  1858.   force_command
  1859.   command = /usr/local/cpanel/bin/jailexec $address_pipe
  1860.   user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  1861.   group = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  1862.   return_output
  1863.  
  1864. cagefs_address_pipe:
  1865.   driver = pipe
  1866.   force_command
  1867.   command = /bin/cagefs_enter $address_pipe
  1868.   return_output
  1869.  
  1870. cagefs_virtual_address_pipe:
  1871.   driver = pipe
  1872.   force_command
  1873.   command = /bin/cagefs_enter $address_pipe
  1874.   user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  1875.   group = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  1876.   return_output
  1877.  
  1878.  
  1879. # This transport is used for handling deliveries directly to files that are
  1880. # generated by aliassing or forwarding.
  1881.  
  1882. address_file:
  1883.   driver = appendfile
  1884.   delivery_date_add
  1885.   envelope_to_add
  1886.   return_path_add
  1887.  
  1888.  
  1889. # This transport is used for handling autoreplies generated by the filtering
  1890. # option of the forwardfile director.
  1891.  
  1892.  
  1893.  
  1894.        
  1895.  
  1896.  
  1897.  
  1898. virtual_userdelivery_spam:
  1899.   driver = appendfile
  1900.   delivery_date_add
  1901.   envelope_to_add
  1902.   directory = "${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/mail/${domain}/${local_part}/.spam"
  1903.   maildir_use_size_file
  1904.   maildir_quota_directory_regex = ^(?:cur|new|\.(?!Trash$)[^\@]+)$
  1905.   maildir_format
  1906.   maildir_tag = ,S=$message_size
  1907.   quota_size_regex = ,S=(\d+)
  1908.   mode = 0660
  1909.   quota = "${if exists{${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/${domain}/quota} {${lookup{$local_part}lsearch*{${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/${domain}/quota}{$value}}} {}}"
  1910.   quota_is_inclusive = false
  1911.   quota_directory = "${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/mail/${domain}/${local_part}"
  1912.   return_path_add
  1913.   user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  1914.   group = ${extract{3}{:}{${lookup passwd{${lookup{$domain}lsearch* {/etc/userdomains}{$value}}}{$value}}}}
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921. boxtrapper_autowhitelist:
  1922.   driver = pipe
  1923.   headers_only
  1924.   command = /usr/local/cpanel/bin/boxtrapper --autowhitelist "${authenticated_id}"
  1925.   user = ${perl{getemailuser}{$authenticated_id}{$received_protocol}{$sender_ident}}
  1926.   group = ${extract{3}{:}{${lookup passwd{${perl{getemailuser}{$authenticated_id}{$received_protocol}{$sender_ident}}}{$value}}}}
  1927.   log_output = true
  1928.   current_directory = "/tmp"
  1929.   return_fail_output = true
  1930.   return_path_add = false
  1931.  
  1932.  
  1933.  
  1934. local_boxtrapper_delivery:
  1935.   driver = pipe
  1936.   command = /usr/local/cpanel/bin/boxtrapper "${local_part}" $home
  1937.   user = $local_part
  1938.   group = ${extract{3}{:}{${lookup passwd{$local_part}{$value}}}}
  1939.   log_output = true
  1940.   current_directory = "/tmp"
  1941.   return_fail_output = true
  1942.   return_path_add = false
  1943.  
  1944.  
  1945.  
  1946. virtual_boxtrapper_userdelivery:
  1947.   driver = pipe
  1948.   command = /usr/local/cpanel/bin/boxtrapper "${local_part}@${domain}" $home
  1949.   user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  1950.   group = ${extract{3}{:}{${lookup passwd{${lookup{$domain}lsearch* {/etc/userdomains}{$value}}}{$value}}}}
  1951.   log_output = true
  1952.   current_directory = "/tmp"
  1953.   return_fail_output = true
  1954.   return_path_add = false
  1955.  
  1956. virtual_userdelivery:
  1957.   driver = appendfile
  1958.   delivery_date_add
  1959.   envelope_to_add
  1960.   directory = "${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/mail/${domain}/${local_part}"
  1961.   maildir_use_size_file
  1962.   maildir_quota_directory_regex = ^(?:cur|new|\.(?!Trash$)[^\@]+)$
  1963.   maildir_format
  1964.   maildir_tag = ,S=$message_size
  1965.   quota_size_regex = ,S=(\d+)
  1966.   mode = 0660
  1967.   quota = "${if exists{${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/${domain}/quota} {${lookup{$local_part}lsearch*{${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/${domain}/quota}{$value}}} {}}"
  1968.   quota_is_inclusive = false
  1969.   quota_directory = "${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/mail/${domain}/${local_part}"
  1970.   return_path_add
  1971.   user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  1972.   group = ${extract{3}{:}{${lookup passwd{${lookup{$domain}lsearch* {/etc/userdomains}{$value}}}{$value}}}}
  1973.   shadow_condition = ${if exists {${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/.cpanel/rim/bis/$local_part@$domain}{1}{0}}
  1974.   shadow_transport = rim_bis_notifier_virtual_user
  1975.  
  1976.  
  1977.  
  1978. rim_bis_notifier_virtual_user:
  1979.   driver = pipe
  1980.   headers_only
  1981.   command = /usr/local/cpanel/bin/rim_bis_notifier "${local_part}@${domain}"
  1982.   user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  1983.   group = ${extract{3}{:}{${lookup passwd{${lookup{$domain}lsearch* {/etc/userdomains}{$value}}}{$value}}}}
  1984.   log_output = true
  1985.   current_directory = "/tmp"
  1986.   return_fail_output = true
  1987.   return_path_add = false
  1988.  
  1989.  
  1990.  
  1991. address_reply:
  1992.   driver = autoreply
  1993.  
  1994.  
  1995.  
  1996. # cPanel Mail Archiving is disabled
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006. ######################################################################
  2007. #                      RETRY CONFIGURATION                           #
  2008. ######################################################################
  2009.  
  2010. # This single retry rule applies to all domains and all errors. It specifies
  2011. # retries every 15 minutes for 2 hours, then increasing retry intervals,
  2012. # starting at 1 hour and increasing each time by a factor of 1.5, up to 16
  2013. # hours, then retries every 8 hours until 4 days have passed since the first
  2014. # failed delivery.
  2015.  
  2016. # Domain               Error       Retries
  2017. # ------               -----       -------
  2018.  
  2019.  
  2020. begin retry
  2021.  
  2022. *           quota
  2023.  
  2024.  
  2025.  
  2026. *                      *           F,2h,15m; G,16h,1h,1.5; F,4d,8h
  2027.  
  2028.  
  2029.  
  2030.  
  2031. # End of Exim 4 configuration
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement