0

I have few persons that are trying to harass my mail. I want to instruct postfix to reject mail from those email address, and send them response that mail is not delivered.

In my /etc/postfix/sender_access I have the following:

[email protected] REJECT 470

My relevant main.cf configuration:

smtpd_recipient_restrictions =
  permit_mynetworks,
  permit_sasl_authenticated,
  reject_non_fqdn_hostname,
  reject_non_fqdn_sender,
  reject_non_fqdn_recipient,
  reject_unauth_destination,
  reject_unauth_pipelining,
  reject_invalid_hostname,
  reject_rbl_client bl.spamcop.net,
  reject_rbl_client sbl-xbl.spamhaus.org,
  reject_rbl_client zen.spamhaus.org,
  check_sender_access hash:/etc/postfix/sender_access,

` Log file:

Aug 06 20:30:02 mail-01 postfix/smtpd[2208]: NOQUEUE: reject: RCPT from mail-server.ch[IP]: 470 4.7.1 <[email protected]>: Sender address rejected: 470; from=<[email protected]> to=<mymail@com> proto=ESMTP helo=<mail-server.ch>

I see that mailserver keeps retrying, so after all of tries, will it inform the sender that mail isn't delivered?

My ultimate goal would be:

Sender '[email protected]' sends a mail to me, and my mailserver immediately bounce it back, with error.

Thanks.

1 Answer 1

4

If you don't want the sending server to re-attempt delivery then you should use an error code indicating that.

4XX error codes generally mean temporary problem, try again later.

5XX error codes generally mean Delivery failed, don't try again.

In short, it's retrying because you instructed the server to.

Reference: Wikipedia: List of SMTP server return codes

2
  • Thank you for answer, mind to collaborate, i don't follow. Is my /etc/postfix/sender_access invalid in this case? I am aware of response code, but how to instruct postfix to bounce mail back?
    – fugitive
    Aug 6, 2020 at 21:09
  • @fugitive Yes, simply changing 470 to 570 should get the results you're looking for.
    – user143703
    Aug 6, 2020 at 23:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .