Skip to content

[FR] Add environment variable to add reject_unknown_reverse_client_hostname & reject_unknown_client_hostname to smtpd_sender_restrictions #2650

@GoliathLabs

Description

@GoliathLabs

Feature Request

Context

I was receiving quite some amount of spam from servers with invalid reverse DNS records (or none at all)

Is your Feature Request related to a Problem?

After manually adding the following to my user-patches.sh, these servers are no longer able to send spam to my server because their reverse client hostname does not match the current record or they do not specify a hostname at all.

sed -i "s/smtpd_sender_restrictions = /smtpd_sender_restrictions = reject_unknown_reverse_client_hostname, /" /etc/postfix/main.cf
sed -i "s/smtpd_sender_restrictions = /smtpd_sender_restrictions = reject_unknown_client_hostname, /" /etc/postfix/main.cf

Describe the Solution you'd like

It might be a good idea to make this configurable, so that you can choose whether to let such servers deliver mail or not. Some mail providers (especially the home-made ones) might not have a reverse DNS record, so everyone should be able to decide for themselves if they want to block these servers.

Are you going to implement it?

Yes, because I know the probability of someone else doing it is low and I can learn from it.

What are you going to contribute??

A PR with the appropriate patch.

Additional context

Alternatives you've considered

Not implementing it at all and sticking with the user-patches.sh file

Who will that Feature be useful to?

Those who suffer from a lot of spam from these rouge mail servers

What have you done already?

Added the above mentioned lines to my user-patches.sh file

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions