-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add additional accounts #166
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't change whitespace it makes it very hard to review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No migration of existing settings
smtpAuthUsername = nullify(req.getParameter("ext_mailer_smtp_username")); | ||
smtpAuthPassword = Secret.fromString(nullify(req.getParameter("ext_mailer_smtp_password"))); | ||
mailAccount.setSmtp_username(nullify(req.getParameter("ext_mailer_smtp_username"))); | ||
mailAccount.setSmtp_password(nullify(req.getParameter("ext_mailer_smtp_password"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the loss of Secret.fromString
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it makes inside of class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is by design and is required to store the password encrypted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh sorry missed it in the subclass
this.smtpAuthPassword = Secret.fromString(Mailer.descriptor().getSmtpAuthPassword()); | ||
this.smtpAuthUsername = Mailer.descriptor().getSmtpAuthUserName(); | ||
mailAccount.setSmtp_username(Mailer.descriptor().getSmtpAuthUserName()); | ||
mailAccount.setSmtp_password(Mailer.descriptor().getSmtpAuthPassword()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again
return address; | ||
} | ||
|
||
public String getSmtp_host(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should really be getSmtpHost ie camelCase not a mix of camelCase and snake_case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking better, now I just need to give it a go ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not possible to specify the from address in a freestyle job atm which people will find confusing.
I also wonder if it would actually be better to configure the account not the from address which would allow overriding the from address
also noticed there is no Use SMTP Authentication checkbox for additional accounts. |
can't believe I missed this before but also need to add some unit tests |
9055510
to
f1f5dcb
Compare
sorry for rebase |
I'd like to see a test for create session if possible to assert that it used the right account, probably easiest to call it and then inspect the javamail properties on the returned session to see which server it used |
how are we going with this? I am waiting on this for the next release |
I don't know how to create mock session and test her. I had no free time to figure it out. |
You probably don't need to create a mock one I had a look and you should be able to call the function then get the properties off it and check it used the correct one |
@davidvanlaatum is it possible this broke the |
Added ability of additional smtp accounts and java mail parameters