LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2164|回复: 12

求救!EL4下sendmail奇怪问题

[复制链接]
发表于 2006-8-7 18:02:51 | 显示全部楼层 |阅读模式
EL4 update1,配置好了服务器后,客户端接受邮件正常,但是不能够发送邮件,thunderbird总提示输入密码,查看/var/log/messages
Aug  7 17:10:22 myserver sendmail[2902]: unable to open Berkeley db /etc/sasldb2: No such file or directory
Aug  7 17:10:22 myserver sendmail[2902]: unable to open Berkeley db /etc/sasldb2: No such file or directory
Aug  7 17:10:22 myserver sendmail[2902]: no secret in database
我没有设定这个什么sasldb2啊,不知道那里配置配错了:

重装必要的包
sendmail-8.13.1-2
sendmail-cf-8.13.1-2
dovecot-0.99.11-2.EL4.1
修改配置文件:
/etc/dovecot.conf
protocols = imap imaps pop3 pop3s

/etc/mail/sendmail.mc
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

/etc/mail/local-host-names
加入我的主机myserver.jluexp.org

/etc/mail/access
172.16.95  RELAY
jluexp.org  RELAY

然后在/etc/mail/下m4 senmail.mc > senmail.cf

启动服务sendmail/dovecot,日志显示都成功。
发表于 2006-8-11 11:59:34 | 显示全部楼层
是否可以贴一下sendmail.mc和sendmail.cf
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-8-11 17:27:28 | 显示全部楼层


  1. [root@localhost ~]# cat /etc/mail/sendmail.mc
  2. divert(-1)dnl
  3. dnl #
  4. dnl # This is the sendmail macro config file for m4. If you make changes to
  5. dnl # /etc/mail/sendmail.mc, you will need to regenerate the
  6. dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is
  7. dnl # installed and then performing a
  8. dnl #
  9. dnl #     make -C /etc/mail
  10. dnl #
  11. include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
  12. VERSIONID(`setup for Red Hat Linux')dnl
  13. OSTYPE(`linux')dnl
  14. dnl #
  15. dnl # default logging level is 9, you might want to set it higher to
  16. dnl # debug the configuration
  17. dnl #
  18. dnl define(`confLOG_LEVEL', `9')dnl
  19. dnl #
  20. dnl # Uncomment and edit the following line if your outgoing mail needs to
  21. dnl # be sent out through an external mail server:
  22. dnl #
  23. dnl define(`SMART_HOST',`smtp.your.provider')
  24. dnl #
  25. define(`confDEF_USER_ID',``8:12'')dnl
  26. dnl define(`confAUTO_REBUILD')dnl
  27. define(`confTO_CONNECT', `1m')dnl
  28. define(`confTRY_NULL_MX_LIST',true)dnl
  29. define(`confDONT_PROBE_INTERFACES',true)dnl
  30. define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
  31. define(`ALIAS_FILE', `/etc/aliases')dnl
  32. define(`STATUS_FILE', `/var/log/mail/statistics')dnl
  33. define(`UUCP_MAILER_MAX', `2000000')dnl
  34. define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
  35. define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
  36. define(`confAUTH_OPTIONS', `A')dnl
  37. dnl #
  38. dnl # The following allows relaying if the user authenticates, and disallows
  39. dnl # plaintext authentication (PLAIN/LOGIN) on non-TLS links
  40. dnl #
  41. dnl define(`confAUTH_OPTIONS', `A p')dnl
  42. dnl #
  43. dnl # PLAIN is the preferred plaintext authentication method and used by
  44. dnl # Mozilla Mail and Evolution, though Outlook Express and other MUAs do
  45. dnl # use LOGIN. Other mechanisms should be used if the connection is not
  46. dnl # guaranteed secure.
  47. dnl # Please remember that saslauthd needs to be running for AUTH.
  48. dnl #
  49. dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
  50. dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
  51. dnl #
  52. dnl # Rudimentary information on creating certificates for sendmail TLS:
  53. dnl #     cd /usr/share/ssl/certs; make sendmail.pem
  54. dnl # Complete usage:
  55. dnl #     make -C /usr/share/ssl/certs usage
  56. dnl #
  57. dnl define(`confCACERT_PATH',`/usr/share/ssl/certs')
  58. dnl define(`confCACERT',`/usr/share/ssl/certs/ca-bundle.crt')
  59. dnl define(`confSERVER_CERT',`/usr/share/ssl/certs/sendmail.pem')
  60. dnl define(`confSERVER_KEY',`/usr/share/ssl/certs/sendmail.pem')
  61. dnl #
  62. dnl # This allows sendmail to use a keyfile that is shared with OpenLDAP's
  63. dnl # slapd, which requires the file to be readble by group ldap
  64. dnl #
  65. dnl define(`confDONT_BLAME_SENDMAIL',`groupreadablekeyfile')dnl
  66. dnl #
  67. dnl define(`confTO_QUEUEWARN', `4h')dnl
  68. dnl define(`confTO_QUEUERETURN', `5d')dnl
  69. dnl define(`confQUEUE_LA', `12')dnl
  70. dnl define(`confREFUSE_LA', `18')dnl
  71. define(`confTO_IDENT', `0')dnl
  72. dnl FEATURE(delay_checks)dnl
  73. FEATURE(`no_default_msa',`dnl')dnl
  74. FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
  75. FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
  76. FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
  77. FEATURE(redirect)dnl
  78. FEATURE(always_add_domain)dnl
  79. FEATURE(use_cw_file)dnl
  80. FEATURE(use_ct_file)dnl
  81. dnl #
  82. dnl # The following limits the number of processes sendmail can fork to accept
  83. dnl # incoming messages or process its message queues to 12.) sendmail refuses
  84. dnl # to accept connections once it has reached its quota of child processes.
  85. dnl #
  86. dnl define(`confMAX_DAEMON_CHILDREN', 12)dnl
  87. dnl #
  88. dnl # Limits the number of new connections per second. This caps the overhead
  89. dnl # incurred due to forking new sendmail processes. May be useful against
  90. dnl # DoS attacks or barrages of spam. (As mentioned below, a per-IP address
  91. dnl # limit would be useful but is not available as an option at this writing.)
  92. dnl #
  93. dnl define(`confCONNECTION_RATE_THROTTLE', 3)dnl
  94. dnl #
  95. dnl # The -t option will retry delivery if e.g. the user runs over his quota.
  96. dnl #
  97. FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
  98. FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl
  99. FEATURE(`blacklist_recipients')dnl
  100. EXPOSED_USER(`root')dnl
  101. dnl #
  102. dnl # The following causes sendmail to only listen on the IPv4 loopback address
  103. dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
  104. dnl # address restriction to accept email from the internet or intranet.
  105. dnl #
  106. dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
  107. dnl #
  108. dnl # The following causes sendmail to additionally listen to port 587 for
  109. dnl # mail from MUAs that authenticate. Roaming users who can't reach their
  110. dnl # preferred sendmail daemon due to port 25 being blocked or redirected find
  111. dnl # this useful.
  112. dnl #
  113. dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
  114. dnl #
  115. dnl # The following causes sendmail to additionally listen to port 465, but
  116. dnl # starting immediately in TLS mode upon connecting. Port 25 or 587 followed
  117. dnl # by STARTTLS is preferred, but roaming clients using Outlook Express can't
  118. dnl # do STARTTLS on ports other than 25. Mozilla Mail can ONLY use STARTTLS
  119. dnl # and doesn't support the deprecated smtps; Evolution <1.1.1 uses smtps
  120. dnl # when SSL is enabled-- STARTTLS support is available in version 1.1.1.
  121. dnl #
  122. dnl # For this to work your OpenSSL certificates must be configured.
  123. dnl #
  124. dnl DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
  125. dnl #
  126. dnl # The following causes sendmail to additionally listen on the IPv6 loopback
  127. dnl # device. Remove the loopback address restriction listen to the network.
  128. dnl #
  129. dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
  130. dnl #
  131. dnl # enable both ipv6 and ipv4 in sendmail:
  132. dnl #
  133. dnl DAEMON_OPTIONS(`Name=MTA-v4, Family=inet, Name=MTA-v6, Family=inet6')
  134. dnl #
  135. dnl # We strongly recommend not accepting unresolvable domains if you want to
  136. dnl # protect yourself from spam. However, the laptop and users on computers
  137. dnl # that do not have 24x7 DNS do need this.
  138. dnl #
  139. FEATURE(`accept_unresolvable_domains')dnl
  140. dnl #
  141. dnl FEATURE(`relay_based_on_MX')dnl
  142. dnl #
  143. dnl # Also accept email sent to "localhost.localdomain" as local email.
  144. dnl #
  145. LOCAL_DOMAIN(`localhost.localdomain')dnl
  146. dnl #
  147. dnl # The following example makes mail from this host and any additional
  148. dnl # specified domains appear to be sent from mydomain.com
  149. dnl #
  150. dnl MASQUERADE_AS(`mydomain.com')dnl
  151. dnl #
  152. dnl # masquerade not just the headers, but the envelope as well
  153. dnl #
  154. dnl FEATURE(masquerade_envelope)dnl
  155. dnl #
  156. dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
  157. dnl #
  158. dnl FEATURE(masquerade_entire_domain)dnl
  159. dnl #
  160. dnl MASQUERADE_DOMAIN(localhost)dnl
  161. dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
  162. dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl
  163. dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
  164. MAILER(smtp)dnl
  165. MAILER(procmail)dnl

复制代码
回复 支持 反对

使用道具 举报

发表于 2006-8-11 23:29:44 | 显示全部楼层
由于在AS4里SMTP是需要认证的!不象AS3的SMTP那样!

注意以下的英文说明:
dnl # The following causes sendmail to additionally listen to port 587 for
dnl # mail from MUAs that authenticate. Roaming users who can't reach their
dnl # preferred sendmail daemon due to port 25 being blocked or redirected find
dnl # this useful.
dnl #
dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl

1.Saslauthd的默认认证端口是587,而不是一般常用的SMTP(25),所以将上面的语句改为

DAEMON_OPTIONS(`Port=25, Name=MSA')dnl

2.将以下注释了

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

3.
service sendmail restart
service dovecot restart
service saslauthd restart

4. telnet localhost smtp

    ehlo localhost

会出现如下信息就是支持SMTP的SASLAUTHD认证了!

EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN'
回复 支持 反对

使用道具 举报

发表于 2006-8-11 23:29:49 | 显示全部楼层
由于在AS4里SMTP是需要认证的!不象AS3的SMTP那样!

注意以下的英文说明:
dnl # The following causes sendmail to additionally listen to port 587 for
dnl # mail from MUAs that authenticate. Roaming users who can't reach their
dnl # preferred sendmail daemon due to port 25 being blocked or redirected find
dnl # this useful.
dnl #
dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl

1.Saslauthd的默认认证端口是587,而不是一般常用的SMTP(25),所以将上面的语句改为

DAEMON_OPTIONS(`Port=25, Name=MSA')dnl

2.将以下注释了

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

3.
service sendmail restart
service dovecot restart
service saslauthd restart

4. telnet localhost smtp

    ehlo localhost

会出现如下信息就是支持SMTP的SASLAUTHD认证了!

EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN'
回复 支持 反对

使用道具 举报

发表于 2006-8-11 23:30:44 | 显示全部楼层

SMTP认证问题!

由于在AS4里SMTP是需要认证的!不象AS3的SMTP那样!

注意以下的英文说明:
dnl # The following causes sendmail to additionally listen to port 587 for
dnl # mail from MUAs that authenticate. Roaming users who can't reach their
dnl # preferred sendmail daemon due to port 25 being blocked or redirected find
dnl # this useful.
dnl #
dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl

1.Saslauthd的默认认证端口是587,而不是一般常用的SMTP(25),所以将上面的语句改为

DAEMON_OPTIONS(`Port=25, Name=MSA')dnl

2.将以下注释了

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

3.
service sendmail restart
service dovecot restart
service saslauthd restart

4. telnet localhost smtp

    ehlo localhost

会出现如下信息就是支持SMTP的SASLAUTHD认证了!

EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN'
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-8-12 10:35:08 | 显示全部楼层
好,谢谢,马上试试看
回复 支持 反对

使用道具 举报

发表于 2006-8-12 13:22:04 | 显示全部楼层
若是启用了认证,必须把那个认证工具(名字我记不起来了)也启动,不能只启动sendmail和dovecot.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-8-13 12:36:55 | 显示全部楼层
怎样才能够不用sasl,直接采用本地/etc/passwd做认证?能够用thunderbird接受,但是不能够发送,接受应该是dovecot控制pop3/imap这些协议,发送应该是sendmail控制的smtp协议吧
回复 支持 反对

使用道具 举报

发表于 2006-8-14 01:25:01 | 显示全部楼层
系统的安全在系统中是必不可少的,AS4的SMTP认证方法是为了避免转发邮件变成了默认的配置方式!由原来的xinet转为standalone方式已经,加之SELINUX的保护,使系统服务分离,是在安全上对系统的一个保障,不要给AS3上普遍的配置所蒙蔽,新的事物是随之诞生出来的!

(在此鄙视那些所谓"有名的出版社",在AS3上的写为AS4的常见配置方式,抄来抄去,不但增加不了读者的知识,反而赚了亏心钱!太黑了)

SMTP认证方式,是SENDMAIL和POSTFIX的主要SMTP发送方式,避免了你的服务器变成了对方的转发邮件服务器,新的知识不要以旧的东西为标准,只能借鉴!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表