Vijay Kumar Gajula
asked on
Reject incoming email for specific user - postfix
Can any one let me know how to block incoming emails for specif user / id in Postfix. Other's should get mails normally.
Please let me know the procedure.
Please let me know the procedure.
ASKER
Thanks for quick response, My requirement is different I need to block mails to particular mail id in my mail server. for example.. my domain name is abc.com I have created user as 1@abc.com, 2@abc.com... . Now 1@abc should not receive any mail from out side (external mails).
In this case, how to move forward.
Thanks
In this case, how to move forward.
Thanks
You would need to use a filter prior to delivery checking if the sender is external to the local domain, then either reject or drop the message.
What is the reason for the close selecting a comment that NLA doscribes what you want?
I provided you various suggestions to achieve it depending on what your setup is.
I provided you various suggestions to achieve it depending on what your setup is.
ASKER
Hi Arnold, Please let me know what went wrong with me?
I do not know, you commented what you want and the selected that comment as the answer.
To limit an email to receiving only internal emails, meaning from local/known domains means that you have to make that determination either during the local delivery using a filter that checks the sending domain against a list of allowed or implement some milter on the incoming (SMTP session processing) which has a backend db, or someway to reference incoming recipient and their rules/rights.
....
How many such users/email addresses do you have? What does your mail setup consist of, post of, backend MySQL, etc?
To limit an email to receiving only internal emails, meaning from local/known domains means that you have to make that determination either during the local delivery using a filter that checks the sending domain against a list of allowed or implement some milter on the incoming (SMTP session processing) which has a backend db, or someway to reference incoming recipient and their rules/rights.
....
How many such users/email addresses do you have? What does your mail setup consist of, post of, backend MySQL, etc?
ASKER
we are using Postfix Mail server with about 100 users.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
Open /etc/postfix/sender_access
# cd /etc/postfix
# vi sender_access
Append sender email id as follows:
user@abadboy.com REJECT
Save and close the file. Use postmap command to create a database:
# postmap hash:sender_access
Now open main.cf and add code as follows:
smtpd_recipient_restrictio
Save and close the file. Restart / reload postfix MTA:
# /etc/init.d/postfix restart
You can also use spamassassin to blacklist email address. Just add to your own spamassassin configuration or to /etc/mail/spamassassin/loc
# vi /etc/mail/spamassassin/loc
Append blacklist as follows:
blacklist_from user@abadboy.com
Save and close the file. Restart spamassassin:
# /etc/init.d/spamassassin restart
spamassassin will marke mail as SPAM instead of rejecting the same.