Guest User

Untitled

a guest
May 27th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.38 KB | None | 0 0
  1. We are running SpamAssassin as a content filter from Postfix.
  2.  
  3. Here's what we have in master.cf
  4.  
  5. smtp inet n - n - - smtpd
  6. -o content_filter=spamchk:dummy
  7.  
  8. spamchk unix - n n - 10 pipe
  9. flags=Rq user=spammonster argv=/usr/local/bin/spamchk -f ${sender} -- ${recipient}
  10.  
  11. This is working. However, apparently the spamchk content filter is
  12. running _before_ Postfix rejects mail to non-existent addresses.
  13.  
  14. Given that 95% of our inbound mail is to non-existent addresses, this
  15. is terribly inefficient.
  16.  
  17. Unfortunately I have no clue how to order the PostFix processing to
  18. ensure that the address check comes before the content filter. (I
  19. naively thought this would be the "normal" ordering.)
  20.  
  21.  
  22. Here's what we've got in our Postfix config files
  23.  
  24.  
  25. master.cf
  26.  
  27. # Services
  28. # ==========================================================================
  29. # service type private unpriv chroot wakeup maxproc command + args
  30. # (yes) (yes) (yes) (never) (100)
  31. # ==========================================================================
  32. smtp inet n - n - - smtpd
  33. -o content_filter=spamchk:dummy
  34. pickup fifo n - n - 1 pickup
  35. cleanup unix n - n - 0 cleanup
  36. qmgr fifo n - n - 1 qmgr
  37. rewrite unix - - n - - trivial-rewrite
  38. bounce unix - - n - 0 bounce
  39. defer unix - - n - 0 bounce
  40. trace unix - - n - 0 bounce
  41. verify unix - - n - 1 verify
  42. flush unix n - n - 0 flush
  43. proxymap unix - - n - - proxymap
  44. smtp unix - - n - - smtp
  45. relay unix - - n - - smtp
  46. showq unix n - n - - showq
  47. error unix - - n - - error
  48. local unix - n n - - local
  49. virtual unix - n n - - virtual
  50. lmtp unix - - n - - lmtp
  51. anvil unix - - n - 1 anvil
  52.  
  53.  
  54. #
  55. # Interfaces to non-Postfix software. Be sure to examine the manual
  56. # pages of the non-Postfix software to find out what options it wants.
  57. maildrop unix - n n - - pipe
  58. flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
  59. spamchk unix - n n - 10 pipe
  60. flags=Rq user=spammonster argv=/usr/local/bin/spamchk -f ${sender} -- ${recipient}
  61.  
  62. ========================================================================
  63. main.cf
  64.  
  65. alias_database = hash:/etc/postfix/aliases
  66. alias_maps = hash:/etc/postfix/aliases
  67. default_destination_concurrency_limit = 5
  68. default_process_limit = 500
  69. disable_vrfy_command = yes
  70. inet_interfaces = all
  71. initial_destination_concurrency = 2
  72. local_destination_concurrency_limit = 2
  73. local_recipient_maps = $virtual_alias_maps $alias_maps
  74. mailbox_size_limit = 0
  75. masquerade_domains = cfcl.com
  76. message_size_limit = 10240000
  77. mydestination = $myhostname,$mydomain
  78. mydomain = cfcl.com
  79. myhostname = g3po.cfcl.com
  80. mynetworks = /etc/postfix/mynetworks
  81. smtp_helo_name = $mydomain
  82. smtpd_banner = $mydomain ESMTP $mail_name
  83. smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/access
  84. strict_rfc821_envelopes = yes
  85. unknown_local_recipient_reject_code = 550
  86. virtual_alias_maps = hash:/etc/postfix/virtual
  87.  
  88. smtpd_recipient_restrictions =
  89. permit_mynetworks,
  90. permit_sasl_authenticated,
  91. reject_unauth_destination,
  92. reject_invalid_hostname,
  93. reject_unauth_pipelining,
  94. reject_non_fqdn_sender,
  95. reject_unknown_sender_domain,
  96. reject_non_fqdn_recipient,
  97. reject_unknown_recipient_domain,
  98. permit
Add Comment
Please, Sign In to add comment