我正在命令提示符下测试服务器是否正常工作,所以我使用了
远程登录主机端口
我将收到消息
220 Unauthorized use is prohibited
光标只是空白
4-5分钟后
471 7.7.0 Timeout waiting for client input
connection to the host lost
这是否意味着我没有访问权限或我有访问权限。基本上我正在尝试通过java程序从微软交换服务器读取电子邮件。如果我从 java 程序调试,我会收到下面的错误
Connection refused
虽然我可以使用这两个语句发送邮件
props.put("mail.smtp.host", "host");
props.put("mail.from", "username@domain.co.uk");
它不要求端口或密码。
如果我这样做
props.setProperty("mail.imap.auth.disable","true");
Store store = session.getStore("imap");
store.connect(host,25,username, password);//password=windows password to login in
调试后
EBUG: setDebug: JavaMail version 1.4.3
DEBUG: getProvider() returning
javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc]
DEBUG: mail.imap.fetchsize: 16384
DEBUG: mail.imap.statuscachetimeout: 1000
DEBUG: mail.imap.appendbuffersize: -1
DEBUG: mail.imap.minidletime: 10
DEBUG: disable AUTH=PLAIN
DEBUG: trying to connect to host "host", port 25, isSSL false
220 Unauthorized use prohibited
javax.mail.MessagingException: 220 Unauthorized use prohibited;
nested exception is:
com.sun.mail.iap.ConnectionException: 220 Unauthorized use prohibited
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:616)
at javax.mail.Service.connect(Service.java:291)
at TestMail.InboxReader.main(InboxReader.java:52)
Caused by: com.sun.mail.iap.ConnectionException: 220 Unauthorized use prohibited
at com.sun.mail.imap.protocol.IMAPProtocol.processGreeting(IMAPProtocol.java:230)
at com.sun.mail.iap.Protocol.<init>(Protocol.java:116)
at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:104)
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:585)
... 2 more
Java Result: 2