查看完整版本: [轉貼]Postfix blacklist or reject an email address

chun 2011-6-16 10:56

[轉貼]Postfix blacklist or reject an email address

http://www.cyberciti.biz/faq/howto-blacklist-reject-sender-email-address/<br><div class="post-663 post type-post status-publish format-standard hentry category-centos category-email-servers category-linux tag-access-file tag-blacklist tag-centos-linux tag-email tag-linux-server tag-postfix tag-sender-address tag-smtp-server tag-spamassassin post_box top" id="post-663">
                                <div class="headline_area">
                                        <h1 class="entry-title">Postfix blacklist or reject an email address</h1>
                                        <p class="headline_meta">by <span class="author vcard fn">Vivek Gite</span> on <abbr class="published" title="2007-07-04">July 4, 2007</abbr> · <span><a href="http://www.cyberciti.biz/faq/howto-blacklist-reject-sender-email-address/#comments" rel="nofollow">14 comments</a></span></p>
                                </div>
                                <div class="format_text entry-content">
<div style="float:right;margin-top:0px;margin-left:5px;"><a href="http://www.cyberciti.biz/faq/category/email-servers/" title="See all Postfix Mail Server related FAQ"><img src="http://files.cyberciti.biz/cbzcache/3rdparty/postfix-logo.gif" border="0"></a></div>
<p><strong><span style="color: rgb(255, 0, 0);">Q</span></strong>. I’ve
Postfix based CentOS Linux server. I need to blacklist email ID:
user@abadboy.com . How do I blacklist email address with postfix? I also
have spamassassin software installed.</p>
<p><strong><span style="color: rgb(0, 153, 0);">A</span></strong>.     
By default, the Postfix SMTP server accepts any sender address. However
you can block / blacklist sender email address easily with Postfix. It
has SMTP server access table. </p>
<p>Open /etc/postfix/sender_access file<br>
<code># cd /etc/postfix<br>
# vi sender_access </code><br>
Append sender email id as follows:<br>
<code>user@abadboy.com  REJECT</code><br>
Save and close the file. Use postmap command to create a database:<br>
<code># postmap hash:sender_access </code><br>
Now open main.cf and add code as follows:<br>
<code>smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/sender_access</code><br>
Save and  close the file. Restart / reload postfix MTA:<br>
<code># /etc/init.d/postfix restart</code></p>
<p>You can also use spamassassin to blacklist email address. Just add to
your own spamassassin configuration or to
/etc/mail/spamassassin/local.cf file:<br>
<code># vi /etc/mail/spamassassin/local.cf</code><br>
Append blacklist as follows:<br>
<code>blacklist_from   user@abadboy.com</code><br>
Save and close the file. Restart spamassassin:<br>
<code># /etc/init.d/spamassassin restart</code></p>
<p>spamassassin will marke mail as SPAM instead of rejecting the same.</p>
<h4>Featured Articles:</h4>
                <ul><li><a href="http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html">20 Linux System Monitoring Tools Every SysAdmin Should Know</a></li><li><a href="http://www.cyberciti.biz/tips/linux-security.html">20 Linux Server Hardening Security Tips</a></li><li><a href="http://www.cyberciti.biz/tips/my-10-unix-command-line-mistakes.html">My 10 UNIX Command Line Mistakes</a></li><li><a href="http://www.cyberciti.biz/tips/linux-laptop.html">The Novice Guide To Buying A Linux Laptop</a> <img style="vertical-align: text-top; padding-left: 1px;" src="http://files.cyberciti.biz/assets/i/new_fa.png" alt="" border="0"></li><li><a href="http://www.cyberciti.biz/tips/10-greatest-open-source-software-of-2009.html">10 Greatest Open Source Software Of 2009</a></li><li><a href="http://www.cyberciti.biz/tips/download-email-client-for-linux-mac-osx-windows.html">Top 5 Email Client For Linux, Mac OS X, and Windows Users</a></li><li><a href="http://www.cyberciti.biz/tips/linux-unix-bsd-openssh-server-best-practices.html">Top 20 OpenSSH Server Best Security Practices </a></li><li><a href="http://www.cyberciti.biz/tips/open-source-project-management-software.html">Top 10 Open Source Web-Based Project Management Software</a></li><li><a href="http://www.cyberciti.biz/faq/top5-linux-video-editing-system-software/">Top 5 Linux Video Editor Software</a></li></ul>
                                        </div>
                        </div><br>
頁: [1]
查看完整版本: [轉貼]Postfix blacklist or reject an email address