Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 10-24-2008, 04:51 AM   #1
Registered: Mar 2005
Posts: 94

Rep: Reputation: 15
How to reject addresses by TLD in Postfix?

Dear all,
I know that postfix can reject sender address by defining in

"smtpd_sender_restrictions = hash:/etc/postfix/sender_access".

In sender_access file u can define whatever address such as REJECT

My question is how can i reject the whole domain instead of full address like .jp, .ro, .my

Thank You
Old 10-26-2008, 03:19 AM   #2
Mr. C.
Senior Member
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
Use a regexp or pcre map:


    smtpd_sender_restrictions =
        check_sender_access      pcre:/etc/postfix/sender_access


    /\.jp$/           REJECT Mail from .jp not accepted
    /\.ro$/           REJECT Mail from .ro not accepted
    /\.my$/           REJECT Mail from .my not accepted
Old 10-26-2008, 01:11 PM   #3
Registered: Mar 2005
Posts: 94

Original Poster
Rep: Reputation: 15
and after that i need to issue command postmap /etc/postfix/sender_access. Is it right
Old 10-26-2008, 01:32 PM   #4
Mr. C.
Senior Member
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
Never postmap for regexp or pcre tables. A postfix reload will cause postfix to read the tables immediately (or at its earliest convenience).

Last edited by Mr. C.; 10-26-2008 at 01:54 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix: reject emails for list of recipient domains zaheer99 Linux - Server 3 11-11-2016 11:23 AM
Sendmail: how to reject incoming spam spoofed from internal addresses krasl Linux - Server 2 03-17-2008 11:47 AM
HELO Reject Errors On Email (POSTFIX) carlosinfl Linux - Server 8 10-22-2007 04:00 PM
how to configure postfix to reject spams xlh3110 Linux - Server 18 12-19-2006 09:08 AM
Postfix, reject some system users? Chowroc Linux - Networking 3 02-01-2005 08:54 AM

All times are GMT -5. The time now is 09:56 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration