?
Solved

How to Whitelist/Blacklist /IP addresses on Postfix

Posted on 2008-06-11
6
Medium Priority
?
3,041 Views
Last Modified: 2013-12-16
We have a Linux Server and on that we are running Centos 4.4, i have created Exchange distribution groups but they are not working, because i believe they need to be whitelisted under postfix so that they reach to Exchange Server, now i am stuck at that.
Can anyone please guide me step by step on how to do that, because i am not that much familiar with Linux.

Thanks.
0
Comment
Question by:usmansultan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 32

Expert Comment

by:Kamran Arshad
ID: 21766198
0
 
LVL 1

Author Comment

by:usmansultan
ID: 21766221
I have already came across that tutorial, but i believe we already have a file in which host names are listed which are allowed, so in that tutorial where should i start, and how to get there and access it.......
0
 
LVL 32

Expert Comment

by:Kamran Arshad
ID: 21766289
Hi,

So it is not whitelisting even after following the howtoforge tutorial. What are the values in the SMTP logs?
0
How to Create Failover DNS Record Sets in Route 53

Route 53 has the ability to easily configure DNS record sets specifically for failover scenarios. These failover record sets can be configured to failover to full-blown deployments in other regions or to a static HTML page that informs your customers of the issue.

 
LVL 1

Author Comment

by:usmansultan
ID: 21766389
I have to do the whitelisting under postfix, as i said earlier i am not sure how to access the whitelisting file and how to reach there.....

The SMTP error is;


Reporting-MTA: dns;bay0-omc1-s23.bay0.hotmail.com
Received-From-MTA: dns;BAY131-W27
Arrival-Date: Wed, 11 Jun 2008 19:11:56 -0700

Final-Recipient: rfc822;rtafacet@facet.com.au
Action: failed
Status: 5.5.0
Diagnostic-Code: smtp;554 <rtafacet@facet.com.au>: Recipient address rejected: Access denied
0
 
LVL 1

Expert Comment

by:EmpireIron
ID: 21796567
do a search for local.cf
I believe that is the file you're looking for.
0
 
LVL 1

Accepted Solution

by:
usmansultan earned 0 total points
ID: 22149599
Worked out by doing the following steps.

The whitelist is maintained on the linux based proxy server as part of the postfix software suite.  Postfix refers to a table implemented in the file /etc/postfix/whitelist.db to determine what action to take when processing an incoming email.  This file is referenced in the main configuration file of /etc/postfix/main.cf, the relevant entry being
smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/whitelist, permit_mynetworks, reject_unauth_destination, reject
Reference material for postfix can be found at http://www.postfix.org.  
Maintenance
Maintenance of the whitelist table is achieved by editing a standard text file, converting this to a table and then making this table available to the postfix service.
Update text file
Logon to the proxy server with suitable credentials.  At the command prompt issue the commands
pushd /etc/postfix/
vi whitelist.txt
These commands
a) Set the current directory to the location of the files of interest while retaining the previous working directory, reducing typing, and,
b) Invoke the editor vi to allow you to update the file.  

Update the text file as needed bearing in mind the following rules
(a)A table entry has the form
<email address><whitespace>permit
where the email address cannot contain whitespace characters.
(b)Empty lines and whitespace-only lines are ignored, as are lines whose first non-whitespace character is a #
(c)A logical line starts with non-whitespace text.  A line  that starts with whitespace continues a logical line
(d)Entries are not case sensitive
 
Press i to enter into Insert Mode
Once finished adding the email addresses enter
:wq
To save the document and quit Vi.
 
 
Comment out lines no longer required by inserting a # symbol at the beginning of the line and the current date in the format dd  Mmm yyyy at the end of the line.  Insert new lines in the correct alphabetic sequence.
Convert to a table
The postfix application provides a program, postmap, to support the operation of converting a text file into a table for use with postfix.
postmap hash:whitelist.txt
will create a file /etc/postfix/whitelist.txt.db.
If there are errors, messages will be displayed.  Conversely, if there are no error messages, the process has been successful.
The table in active use is /etc/postfix/whitelist.db and you have just created the /etc/postfix/whitelist.txt.db file.  If the creation is successful, you now need to copy this new database file over the existing one.
mv whitelist.txt.db whitelist.db
The response should be
mv: overwrite whitelist.db?
Key in y and press the Enter key.
Activate the table
The postfix service can be reinitialised by using the command
service postfix reload
The response to this should be
Reloading postfix:                                         [  OK  ]
This completes the process.  The changes are now in effect.  Revert to the original working directory.
popd
0

Featured Post

Major Serverless Shift

Comparison of major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month10 days, 6 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question