voodoodyne / subethasmtp

SubEtha SMTP is a Java library for receiving SMTP mail
Other
343 stars 138 forks source link

Authentication Callback -Not Called if Auth is not sent by client #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
1. I had setup the SMTP object and started the SMTP port using the following 
code
******************************************************************
UsernamePasswordValidator passwordValidator = new SmtpUserValidator();
        EasyAuthenticationHandlerFactory authenticationHandlerFactory = new EasyAuthenticationHandlerFactory(passwordValidator);
        SmtpMessageHandlerFactory messageHandlerFactory = new SmtpMessageHandlerFactory();
        SMTPServer smtpServer = new SMTPServer(messageHandlerFactory, authenticationHandlerFactory);
        smtpServer.setPort(getPort());
        smtpServer.setMaxConnections(getMaxConnections());
        smtpServer.start();
******************************************************************

2.Dont send auth from java client (attached is the same). The following 
property is commented
#mail.smtp.auth=true

What is the expected output? What do you see instead?

Even if the client does not attempt to authenticate the SMTP server should 
reject. That doesnt happen instead the content (header and body) will be read.

What version of the product are you using? On what operating system?
I am using subethasmtp-3.1.7.jar on a linux system. 

Please provide any additional information below.

I have raised a similar issue (no:68) since it is marked as invalid  I am 
raising it again

*********************************************************************
INFO   | jvm 1    | 2013/10/29 11:26:35 | [DEBUG] 11:26:34 Session - SMTP 
connection from 172.16.8.116/172.16.8.116, new connection count: 1
INFO   | jvm 1    | 2013/10/29 11:26:35 | [DEBUG] 11:26:34 Session - Server: 
220 BLADE3 ESMTP SubEthaSMTP 3.1.7
INFO   | jvm 1    | 2013/10/29 11:26:35 | [DEBUG] 11:26:34 Session - Client: 
EHLO RaaghuLaptop-PC.unicel.in
INFO   | jvm 1    | 2013/10/29 11:26:35 | [DEBUG] 11:26:34 Session - Server: 
250-BLADE3
INFO   | jvm 1    | 2013/10/29 11:26:35 | 250-8BITMIME
INFO   | jvm 1    | 2013/10/29 11:26:35 | 250-AUTH LOGIN
INFO   | jvm 1    | 2013/10/29 11:26:35 | 250 Ok
INFO   | jvm 1    | 2013/10/29 11:26:35 | [DEBUG] 11:26:34 Session - Client: 
MAIL FROM:<uni_sb@ocmail14.in>
INFO   | jvm 1    | 2013/10/29 11:26:35 | [ INFO] 11:26:34 
SmtpMessageHandlerFactory - FROM:uni_sb@ocmail14.in
INFO   | jvm 1    | 2013/10/29 11:26:35 | [DEBUG] 11:26:34 Session - Server: 
250 Ok
INFO   | jvm 1    | 2013/10/29 11:26:35 | [DEBUG] 11:26:34 Session - Client: 
RCPT TO:<raaghu@to.com>
INFO   | jvm 1    | 2013/10/29 11:26:35 | [ INFO] 11:26:34 
SmtpMessageHandlerFactory - RECIPIENT:raaghu@to.com
INFO   | jvm 1    | 2013/10/29 11:26:35 | [DEBUG] 11:26:34 Session - Server: 
250 Ok
INFO   | jvm 1    | 2013/10/29 11:26:35 | [DEBUG] 11:26:34 Session - Client: 
DATA
INFO   | jvm 1    | 2013/10/29 11:26:35 | [DEBUG] 11:26:34 Session - Server: 
354 End data with <CR><LF>.<CR><LF>
INFO   | jvm 1    | 2013/10/29 11:26:35 | [ INFO] 11:26:35 
SmtpMessageHandlerFactory - MAIL DATA
INFO   | jvm 1    | 2013/10/29 11:26:35 | [ INFO] 11:26:35 
SmtpMessageHandlerFactory - = = = = = = = = = = = = = = = = = = = = = = = = = = 
= = = = =
INFO   | jvm 1    | 2013/10/29 11:26:35 | [ INFO] 11:26:35 
SmtpMessageHandlerFactory - Received: from RaaghuLaptop-PC.unicel.in 
([172.16.8.116])
INFO   | jvm 1    | 2013/10/29 11:26:35 |         by BLADE3
INFO   | jvm 1    | 2013/10/29 11:26:35 |         with SMTP (SubEthaSMTP 3.1.7) 
id HNCQ35IB
INFO   | jvm 1    | 2013/10/29 11:26:35 |         for raaghu@to.com;
INFO   | jvm 1    | 2013/10/29 11:26:35 |         Tue, 29 Oct 2013 11:26:34 
+0530 (IST)
INFO   | jvm 1    | 2013/10/29 11:26:35 | From: testjava@from.com
INFO   | jvm 1    | 2013/10/29 11:26:35 | To: raaghu@to.com
INFO   | jvm 1    | 2013/10/29 11:26:35 | Message-ID: 
<3341135.0.1383026084955.JavaMail.raaghu@RaaghuLaptop-PC>
INFO   | jvm 1    | 2013/10/29 11:26:35 | Subject: Some Sub3
INFO   | jvm 1    | 2013/10/29 11:26:35 | MIME-Version: 1.0
INFO   | jvm 1    | 2013/10/29 11:26:35 | Content-Type: text/plain; 
charset=us-ascii
INFO   | jvm 1    | 2013/10/29 11:26:35 | Content-Transfer-Encoding: 7bit
INFO   | jvm 1    | 2013/10/29 11:26:35 | 
INFO   | jvm 1    | 2013/10/29 11:26:35 | this is the body

*********************************************************************

Thanks and Regards
Raaghu.K

Original issue reported on code.google.com by raagh...@gmail.com on 29 Oct 2013 at 6:18

Attachments:

GoogleCodeExporter commented 9 years ago
Installing an authentication handler makes it possible to authenticate. It does 
not mean that authentication becomes a requirement for every mail transaction. 
See the Javadoc on the long SMTPServer constructor, and Issue 50 for more 
information. In addition, in the trunk there is an SMTPServer property which 
indiscriminately enforce authentication, if that is what you need. 

I will publish a new SubEthaSMTP within a few weeks which will contain the 
current trunk and patches for issue 60, 61, 62.

Original comment by hontvari@flyordie.com on 29 Oct 2013 at 11:14

GoogleCodeExporter commented 9 years ago
We need not authenticate for every mail transaction , but the first/bind 
request should be authenticated.

Thanks for your response 

Original comment by raagh...@gmail.com on 29 Oct 2013 at 12:04