LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 10-24-2008, 04:51 AM   #1
inaki
Member
 
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 mian.cf

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

In sender_access file u can define whatever address such as

yahoo.com 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: 59
Use a regexp or pcre map:

Code:
/etc/postfix/main.cf:

    smtpd_sender_restrictions =
        check_sender_access      pcre:/etc/postfix/sender_access


/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
inaki
Member
 
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: 59
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.
 
  


Reply


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
Sendmail: how to reject incoming spam spoofed from internal addresses krasl Linux - Server 2 03-17-2008 11:47 AM
Postfix: reject emails for list of recipient domains zaheer99 Linux - Server 1 01-02-2008 09:10 PM
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 04:44 AM.

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