<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>百里挑一</title> 
<link>http://www.admin99.net/index.php</link> 
<description>linux命令 &#124; seo优化技术 &#124; linux系统管理员指南 --我的学习园地</description> 
<language>zh-cn</language> 
<copyright>Powered by Bo-blog 2.0.2 sp2</copyright>
<item>
<link>http://www.admin99.net/read.php?475</link>
<title>IRedMail无法处理队列 status=deferred (delivery temporarily suspended: lost connection with 127.0.0.1[127. 0.0.1] while sending RCPT TO)</title> 
<author>real &lt;real@admin99.net&gt;</author>
<category>mail</category>
<pubDate>Fri, 23 Apr 2010 04:13:11 +0000</pubDate> 
<guid>http://www.admin99.net/read.php?475</guid> 
<description>
<![CDATA[ 
	邮件服务器上收发邮件都失效了<br/>查看日志有大量类似这样的记录<br/>status=deferred (delivery temporarily suspended: lost connection with 127.0.0.1[127.<br/>0.0.1] while sending RCPT TO)<br/>然后发现 /var/amavis/tmp/和/var/virusmails 下的临时文件特别多。清理了一下。恢复正常<br/>然后在cron中做定时处理<br/>find /var/virusmails/*&#124;xargs rm -rf <br/>find /var/amavis/tmp/*&#124;xargs rm -rf <br/>Tags - <a href="http://www.admin99.net/tag.php?tag=mail" rel="tag">mail</a>
  ]]> 
</description>
</item><item>
<link>http://www.admin99.net/read.php?474</link>
<title>postfix 邮件日志分析 工具 pflogsumm</title> 
<author>real &lt;real@admin99.net&gt;</author>
<category>mail</category>
<pubDate>Tue, 20 Apr 2010 09:42:26 +0000</pubDate> 
<guid>http://www.admin99.net/read.php?474</guid> 
<description>
<![CDATA[ 
	安装<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">cd /usr/src<br/>wget http://jimsun.linxnet.com/downloads/pflogsumm-1.1.1.tar.gz<br/>tar xzf pflogsumm-1.1.1.tar.gz<br/>mv pflogsumm-1.1.1 /data/bash/maillog</div></div><br/><br/>将处理邮件的命令写入脚本<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">cd /data/bash/maillog</div></div><br/>vi maillog<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">/data/bash/maillog/pflogsumm.pl -d yesterday --problems_first --rej_add_from --verbose_msg_detail `ls -rt /var/log/maillog*` > /data/htdocs/maillog/maillog.$(date +%Y%m%d -d yesterday)</div></div><br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">chmod 777 /data/bash/maillog/maillog</div></div><br/><br/>设置存放分析结果的目录，我放到apache的htdocs下了，所以加了密码验证<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">mkdir /data/htdocs/maillog<br/>cd /data/htdocs/maillog</div></div><br/>vi .htaccess<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">AuthType Basic<br/>AuthName "need password"<br/>AuthUserFile /data/htdocs/maillog/.password<br/>Require user mail</div></div><br/>生成密码文件<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">htpasswd -c /data/htdocs/maillog/.password mail</div></div><br/>加入cron<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">10 2 * * * /data/bash/maillog/maillog</div></div><br/>Tags - <a href="http://www.admin99.net/tag.php?tag=mail" rel="tag">mail</a>
  ]]> 
</description>
</item><item>
<link>http://www.admin99.net/read.php?471</link>
<title>解决php函数mail()调用postfix或sendmail发邮件时return-path于发件人不符合的问题</title> 
<author>real &lt;real@admin99.net&gt;</author>
<category>mail</category>
<pubDate>Wed, 14 Apr 2010 13:48:33 +0000</pubDate> 
<guid>http://www.admin99.net/read.php?471</guid> 
<description>
<![CDATA[ 
	就是在标准的mail()函数的最后加个辅助参数<br/>$mailconf = "-f".$from;<br/>mail($to,$subject,$message,$headers,$mailconf);<br/>Tags - <a href="http://www.admin99.net/tag.php?tag=mail" rel="tag">mail</a>
  ]]> 
</description>
</item><item>
<link>http://www.admin99.net/read.php?404</link>
<title>关于反垃圾邮件组织</title> 
<author>real &lt;real@admin99.net&gt;</author>
<category>mail</category>
<pubDate>Thu, 04 Dec 2008 08:07:51 +0000</pubDate> 
<guid>http://www.admin99.net/read.php?404</guid> 
<description>
<![CDATA[ 
	一台邮件服务器，近期发的信件很多被退回了，退回的原因都是“拒绝”<br/>一般情况下，被大量的邮件服务器给拒绝，基本上是被国际上的一些反垃圾邮件组织给盯上了。<br/>如果不是专门发垃圾邮件为生的，也不用太担心。找到这些组织申诉一下就可以了<br/>但是互联网上的反垃圾邮件组织有几十个，怎么知道被哪个跟封了呢？总不能一个一个查吧。<br/>下面这个地址很好用，一次就把所有的反垃圾邮件组织给查了。。<br/><a href="http://www.dnsbl.info/dnsbl-database-check.php" target="_blank">http://www.dnsbl.info/dnsbl-database-check.php</a><br/><br/>Tags - <a href="http://www.admin99.net/tag.php?tag=mail" rel="tag">mail</a>
  ]]> 
</description>
</item><item>
<link>http://www.admin99.net/read.php?351</link>
<title>535 5.7.0 authentication failed</title> 
<author>real &lt;real@admin99.net&gt;</author>
<category>mail</category>
<pubDate>Thu, 11 Sep 2008 07:54:21 +0000</pubDate> 
<guid>http://www.admin99.net/read.php?351</guid> 
<description>
<![CDATA[ 
	一台原本正常运行的邮件服务器，发信时无法验证了。<br/>用foxmail发送的时候，提示 535 5.7.0 authentication failed<br/>看邮件日志里显示的是<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>sendmail[26290]: m8B7k2bQ026290: 212.52.37.58.broad.xw.sh.dynamic.163data.com.cn [58.37.52.212] (may be forged) did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA<br/></div></div><br/>用户名和密码应该是不会有错了<br/>用testsaslauthd命令测试了一下<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>testsaslauthd -u kefu -p 123456<br/></div></div><br/>返回 connect() : No such file or directory<br/>看起来是没有连接到saslauthd 验证服务。<br/>pa aux&#124;grep sasl 发现，没有用以验证的 saslauthd进程<br/>于是重启了一下saslauthd服务<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>/etc/init.d/saslauthd start<br/></div></div><br/>再用 testsaslauthd -u kefu -p 123456 测试，返回 0: OK "Success."<br/>再用foxmail发信，正常了。<br/>至于saslauthd进程为什么会异常退出，还没有找到原因。<br/>Tags - <a href="http://www.admin99.net/tag.php?tag=mail" rel="tag">mail</a>
  ]]> 
</description>
</item><item>
<link>http://www.admin99.net/read.php?333</link>
<title>dovecot的安装和使用－rpm篇</title> 
<author>real &lt;real@admin99.net&gt;</author>
<category>mail</category>
<pubDate>Wed, 23 Jul 2008 05:45:18 +0000</pubDate> 
<guid>http://www.admin99.net/read.php?333</guid> 
<description>
<![CDATA[ 
	Dovecot是一个IMAP服务器，它非常关注服务器安全性。它速度很快、扩展性好，而且很轻巧，同时支持Maildir和mbox格式。<br/><br/>安装rpm包<br/><br/>as4.6系统自带了dovecot-0.99.11-8.EL4.i386.rpm，可以在安装光盘上找到<br/>先看看系统里面是不是安装了<br/>rpm -qa&#124;grep dovecot<br/>如果没有，安装一下就可以了<br/>rpm -ivh dovecot-0.99.11-8.EL4.i386.rpm<br/><br/>配置<br/><br/>vi /etc/dovecot.conf<br/>找到<br/>#protocols = imap imaps<br/>将协议设置为pop3<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">protocols = pop3</div></div><br/>保存退出<br/><br/>启动<br/><br/>/etc/init.d/dovecot start 或者 service dovecot start<br/>Tags - <a href="http://www.admin99.net/tag.php?tag=mail" rel="tag">mail</a> , <a href="http://www.admin99.net/tag.php?tag=%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86" rel="tag">系统管理</a>
  ]]> 
</description>
</item><item>
<link>http://www.admin99.net/read.php?328</link>
<title>redhat as3上配置sendmail+pop3 系统用户 含发信验证功能</title> 
<author>real &lt;real@admin99.net&gt;</author>
<category>mail</category>
<pubDate>Thu, 17 Jul 2008 02:06:17 +0000</pubDate> 
<guid>http://www.admin99.net/read.php?328</guid> 
<description>
<![CDATA[ 
	redhat as3上配置sendmail+pop3 系统用户 含发信验证功能<br/>系统 redhat as 3 update 8<br/>一般情况下安装系统的时候，sendmail都是默认安装的<br/>执行 rpm -qa&#124;grep sendmail 检查一下<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">rpm -qa&#124;grep sendmail<br/>sendmail-8.12.11-4.RHEL3.6<br/>sendmail-cf-8.12.11-4.RHEL3.6<br/>sendmail-doc-8.12.11-4.RHEL3.6<br/>sendmail-devel-8.12.11-4.RHEL3.6</div></div><br/>pop3功能，目前有两个比较流行的软件可以实现，一个是imap，一个是dovecot。本例中用的是imap<br/>一般情况下安装系统的时候，imap也是默认安装的<br/>执行 rpm -qa&#124;grep imap 检查一下<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">rpm -qa&#124;grep imap<br/>php-imap-4.3.2-33.ent<br/>imap-devel-2002d-12<br/>imap-utils-2002d-12<br/>imap-2002d-12</div></div><br/><br/>配置sendmail<br/>1。配置本地域名<br/>vi /etc/mail/local-host-names<br/>添加一下本地的域名，比如我的邮件是 real@admin99.net 那么就填写 admin99.net 就可以了<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"># local-host-names - include all aliases for your machine here.<br/>admin99.net</div></div><br/>2。配置邮件转发<br/>配置邮件转发能让允许通过客户端发送邮件到其它服务器。比如通过我服务器发到sohu、163、gmail去。<br/>vi /etc/mail/access<br/>添加一行<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">0.0.0.0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RELAY</div></div><br/>然后执行一下<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">makemap hash /etc/mail/access < /etc/mail/access</div></div><br/>生成新的access.db<br/>我这种配置是允许从任何ip地址通过本服务器发送邮件到任何其它邮箱。在这种情况下，如果没有发信验证，就基本上毫无疑问会被人当作一个open relay来发送邮件。所以，接下来的发信验证一定要配置好，测试好。<br/>3。配置sendmail的发信验证，sendmail.mc<br/>vi &nbsp;/etc/mail/sendmail.mc<br/> &nbsp; &nbsp;<br/>把dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl<br/>dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl<br/>改成TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl<br/>define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl<br/><br/>把dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl<br/>改成 DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl<br/><br/>把DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl<br/>改成DAEMON_OPTIONS(`Port=smtp,Addr=192.168.1.100, Name=MTA')dnl<br/><br/>然后用m4重新生成sendmail.cf<br/><br/>m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf<br/><br/>重新启动sendmail<br/>/etc/init.d/sendmail restart<br/><br/>然后验证一下<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">telnet localhost 25<br/>Trying 127.0.0.1...<br/>Connected to admin99.net (127.0.0.1).<br/>Escape character is '^]'.<br/>220 admin99.net ESMTP Sendmail 8.12.11.20060308/8.12.11; Thu, 17 Jul 2008 09:57:44 +0800<br/>ehlo admin99 &nbsp;#### 输入ehlo &nbsp;不是helo &nbsp;呵呵<br/>250-admin99.net Hello admin99.net [127.0.0.1], pleased to meet you<br/>250-ENHANCEDSTATUSCODES<br/>250-PIPELINING<br/>250-8BITMIME<br/>250-SIZE<br/>250-DSN<br/>250-ETRN<br/>250-AUTH GSSAPI LOGIN PLAIN<br/>250-DELIVERBY<br/>250 HELP</div></div><br/>250-AUTH LOGIN PLAIN &nbsp; &nbsp; &nbsp;如果有此项表示sendmail具有用户发信认证了。<br/><br/>4。配置pop3<br/>vi /etc/xinetd.d/ipop3<br/>将其中的 disable = yes<br/>改为 disable = no<br/>然后重启xinetd<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">/etc/init.d/xinetd reload</div></div><br/><br/>5。添加用户<br/>默认情况下root用户是不允许直接收发信的，所以，添加个新用户来测试一下邮件系统<br/>useradd real<br/>passwd real &nbsp; ##设置real的密码<br/>然后编辑 /etc/passwd 文件，将real设置为禁止登陆服务器，在real那行的最后添加个"/nologin"就行了<br/><br/>注意，用foxmail测试发信验证的时候，即便没有勾选 “smtp服务器需要身份验证”，foxmail仍然会尝试用pop3的用户名和密码来进行验证的<br/>Tags - <a href="http://www.admin99.net/tag.php?tag=%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86" rel="tag">系统管理</a> , <a href="http://www.admin99.net/tag.php?tag=mail" rel="tag">mail</a>
  ]]> 
</description>
</item><item>
<link>http://www.admin99.net/read.php?270</link>
<title>关于 invalid option tune=pentium4 </title> 
<author>real &lt;real@admin99.net&gt;</author>
<category>mail</category>
<pubDate>Mon, 05 Nov 2007 01:41:53 +0000</pubDate> 
<guid>http://www.admin99.net/read.php?270</guid> 
<description>
<![CDATA[ 
	编译 cyrus-imapd-2.2.12 时遇到了这个错误<br/><br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">gcc -c &nbsp;-I../../lib -I/RealMail/sasl/include &nbsp;-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 &nbsp; -DVERSION=&#92;"1.00&#92;" -DXS_VERSION=&#92;"1.00&#92;" -fPIC "-I/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE" &nbsp;-DPERL_POLLUTE IMAP.c<br/>cc1: invalid option `tune=pentium4'<br/>make[2]: *** [IMAP.o] Error 1</div></div><br/><br/>据说出现这个问题的一个根本原因是gcc版本过低<br/>现在提供两个方法解决这个问题<br/><br/>一。删除MakeFile中的 -mtune=pentium4 这个参数<br/>在本例中<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">[root@test2 cyrus-imapd-2.2.12]# grep tune= -r *<br/>perl/imap/Makefile:OPTIMIZE = -O2 -g -pipe -m32 -march=i386 -mtune=pentium4<br/>[root@test2 cyrus-imapd-2.2.12]# cd perl/imap/<br/>[root@test2 imap]# vi Makefile</div></div><br/>删除其中的 -mtune=pentium4 <br/>即可make通过<br/><br/>不过需要注意的是，这个方法有一定的局限性，并非在所有的出现此类问题的编译过程中都能解决问题，比如在本例中，虽然在perl/imap目录下可以make通过，但是回到上层目录再make的时候，又出现这个问题。此处这个问题不做深究<br/><br/>二。在/usr/bin下寻找gcc，找到其中比较高的版本，替换<br/><br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">[root@test2 cyrus-imapd-2.2.12]# cd /usr/bin/<br/>[root@test2 bin]# ls *gcc*<br/>gcc &nbsp;gcc32 &nbsp;gcc34 &nbsp;gcc.orig &nbsp;i386-redhat-linux-gcc &nbsp;i386-redhat-linux-gcc32<br/>[root@test2 bin]# gcc.orig -v<br/>Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.3/specs<br/>Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux<br/>Thread model: posix<br/>gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)<br/>[root@test2 bin]# gcc -v<br/>Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs<br/>Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --enable-languages=c,c++ --disable-libgcj --host=i386-redhat-linux<br/>Thread model: posix<br/>gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-47.3)<br/>[root@test2 bin]# gcc32 -v<br/>Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs<br/>Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --enable-languages=c,c++ --disable-libgcj --host=i386-redhat-linux<br/>Thread model: posix<br/>gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-47.3)<br/>[root@test2 bin]# gcc34 -v<br/>Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs<br/>Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --enable-languages=c,c++ --disable-libgcj --host=i386-redhat-linux<br/>Thread model: posix<br/>gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-47.3)</div></div><br/><br/>其中，gcc.orig的版本比较高<br/>替换现有的gcc<br/><br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">[root@test2 bin]# mv gcc gcc.bk<br/>[root@test2 bin]# cp gcc.orig gcc</div></div><br/><br/>然后回到刚才的目录接着编译，通过<br/><br/>当然还有第三个办法，升级gcc，这不在本文的讨论之列<br/>Tags - <a href="http://www.admin99.net/tag.php?tag=postfix" rel="tag">postfix</a> , <a href="http://www.admin99.net/tag.php?tag=%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86" rel="tag">系统管理</a>
  ]]> 
</description>
</item>
</channel>
</rss>