见鬼了,客户端JavaMail-1.4偶尔出现 DEBUG SMTP: QUIT failed with 250

sboom 2009-12-03 10:28:36
查了一下smtp.jar的代码只有这里有这个输出,可是我已经设置了 mail.debug=false,而且就算是debug打开了也不应该是只有QUIT的时候才有debug输出,其他debug信息都没有输出,就算setDebugOutput设置成其他Stream也没用,它硬是要打印到我的stdout上面,不定期神经质出现,各位大侠help

public synchronized void close()
throws MessagingException
{
if (!(super.isConnected()))
return;
try {
if (this.serverSocket != null) {
sendCommand("QUIT");
if (this.quitWait) {
int resp = readServerResponse();
if ((resp != 221) && (resp != -1) && (this.debug))
this.out.println("DEBUG SMTP: QUIT failed with " + resp);
}
}
} finally {
closeConnection();
}
}
...全文
1499 19 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
不要心急 2011-09-07
  • 打赏
  • 举报
回复
顶个鬼。。。
xiangxiuhua 2010-08-03
  • 打赏
  • 举报
回复
O no,我也出现这个问题啊,那个知道啊
crazylaa 2009-12-09
  • 打赏
  • 举报
回复
[Quote=引用 16 楼 sboom 的回复:]
最后setUseQuit(false)了事
[/Quote]

sboom 2009-12-08
  • 打赏
  • 举报
回复
最后setUseQuit(false)了事
swandragon 2009-12-07
  • 打赏
  • 举报
回复
关闭瑞星等监控软件
http://fluagen.blog.51cto.com/146595/34696
ahhh90h 2009-12-07
  • 打赏
  • 举报
回复
up
999朵玫瑰 2009-12-07
  • 打赏
  • 举报
回复
synchronized
yang677888 2009-12-07
  • 打赏
  • 举报
回复
不懂 帮顶啦
zealVampire 2009-12-07
  • 打赏
  • 举报
回复
Properties p = new Properties();
p.put("mail.host", smtpServerDns);
p.put("mail.smtp.auth", String.valueOf(authFlag));
MailAuthenticator author = new MailAuthenticator(user, password);
session = Session.getInstance(p, author);
session.setDebugOut(xxxxxx);
session.setDebug(true);

应该可以打出东西来的,几年前的版本都可以,1.4应该都没问题吧, 不过好想新版本连附件的信息都会打出来,想做回调打印进度什么不友好



/* */ package javax.mail;
/* */
/* */ import com.sun.mail.util.LineInputStream;
/* */ import java.io.BufferedInputStream;
/* */ import java.io.File;
/* */ import java.io.FileInputStream;
/* */ import java.io.FileNotFoundException;
/* */ import java.io.IOException;
/* */ import java.io.InputStream;
/* */ import java.io.PrintStream;
/* */ import java.lang.reflect.Constructor;
/* */ import java.net.InetAddress;
/* */ import java.net.URL;
/* */ import java.security.AccessController;
/* */ import java.security.PrivilegedAction;
/* */ import java.security.PrivilegedActionException;
/* */ import java.security.PrivilegedExceptionAction;
/* */ import java.util.Enumeration;
/* */ import java.util.Hashtable;
/* */ import java.util.Properties;
/* */ import java.util.StringTokenizer;
/* */ import java.util.Vector;
/* */
/* */ public final class Session
/* */ {
/* */ private final Properties props;
/* */ private final Authenticator authenticator;
/* 186 */ private final Hashtable authTable = new Hashtable();
/* 187 */ private boolean debug = false;
/* */ private PrintStream out;
/* 189 */ private final Vector providers = new Vector();
/* 190 */ private final Hashtable providersByProtocol = new Hashtable();
/* 191 */ private final Hashtable providersByClassName = new Hashtable();
/* 192 */ private final Properties addressMap = new Properties();
/* */
/* 195 */ private static Session defaultSession = null;
/* */
/* */ private Session(Properties props, Authenticator authenticator)
/* */ {
/* 199 */ this.props = props;
/* 200 */ this.authenticator = authenticator;
/* */
/* 202 */ if (Boolean.valueOf(props.getProperty("mail.debug")).booleanValue()) {
/* 203 */ this.debug = true;
/* */ }
/* 205 */ if (this.debug) {
/* 206 */ pr("DEBUG: JavaMail version 1.4.2");
/* */ }
/* */
/* 210 */ if (authenticator != null)
/* 211 */ cl = authenticator.getClass();
/* */ else {
/* 213 */ cl = super.getClass();
/* */ }
/* 215 */ loadProviders(cl);
/* 216 */ loadAddressMap(cl);
/* */ }
/* */
/* */ public static Session getInstance(Properties props, Authenticator authenticator)
/* */ {
/* 237 */ return new Session(props, authenticator);
/* */ }
/* */
/* */ public static Session getInstance(Properties props)
/* */ {
/* 254 */ return new Session(props, null);
/* */ }
/* */
/* */ public static synchronized Session getDefaultInstance(Properties props, Authenticator authenticator)
/* */ {
/* 303 */ if (defaultSession == null) {
/* 304 */ defaultSession = new Session(props, authenticator);
/* */ }
/* 307 */ else if (defaultSession.authenticator != authenticator)
/* */ {
/* 309 */ if ((defaultSession.authenticator == null) || (authenticator == null) || (defaultSession.authenticator.getClass().getClassLoader() != authenticator.getClass().getClassLoader()))
/* */ {
/* 316 */ throw new SecurityException("Access to default session denied");
/* */ }
/* */ }
/* 319 */ return defaultSession;
/* */ }
/* */
/* */ public static Session getDefaultInstance(Properties props)
/* */ {
/* 344 */ return getDefaultInstance(props, null);
/* */ }
/* */
/* */ public synchronized void setDebug(boolean debug)
/* */ {
/* 363 */ this.debug = debug;
/* 364 */ if (debug)
/* 365 */ pr("DEBUG: setDebug: JavaMail version 1.4.2");
/* */ }
/* */
/* */ public synchronized boolean getDebug()
/* */ {
/* 374 */ return this.debug;
/* */ }
/* */
/* */ public synchronized void setDebugOut(PrintStream out)
/* */ {
/* 388 */ this.out = out;
/* */ }
/* */
/* */ public synchronized PrintStream getDebugOut()
/* */ {
/* 399 */ if (this.out == null) {
/* 400 */ return System.out;
/* */ }
/* 402 */ return this.out;
/* */ }
/* */
/* */ public synchronized Provider[] getProviders()
/* */ {
/* 413 */ Provider[] _providers = new Provider[this.providers.size()];
/* 414 */ this.providers.copyInto(_providers);
/* 415 */ return _providers;
/* */ }
/* */
。。。。。。。。。。。。。。
/* 1074 */ pr("DEBUG: " + sex);
/* */ }
/* */ } finally {
/* */ try {
/* 1078 */ if (clis != null)
/* 1079 */ clis.close();
/* */ }
/* */ catch (IOException ex)
/* */ {
/* */ }
/* */ }
/* */ }
/* */
/* */ private void loadResource(String name, Class cl, StreamLoader loader) {
/* 1088 */ InputStream clis = null;
/* */ try {
/* 1090 */ clis = getResourceAsStream(cl, name);
/* 1091 */ if (clis != null) {
/* 1092 */ loader.load(clis);
/* 1093 */ if (this.debug) {
/* 1094 */ pr("DEBUG: successfully loaded resource: " + name);
/* */ }


。。。。。。。。。。。
daisyp 2009-12-07
  • 打赏
  • 举报
回复
JavaMail没有用过,up up
fengboxjtu556 2009-12-06
  • 打赏
  • 举报
回复
debug调试一下
ahhh90h 2009-12-06
  • 打赏
  • 举报
回复
学习
sboom 2009-12-06
  • 打赏
  • 举报
回复
什么小BUG,你知道?

[Quote=引用 6 楼 java2000_net 的回复:]
是个小BUG吧
[/Quote]
老紫竹 2009-12-06
  • 打赏
  • 举报
回复
是个小BUG吧
一头头 2009-12-06
  • 打赏
  • 举报
回复
这个只有3个可能

1. 你机器里面有些什么不好的东西 病毒啊 什么的
2. 试试看把杀毒软件关掉 特别是瑞星 if you are using it.
3. 试试看把路由器的防火墙关掉
yeah_aly 2009-12-05
  • 打赏
  • 举报
回复
帮忙顶~
sun90cn 2009-12-05
  • 打赏
  • 举报
回复
帮楼主顶一下
sboom 2009-12-05
  • 打赏
  • 举报
回复
.
crazylaa 2009-12-03
  • 打赏
  • 举报
回复
with 250......看来老外不晓得这个数字的含义。。。。。。

看到这个才进来的。

不懂帮顶。。。

62,635

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧