sendmail默認配置,沒有用驗證,不過用javamail發送提示驗證失敗

火星人 @ 2014-03-04 , reply:0


sendmail默認配置,沒有用驗證,不過用javamail發送提示驗證失敗

sendmail默認配置,看網上說的默認的配置就是沒有用驗證,不過用javamail發送提示驗證失敗

這個是javamail輸出的信息
DEBUG: setDebug: JavaMail version 1.4.1
DEBUG: getProvider() returning javax.mail.Provider
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "localhost", port 25, isSSL false
220 mail.xxx.com ESMTP Sendmail 8.13.1/8.13.1; Sun, 3 Aug 2008 00:35:41 +0800
DEBUG SMTP: connected to host "localhost", port: 25

EHLO firstserver.xxx.com
250-mail.xxx.com Hello mail.xxx.com , pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "SIZE", arg ""
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: Found extension "ETRN", arg ""
DEBUG SMTP: Found extension "AUTH", arg "DIGEST-MD5 CRAM-MD5"
DEBUG SMTP: Found extension "DELIVERBY", arg ""
DEBUG SMTP: Found extension "HELP", arg ""
DEBUG SMTP: Attempt to authenticate
DEBUG DIGEST-MD5: Loaded
AUTH DIGEST-MD5
334 bm9uY2U9InR6dzl4OXRaRkJVOVBKeXFKQlI3K2N2Z0NZR3lFbjRmY0JUMmNXdU1xcVU9IixyZWFsbT0ibWFpbC5lYXRmdW4uY24iLHFvcD0iYXV0aCxhdXRoLWludCxhdXRoLWNvbmYiLGNpcGhlcj0icmM0LTQwLHJjNC01NixyYzQsZGVzLDNkZXMiLG1heGJ1Zj04MTkyLGNoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNz
DEBUG DIGEST-MD5: Begin authentication ...
DEBUG DIGEST-MD5: Received => nonce='tzw9x9tZFBU9PJyqJBR7+cvgCYGyEn4fcBT2cWuMqqU='
DEBUG DIGEST-MD5: Received => realm='mail.xxx.com'
DEBUG DIGEST-MD5: Received => qop='auth,auth-int,auth-conf'
DEBUG DIGEST-MD5: Received => cipher='rc4-40,rc4-56,rc4,des,3des'
DEBUG DIGEST-MD5: Received => maxbuf='8192'
DEBUG DIGEST-MD5: Received => charset='utf-8'
DEBUG DIGEST-MD5: Received => algorithm='md5-sess'
DEBUG DIGEST-MD5: Response => username="",realm="mail.xxx.com",qop=auth,nc=00000001,nonce="tzw9x9tZFBU9PJyqJBR7+cvgCYGyEn4fcBT2cWuMqqU=",cnonce="hPOW+IyQhcl4NjGHW+HKLiQRGtX8sX/IZqpzAXNtgtc=",digest-uri="smtp/localhost",response=3db420b3ee42d4d4e249981bf170bfb4
dXNlcm5hbWU9ImVhdGZ1bkBtYWlsLmVhdGZ1bi5jbiIscmVhbG09Im1haWwuZWF0ZnVuLmNuIixxb3A9YXV0aCxuYz0wMDAwMDAwMSxub25jZT0idHp3OXg5dFpGQlU5UEp5cUpCUjcrY3ZnQ1lHeUVuNGZjQlQyY1d1TXFxVT0iLGNub25jZT0iaFBPVytJeVFoY2w0TmpHSFcrSEtMaVFSR3RYOHNYL0lacXB6QVhOdGd0Yz0iLGRpZ2VzdC11cmk9InNtdHAvbG9jYWxob3N0IixyZXNwb25zZT0zZGI0MjBiM2VlNDJkNGQ0ZTI0OTk4MWJmMTcwYmZiNA==
535 5.7.0 authentication failed
Error in com.xxx.mail.JavaMail
Error is : javax.mail.AuthenticationFailedException

sendmail.mc的內容(之列出了沒有屏蔽的)
divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for Red Hat Linux')dnl
OSTYPE(`linux')dnl
define(`confDEF_USER_ID',``8:12'')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST',true)dnl
define(`confDONT_PROBE_INTERFACES',true)dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`STATUS_FILE', `/var/log/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confTO_IDENT', `0')dnl
FEATURE(`no_default_msa',`dnl')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
FEATURE(`accept_unresolvable_domains')dnl
LOCAL_DOMAIN(`localhost.localdomain')dnl
MAILER(smtp)dnl
MAILER(procmail)dnl

我現在就是想怎麼不用smtp驗證來發送郵件?

[ 本帖最後由 zxzheaven 於 2008-8-4 11:38 編輯 ]
《解決方案》

不好意思,用sendmail的人是不是很少?
《解決方案》

MAILER(smtp)dnl


有個local的沒有???
《解決方案》

謝謝恢復。

沒有,你說的「local」是「MAILER(local)dnl」嗎?
把那個加在最下面就可以了?
《解決方案》

我認為樓主連基本的概念可能不夠
sendmail 在 smtp auth 這個部份 google 能找到一堆 (別看中文的)
《解決方案》

謝謝樓上的回復
我在網上搜索「sendmail auth」的信息,基本上都是講如何給sendmail加驗證的:em08:
然後我剛剛在sendmail.mc後面加上了「MAILER(local)dnl」,然後m4 sendmail.mc > sendmail.cf
重啟sendmail服務,然後telnet localhost 25
ehlo localhost

還是有「250-AUTH DIGEST-MD5 CRAM-MD5」的提示
《解決方案》

原帖由 zxzheaven 於 2008-8-4 10:48 發表 http://bbs.chinaunix.net/images/common/back.gif
謝謝樓上的回復
我在網上搜索「sendmail auth」的信息,基本上都是講如何給sendmail加驗證的:em08:
然後我剛剛在sendmail.mc後面加上了「MAILER(local)dnl」,然後m4 sendmail.mc > sendmail.cf
重啟sendma ...
1. 有提示不等於對 !
2. 你 google 了就好好看下去, 我不建議你只看表面, 最好連骨子都了解, 我 google "sendmail smtp auth" 得到的第一個結果是
http://www.sendmail.org/~ca/email/auth.html
《解決方案》

不知道你是否清楚,我是不想要sendmail的smtp auth驗證的

還是很謝謝,我仔細看看:mrgreen:
我之前有點急了
看了有什麼不了解的再發上來

[ 本帖最後由 zxzheaven 於 2008-8-4 11:32 編輯 ]
《解決方案》

那就把
define(`confAUTH_OPTIONS', `A')dnl
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')
這三行拿掉重做 sendmail.cf 重跑  sendmail
《解決方案》

我看網上說的,顯示「250-AUTH DIGEST-MD5 CRAM-MD5」只是說明sendmail提供這樣的支持,並不表示需要這樣。。




[火星人 via ] sendmail默認配置,沒有用驗證,不過用javamail發送提示驗證失敗已經有233次圍觀

http://www.coctec.com/docs/service/show-post-28516.html