Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SMTP Auth not sent to server

843830Oct 12 2006 — edited Oct 13 2006
Hi together,

We're distributing a mailing component in one of our applications. On some systems (we don't know why) the smtp authentication is not working correctly and I can't figure out where the prob is!

I've done the implementation in Java as proposed by so may threads about smtp auth as follows. I've implemented our own Authenticator:

class EcomatAuthenticator extends Authenticator {
private String smtpUser;
private String smtpPass;

public EcomatAuthenticator(final String user, final String pass) {
super();
this.smtpUser = user;
this.smtpPass = pass;
}

public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(this.smtpUser, this.smtpPass);
}
}

and the props instance contains the neccessary Information:

Properties props = new Properties();
props.put("mail.smtp.host", _smtpHost);
props.put("mail.smtp.auth", "true");

I've to say, that my implementation is working on 90% of the systems sending mail with SMTP auth (they're all sending the mails with our own server, so I can tcpdump the connections for verifying).

As already said, we've many clients working with our software. But there are some users - withing the same company - where the SMTP connection does not perform any AUTH command - although the mail.smtp.auth is set in the props instance.

When I'm doing the message sending from my machine, the smtp log on the server looks this way:

--
220 mail.ourserver.ch ESMTP
EHLO devnull
250-mail.ourserver.ch
250-AUTH LOGIN CRAAUTH LOGIN
334 DFAJDFAIE
djfaFDJkfdsa93jKEFJJF==
334 ADFJ3293DFASD
ASDFJewfakjfasdFASdfi3
235 ok, go ahead (#2.0.0)
MAIL FROM:<info@ourserver.ch>
250 ok
RCPT TO:<anyaddress@hotmail.com>
250 ok
..
..
--

what seems to be quite good. BUT when I'm doing the same stuff on a machine of the customer we've the SMTP log looks like this (it's the same build of our application with the java mail api from april):

--
220 mail.ourserver.ch ESMTP
EHLO PC-M1
250-mail.ourserver.ch
250-AUTH LOGIN CRAMAIL FROM:<info@wilmobil.ch>
250 ok
RCPT TO:<anyuser@hotmail.com>
553 sorry, that domain isn't in my list o
RSET
250 flushed
QUIT
..
--

Now, it's quite clear, that the server rejected the mail in the second smtp log. The question is WHY is the AUTH sequence missing? Both logs were running on the same webserver, with the same JavaMail api and the same smtp (user/password) settings. NO difference.

Has anyone ever had this problem? I'm really confused about this, especially because only one of our customers has this problem. But there doesn't seem to be anny issue with firewall or antivirus software, because smtp on protocol-level seems to work.

I'm confused. Any ideas?

Thanks!!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 10 2006
Added on Oct 12 2006
11 comments
634 views