0

I have recipient throttling (quotas) enabled on cluebringer and it's working well. However, every time someone is being throttled, postfix sends back a bounce mail.

I do not want it to send back a bounce mail if an email has been rejected by cluebringer. Do you know how I can do this?

Given below is my postconf -n

$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
mydestination = myserver.com, localdomain, localhost, localhost.localdomain, localhost
myhostname = myhostname.compute.internal
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_discard_ehlo_keywords = silent-discard, dsn
smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:10031
smtpd_recipient_restrictions = check_policy_service inet:127.0.0.1:10031
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
masegaloeh
  • 18,236
  • 10
  • 57
  • 106
Manu
  • 11
  • 3
  • If you want to disable bounce mail, then how do the user would know that his email wasn't sent because of overquota? – masegaloeh Dec 11 '14 at 20:57
  • This is for the case where a user is sending me too many emails by mistake. I don't want my server to waste bandwidth in responding to every email. – Manu Dec 11 '14 at 23:36

1 Answers1

1

Do you really mean that Postfix sends a bounce? Or do you mean it rejects the incoming message with a 5xx code and then the sending MTA sends a bounce? Also, you don't say how policyd is configured - it tells Postfix whether to REJECT (5xx) or DEFER (4xx), and I'm guessing you want the latter so that the sending MTA retries until the user is under quota again.

If my understanding is correct, you can either change policyd to defer, or maybe amend your config like:

smtpd_end_of_data_restrictions = defer_if_reject check_policy_service inet:127.0.0.1:10031
smtpd_recipient_restrictions = defer_if_reject check_policy_service inet:127.0.0.1:10031

Edit: The "554 5.7.1 : Recipient address rejected: Policy rejection; Message count quota exceeded" is a reject SMTP response, not itself a bounce. There must be some other MTA involved besides myserver.com (eg if you are emailing blah@myserver.com from a Yahoo account for some reason, the DSN is coming from Yahoo).

Yes, discarding mail is certainly "unconventional" and MTAs are designed not to do it, but you can probably specify Verdict: DISCARD in cluebringer). See man 5 access and http://wiki.policyd.org/accesscontrol. There is no "discard_if_reject" keyword, but maybe you can have policyd return DUNNO and put discard at the end of the restriction.

You might also want to blackhole by piping to /dev/null in procmail.

Cedric Knight
  • 1,108
  • 7
  • 20
  • I'm a newb at this stuff but I believe its postfix that's sending a DSN. This is the message I get if I send too many emails: 554 5.7.1 : Recipient address rejected: Policy rejection; Message count quota exceeded Also, I don't want it to defer. I want it to appear to the sender that I accepted their message but really, I just want to discard it. I know this is not conventional but this is being done for when the sender is spamming my server by mistake. If I defer, it will build up a longer queue and continue to spam me for the next few hours. – Manu Dec 11 '14 at 23:30
  • Also, if the user has a real message to send, they can't send it because there is a queue. – Manu Dec 11 '14 at 23:34