blog.wuhui.sh.cn 分享知识 交流技术

Postfix配置Q&A

上一篇 / 下一篇  2008-07-15 00:45:18 / 个人分类:Linux

 在配置Postfix中遇到的一些问题及相关的解决方法,希望在遇到相同的问题时能起参考的作用.在这里有必要提到一些相关的日志文件,因为很多的错误都会在日志中有体现,日志文件的存放位置可以由用户定义,这里所说的日志文件是按前面的文章中定义的存放位置(http://waringid.blog.51cto.com/65148/58210),请自行参照更改.
G2@!o;R` yrY&Hp0DOIT博客%Uf c8ZPE})tB
显示信件列表:postqueue -p
LI:i-Ij0
显示信件內容:postcat -q Queue_IDDOIT博客7h n gJ&T/{RM:]
刪除各別信件:postsuper -d Queue_IDDOIT博客y/`+q yV#S&L~9X C7Q:M"O
全部刪除:postsuper -d ALLDOIT博客:yu8e B^
扣住信件:postsuper -h Queue_ID
HM ]nO Z)}0
回复:postsuper -H Queue_ID
~&Q]*u DH2a`hU:]"u0重新排程:DOIT博客:EJ`y6]
postsuper -r Queue_IDDOIT博客ty-r/eqo*]6g
postsuper -r ALL
S sA$uX;^ ebb:U0
清除信件:DOIT博客2QIn8TO
postqueue -f (全部)
%?s3oC*T0postqueue -s 主机名称(个别对象)
2fR^3I#lX0
要查看Postfix的当前主要配置文件的存放路径:DOIT博客%|5Jw`WGeL$XL.sN
postconf -n
n/L+mD$|Y7S"t-k)k0
DOIT博客 W4B Z T5t]Y
系统日志:tail -f /var/log/messages
6S,z5]9e[7aA1u0邮件日志:tail -f /var/log/maillog
Y?h0wZv l-E0clamd相关:tail -f /var/log/clamav/clamd.log  tail -f /var/log/clamav/freshclam.logDOIT博客+E#^3Tl_h7v(k
maildrop相关:tail -f /var/log/maildrop.logDOIT博客-['wa6d} Mn*],W
apache相关:tail -f /usr/local/httpd/logs/error_log  tail -f /usr/local/httpd/logs/suexec_log
Vk|%f` OsS l5@$h0mysql相关:tail -f /usr/local/mysql/data/linux.linux.com.errDOIT博客l&_,EWB
测试amavisd:amavisd -d config debug-sa
} s@B}Xy n0测试spam:spamassassin -D --lintDOIT博客,L3I_i{u
测试maildrop:maildrop -V 10 -dtest@test.com
4S/Vg~x*{Cd7c&rgB0
DOIT博客 N/p \L,})E+@
问题一:
Q
ysZu[6I"j4wR0Aug 7 22:26:22 mail postfix/smtpd[16829]: warning: xsasl_cyrus_server_get_mechanism_list:
9g1flBE"T0no applicable SASL mechanismsDOIT博客)W(`y@8g[
Aug 7 22:26:22 mail postfix/smtpd[16829]: fatal: no SASL authentication mechanisms
@)d5Luog0Aug 7 22:26:23 mail postfix/master[16825]: warning: process /usr/libexec/postfix/smtpd
t;Aau"f(E0pid 16829 exit status 1
e tuWDHE0Aug 7 22:26:23 mail postfix/master[16825]: warning: /usr/libexec/postfix/smtpd:DOIT博客)]%`'~-Cw'_
bad command startup -- throttling
c#Avf+~(xBU0Aug 7 22:28:06 mail postfix/smtpd[16830]: warning: xsasl_cyrus_server_get_mechanism_list:DOIT博客 VBm _#HGL-e7e
no applicable SASL mechanisms
/hR\9p5o+?D0Aug 7 22:28:06 mail postfix/smtpd[16830]: fatal: no SASL authentication mechanismsDOIT博客mZ'C,}S3[Rb&Zq2aC
Aug 7 22:28:07 mail postfix/master[16825]: warning: process /usr/libexec/postfix/smtpdDOIT博客&yX+?y k/@!f
pid 16830 exit status 1
A
5a,m|NM,Q tS x){$f^0ln -s /usr/local/lib/sasl2 /usr/lib/sasl2

'Ys L3f;Ts,s&U^0问题二:
Q
^)o g"KryX0Jan 15 20:24:43 localhost postfix/smtpd[3048]: warning: SASL authentication problem:
9PI_pXwr0unable to open Berkeley db /etc/sasldb2: No such file or directory
A
y!ce&e+Ut/CQu0系统已经安装sasl-cyrus 删除掉,然后编译重装
DOIT博客O.w|"v!X Cy
问题三:
Q
A$P$Lt6zqf?0install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains:
ADOIT博客8}4U(TTf6C6sN+c
[root@redhat tmp]#tar zxvf DBD-mysql-3.0008.tar.gz 重新安装

3E-i+C^$z4g0问题四:
Q
/@XD$WC*M6@x.m-O:g G0Can't chdir to /home/mailbox//Maildir, No such file or directory
A
*bu-N:SU7So0不能进入邮件目录,请先在extman后台建立postmaster用户

+nNQi7Q+Q-~ET5k0问题五:
Q
s8h:mp)^R k5I:RI0SELECT username, password, "", '1001', '1001', concat('/var/mailbox/',maildir), "", "",DOIT博客s0M&q8^%v+M f
username, "" FROM mailbox WHERE username = "test@test.com"
$S em6ZbXU w)O.A0maildrop: Timeout quota exceeded.
ADOIT博客+V7~ c]"I9QT
请检查/usr/local/authlib/etc/authlib/mysqlauthrc的quota配置项
DOIT博客.@ Nde6x1g2} x
问题六:
QDOIT博客0S#A/Qf'zLx(V.Ty
sh: /usr/sbin/sendmail: No such file or directory
A
5` \P/^&vP A1{E0ln -s /usr/local/postfix-2.2.8/src/sendmail/sendmail /usr/sbin/sendmail

#`7|:v4]m}(`o I ].l0问题八:
QDOIT博客5y B0A~7Wo1QO
error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
A
0?![0D/~7`c.f#f0[root@linux tmp]#rpm -ivh compat-libstdc++-33-3.2.3-47.3.i386.rpm
DOIT博客Tl&HX v:@)R XGI0?L
问题九:
Q
i*V~)MD?7HG1E0Starting mail statistics grapher: mailgraph_extDOIT博客!\4?t"Hy6}
Can't locate RRDs.pm in @INC (@INC contains:
N,jt-B i Jj J E0/usr/lib/perl5/5.8.5/i386-linux-thread-multi
A
j;mxm5S7Sy8z c0ln -sv /usr/local/rrdtool/lib/perl/5.8.5/i386-linux-thread-multi/RRDs.pm \DOIT博客vx{b/\ hK-ash
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/
DOIT博客6K ~a6m7C3C/L
问题十:
Q
'L\/[b&bt;?0
Can't locate loadable object for module RRDs in @INC (@INC contains:
r q5~lI2?5WsoHj0/usr/lib/perl5/5.8.5/i386-linux-thread-multi
A
7F9zOcL s!M0ln -sv /usr/local/rrdtool/lib/perl/5.8.5/i386-linux-thread-multi/auto/RRDs/RRDs.so \
6P#s tz-o;e r0/usr/lib/perl5/5.8.5/i386-linux-thread-multi/
DOIT博客Vw"cT#D[
问题十一:
QDOIT博客u3B8}H@!Dx.n z?
Can't load '/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/GD/GD.so'DOIT博客#C1a2N9h9}Z?6e
for module GD: libgd.so.2:
%l!f1LtL%V4T({0cannot open shared object file: No such file or directory atDOIT博客3K.\ Q4_9H \c(GV
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm
3q$vkh2V}8c2`&N0line 230., referer:http://192.168.44.200/extman/cgi/index.cgi
A
Y:d["O$TmW0[root@linux tmp]#vi /etc/ld.so.confDOIT博客2H4?O7a1IE
[root@linux tmp]#less /etc/ld.so.confDOIT博客z_rX7^i
include ld.so.conf.d/*.confDOIT博客G*B.g sy'P,}.W$Pt g
/usr/X11R6/lib
c9N$y+Y w$e7ub0/usr/local/mysql/libDOIT博客9e;f&^D"|b
/usr/local/BerkeleyDB/lib
3OQ+xEE0/usr/local/authlib/lib/courier-authlib
w+@,^ J#E!S#CZ0/usr/local/sasl2/lib
%OfG.y%fvyt @J0/usr/local/sasl2/lib/sasl2
g X;HTl.@0/usr/local/clamav/lib
w#yZcYL'E` V0/usr/local/libDOIT博客'N o U*x|B1^
/usr/local/authlib/lib/courier-authlibDOIT博客1KN [imI
/usr/local/gd/lib
cWcF0C u!nh0/usr/local/jpeg/libDOIT博客kn?4u+h"vlz7]9UG
/usr/local/fontconfig/libDOIT博客b;W(haEIe
/usr/local/freetype2/libDOIT博客j"V2b*te
/usr/local/png/lib
~RO@FE o${0[root@linux tmp]#ldconfig -v

1V m3ZQ9kco O0问题七:
QDOIT博客)RWa-W6a#D,U+s
Jan 28 05:04:56 linux postfix/pickup[13892]: DEBD68075: uid=0 from=<root>DOIT博客B1as nC LgV
Jan 28 05:04:56 linux postfix/cleanup[14026]: DEBD68075: hold: header Received:DOIT博客 hA[a ~4Y3t
by linux.test.com (Postfix, from userid 0)??id DEBD68075; Mon, 28 Jan 2008 05:04DOIT博客o F?3@bT
:56 +0800 (CST) from local; from=<root@test.com>
z._pR9W8r~?0Jan 28 05:04:56 linux postfix/cleanup[14026]: DEBD68075: message-id=<20080127210
p7I)p"e d|G0456.DEBD68075@linux.test.com>
ADOIT博客wE u?.Qo4L"l
不要将amavisd和MailScanner装在一起##可能有其它解决办法吧

~fle G3a4bZ0
问题十二:
Q
5D*Hl:w:r[0httpd: Syntax error on line 99 of /etc/httpd/httpd.conf:DOIT博客9MD'f#au!O
Cannot load /usr/local/\httpd/modules/libphp5.so into server: /usr/local/\httpd/modules/libphp5.so:DOIT博客{ Y)^g&}-[4r
cannot restore segment prot after reloc: Permission denied
A
%C*M|'t:[A01:禁用selinux
(W iyM#O U!n:|02:chcon -t texrel_shlib_t /usr/local/apache2/modules/*.so

M9o&PT4QCzl0
问题十三:
Q
v,@L3cJ0
Jun 20 15:29:08 mail authdaemond: authldaplib: sysusername=<null>, sysuserid=1001, sysgroupid=1001,DOIT博客 I b:c0h$E.k'?%m
homedir=/var/mailbox/test.com/test01,address=test01@test.com, fullname=test01,
k2XwNN0maildir=test.com/test01/Maildir/, quota=5242880S, ptions=<null>DOIT博客:Ig:pkZ:]2K6N6b
Jun 20 15:29:08 mail authdaemond: authldaplib: clearpasswd=<null>,DOIT博客,Z)\G SV+|
passwd=$1$8pBM6cXc$Va6UkybwOdSyExU82pQ1A0
\5ZU_|4r&v0Jun 20 15:29:08 mail authdaemond: rebinding with DN
*D5u8|5Q{DNf#eg0'mail=test01@test.com,virtualDomain=test.com,o=extmailAccount,dc=test.com'
M1jk y.W]u0to validate password
exM }5K gM9om*d0Jun 20 15:29:08 mail authdaemond: authentication bind failed, invalid credentials
z2Y7np z6G*@+i0
ADOIT博客E^P g7LYl\om
vi /etc/authlib/authldaprc
,jZ9{!RF&?BUvJ072 #LDAP_AUTHBIND 1
DOIT博客'S7t s5x,H&gHD r
问题十四:
Q
3\Kd-F6k"\,P0pop3d: chdir test.com/test01: No such file or directory
ADOIT博客o }4~ T'H@wn9n
vi /etc/authlib/authldaprc
#Ef;~Rj(b0#LDAP_MAILDIR mailMessageStore
DOIT博客"gI#sT5y6?[#t+A
问题十五:
QDOIT博客x8C"~(A8[qu [
configure: error: Please fix the library issues listed above and try again.
ADOIT博客\(aPy ^2ke
cp /usr/local/png/lib/pkgconfig/libpng.pc /usr/lib/pkgconfig/

&s*z9g9Y r0问题十六:
QDOIT博客%]:jk^9F3cqF+L&K[
Can't locate GD.pm in @INC (@INC contains:
A
Cv3MvY,S0安装GD-2.35.tar.gz
DOIT博客~E nO'F
问题十七:
Q
dn8Gz3R Q:X0怎样查看postfix日志成功接收到邮件:(交货到邮件目录)
ADOIT博客 yZ+[j4MS
cat /var/log/maillog |grep "delivered to maildir"
9@@)[$Mf]UkT0cat /var/log/maillog |grep "delivered to maildir" | egrep -o "(\w+)([@]{1}\w+[.]{1,})(\w+)"

6CnE.[h0问题十八:
QDOIT博客y b-T p:ai I
怎样取当天日志:
A
8cX9\$LQY0cat /var/log/maillog | egrep "`data | awk "`'{print ""$2" "$3""}'`"

1~ g~ilW(i0问题十九:
Q
/W4J-hYC5`9Y:a,L S0怎样取指定日期日志:
ADOIT博客)p4\D2f4E[ r
cat /var/log/maill | grep "^Sep\ 25" | egrep "reject|warning|error|fatal|panic" | more
DOIT博客Z.S Z8i's)v2\
  慢慢再增加吧.
DOIT博客/Ma(^kS ne{Y

本文出自 “虚拟的现实” 博客,请务必保留此出处http://waringid.blog.51cto.com/65148/58822DOIT博客H*AC$SU#}


TAG: Postfix postfix

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-10-13  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 2980
  • 日志数: 68
  • 建立时间: 2007-05-17
  • 更新时间: 2008-10-09

RSS订阅

Open Toolbar