continuum-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vishnu Raj (JIRA)" <j...@codehaus.org>
Subject [jira] (CONTINUUM-1674) mail authentication with username/password doesn't work
Date Mon, 25 Nov 2013 08:54:45 GMT

    [ https://jira.codehaus.org/browse/CONTINUUM-1674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=336284#comment-336284
] 

Vishnu Raj commented on CONTINUUM-1674:
---------------------------------------

Can somebody help me with this? I have the same issue with 1.4.1. I have authentication for
smtp server, but it always fails. I tried to understand the above explanations, but I don't
see any dependencies to JndiJavamailMailSender class from Continuum. 

Where exactly this chages needs to be done?
                
> mail authentication with username/password doesn't work
> -------------------------------------------------------
>
>                 Key: CONTINUUM-1674
>                 URL: https://jira.codehaus.org/browse/CONTINUUM-1674
>             Project: Continuum
>          Issue Type: Bug
>          Components: Notifier - Mail
>    Affects Versions: 1.1, 1.4.1
>         Environment: Debian 4.0, Tomcat 6.0.14, jdk 1.6.0 u3
>            Reporter: René jahn
>              Labels: backlog-to-cleanup
>         Attachments: plex-javamail-2.patch, plex-javamail.patch
>
>
> I use continuum as tomcat webapp.
> If you use a mailserver with authentication, you can define following in the context.xml
of your webapp/META-INF:
>   <Resource name="mail/Session"
>             auth="Container"
>             type="javax.mail.Session"
>             mail.smtp.auth="true"
>             mail.smtp.host="mailserver"
>             mail.smtp.port="25"
>             mail.smtp.user="username"
>             password="password"/>
> The problem is, that the parameter password will be ignored. I found the problem in:
> org.codehaus.plexus.mailsender.javamail.JndiJavamailMailSender.getSession
> ->
> Context ctx = new InitialContext();
> Session s = (Session)ctx.lookup(jndiSessionName);
> The session doesn't contain a property called "password".
> My dirty workaround to solve the problem:
> renamed password to mail.smtp.password (in context.xml) and wrote a class which extends
JndiJavamailMailSender with overriden getSession:
> 	public Session getSession() throws MailSenderException
> 	{
> 		Session sess = super.getSession();
> 		
> 		Properties prop = sess.getProperties();
> 		
> 		prop.setProperty(JndiJavamailMailSender.MAIL_SMTP_PASSWORD, prop.getProperty("mail.smtp.password"));
> 		
> 		return Session.getInstance(prop, null);
> 	}
> Maybe you set the value of the constant MAIL_SMTP_PASSWORD to "mail.stmp.password" and
everything is fine!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message