Postfix virtual mailbox whitelist?

Hi,

Would it be possible to configure postfix to accept email from only 1 domain for 1 virtual mailbox and leave the rest alone?

Say that my public email address used to accept payments from PayPal is paypal@mydomain.com

Now, bots get to conveniently troll websites for the email address in the Buy Now forms, etc and proceed to hit me with tons of spam.

The only emails I wish to have accepted for delivery to this address are from paypal.com and nobody else.

Now, I have other virtual accounts on my postfix server so how would I go about doing this without affecting delivery to my other virtual addresses?

Thanks!!

3 Replies

http://www.postfix.org/RESTRICTIONCLASSREADME.html

The example of protecting an e-mail list should do what you want, if I understand correctly.

Hmmm. Maybe I'm just daft but from what I can see, that text describes making a global restrictive policy.

I just want to restrict people from sending mail to 1 address out of many virtual ones.

so let's say I have:

v@y.com

w@y.com

x@y.com

y@y.com

z@y.com

But if anybody tries to send email to y@y.com, reject it outright if it's not from some@domain.com

I didn't see any way to do that from what I read. Or am I missing something?

Thanks

Restriction classes should do it - it's a very specific application of what was designed as a general method. The authorisation is based on the sender SMTP envelope address, so it can be spoofed.

Put in /etc/postfix/main.cf:

smtpd_recipient_restrictions = 
check_recipient_access hash:/etc/postfix/protected_destinations 
...the usual stuff... 

smtpd_restriction_classes = authorised_senders 
authorised_senders = check_sender_access hash:/etc/postfix/OK_senders, reject 

Put in /etc/postfix/protected_destinations:

y@y.com   authorised_senders 

Put in /etc/postfix/OK_senders:

some@domain.com   OK 

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct