LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 03: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, 02:19 AM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
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, 12: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, 12:32 PM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
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 12:54 PM.
 
  


Reply



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 10:23 AM
Sendmail: how to reject incoming spam spoofed from internal addresses krasl Linux - Server 2 03-17-2008 10:47 AM
HELO Reject Errors On Email (POSTFIX) carlosinfl Linux - Server 8 10-22-2007 03:00 PM
how to configure postfix to reject spams xlh3110 Linux - Server 18 12-19-2006 08:08 AM
Postfix, reject some system users? Chowroc Linux - Networking 3 02-01-2005 07:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

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
Open Source Consulting | Domain Registration