How to address the sender to different email address using sendEmail() SIL routines Edited

I change my smtp email address and i tested it and it successfully connect and using the send a email test i tried to send an email to my account it works fine. but when i use it on my projects it is still using the old smtp email address that i have been changed before. im using it in sendEmail() SIL routine.

3 answers

1 accepted

Ive solved this issue its just because we need to grant the send on be half of both email.

0 vote
Ann Worley Atlassian Team Jan 08, 2018

Hi Randy,

I hope you don't mind a few questions before I offer an answer.

  1. When you changed your smtp email address, was that in Confluence administration>Mail servers? If not, where was it changed?
  2. Are you using our Atlassian Cloud offering or hosting Confluence Server yourself?
  3. If you are self-hosted, what version of Confluence are you using?
  4. Please let me know more about how you are using the email on your projects. Do you mean Jira projects? (Confluence does not have projects like Jira, but I understand you may use Confluence to work on other types of projects.)

I look forward to learning more about the issue you are running into, and helping however I can.

Thanks,

Ann

Hi Ann,

Im so sorry im just new in jira development i thought confluence just a feature/application of jira?

by the way i hope you can still help me.

1. Yes in my outgoing mail server see 1st.jpg here is where i change it.1st.jpg
2. were hosting our own server.
3. i think this is what your asking.(sorry for misunderstood)
2nd.jpg4. I need to send email to different user.
first we have an existing SMTP server (admin email) and i need to change the SMTP server to different email from (admin email) to (support email) using the same Host but different username and password.

second i test the connection and it is successful after that i tried using the send a test email to try it and i received the email.

third i need to use the sendEmail() routines of SIL for custom email that i will send in different functions/events in jira. 

Scenario: if i will use my new email(support email) in sendEmail() routines it will not send email to the recipient, but if i will use the old email(admin email) in sendEmail() routine the email will be sent and i received it.

I tried different things. changing the sender configuration, changing the project notification email but still i cant use my new smtp it will work fine if i will use the old one although i will not reset it back to the old smtp configuration still fine.

and if i will use the notification it will work fine. it only matters in the sendEmail() routine. i think its in the base url set in our general configuration?

i hope you can help me its been a week for debugging this issue.
if you still need more info just tell me ill provide it.

Thank you so much,
Randy

by the way were using outlook email servers
Thanks

Hi Randy, do you have logging configured for your Power Scripts add-on?

Configure JIRA Logging

This is the first place I think we should start.

Thanks

Hi Jonathan,

Done adding

"log4j.category.com.keplerrominfo = INFO, console, filelog
log4j.additivity.com.keplerrominfo = false
"

in atlassian-jira/WEB-INF/classes/log4j.properties

What should we do next.

Thank you so much,
Randy


Great, after you try to send an email and it doesn't go through are any messages in the logs? 

here is my mail sender configuration : send mail Via : Direct Sender, defaults

 

 

then here is the error log:

2018-01-15 08:59:07,072 pool-66-thread-2 ERROR randyd 1042x1022x1 1dt4p8f 192.168.85.158 /rest/keplerrominfo/refapp/latest/async-script/checkScript [c.k.s.email.direct.DirectMailSender] Cannot send email
com.sun.mail.smtp.SMTPSendFailedException: 550 5.7.1 Client does not have permissions to send as this sender

 at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2267)
 at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:2045)
 at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1260)
 at javax.mail.Transport.send0(Transport.java:255)
 at javax.mail.Transport.send(Transport.java:124)
 at com.keplerrominfo.sil.email.direct.DirectMailSender.sendMail(DirectMailSender.java:162)
 at com.keplerrominfo.sil.email.TextProcessingMailSender.sendMail(TextProcessingMailSender.java:30)
 at com.keplerrominfo.sil.lang.routines.system.SendEmailRoutine._executeRoutine(SendEmailRoutine.java:204)
 at com.keplerrominfo.sil.lang.routines.system.SendEmailRoutine.executeRoutine(SendEmailRoutine.java:88)
 at com.keplerrominfo.sil.lang.AbstractRoutine.execute(AbstractRoutine.java:77)
 at com.keplerrominfo.sil.lang.grammar.ASTCallNode.interpret(ASTCallNode.java:73)
 at com.keplerrominfo.sil.lang.grammar.SILNode.interpret(SILNode.java:139)
 at com.keplerrominfo.sil.lang.grammar.ASTReturnNode.interpret(ASTReturnNode.java:40)
 at com.keplerrominfo.sil.lang.grammar.SILNode.interpret(SILNode.java:139)
 at com.keplerrominfo.sil.lang.grammar.ASTParseNode.interpret(ASTParseNode.java:37)
 at com.keplerrominfo.sil.lang.executors.CachedInterpreterExecutor.directInterpret(CachedInterpreterExecutor.java:86)
 at com.keplerrominfo.sil.lang.executors.CachedInterpreterExecutor.interpret(CachedInterpreterExecutor.java:79)
 at com.keplerrominfo.sil.lang.SILInterpreter.interpret(SILInterpreter.java:92)
 at com.keplerrominfo.jira.commons.ivm.IssueSILInterpreter.interpret(IssueSILInterpreter.java:185)
 at com.keplerrominfo.refapp.sil.impl.AbstractSimpleLanguageService.interpret(AbstractSimpleLanguageService.java:166)
 at com.keplerrominfo.refapp.sil.SILRunCallable.createResult(SILRunCallable.java:63)
 at com.keplerrominfo.jira.commons.sil.impl.JIRASILRunCallable.createResult(JIRASILRunCallable.java:65)
 at com.keplerrominfo.jira.commons.sil.impl.JIRASILRunCallable.createResult(JIRASILRunCallable.java:26)
 at com.keplerrominfo.refapp.threading.AsyncRunnerCallable.call(AsyncRunnerCallable.java:65)
 at com.keplerrominfo.refapp.threading.AsyncRunnerCallable.call(AsyncRunnerCallable.java:22)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at java.lang.Thread.run(Thread.java:745)
2018-01-15 08:59:07,072 pool-66-thread-2 ERROR randyd 1042x1022x1 1dt4p8f 192.168.85.158 /rest/keplerrominfo/refapp/latest/async-script/checkScript [c.k.s.l.routines.system.SendEmailRoutine] Could not send mail [ex].
com.keplerrominfo.sil.email.EmailException: Cannot send email
 at com.keplerrominfo.sil.email.direct.DirectMailSender.sendMail(DirectMailSender.java:171)
 at com.keplerrominfo.sil.email.TextProcessingMailSender.sendMail(TextProcessingMailSender.java:30)
 at com.keplerrominfo.sil.lang.routines.system.SendEmailRoutine._executeRoutine(SendEmailRoutine.java:204)
 at com.keplerrominfo.sil.lang.routines.system.SendEmailRoutine.executeRoutine(SendEmailRoutine.java:88)
 at com.keplerrominfo.sil.lang.AbstractRoutine.execute(AbstractRoutine.java:77)
 at com.keplerrominfo.sil.lang.grammar.ASTCallNode.interpret(ASTCallNode.java:73)
 at com.keplerrominfo.sil.lang.grammar.SILNode.interpret(SILNode.java:139)
 at com.keplerrominfo.sil.lang.grammar.ASTReturnNode.interpret(ASTReturnNode.java:40)
 at com.keplerrominfo.sil.lang.grammar.SILNode.interpret(SILNode.java:139)
 at com.keplerrominfo.sil.lang.grammar.ASTParseNode.interpret(ASTParseNode.java:37)
 at com.keplerrominfo.sil.lang.executors.CachedInterpreterExecutor.directInterpret(CachedInterpreterExecutor.java:86)
 at com.keplerrominfo.sil.lang.executors.CachedInterpreterExecutor.interpret(CachedInterpreterExecutor.java:79)
 at com.keplerrominfo.sil.lang.SILInterpreter.interpret(SILInterpreter.java:92)
 at com.keplerrominfo.jira.commons.ivm.IssueSILInterpreter.interpret(IssueSILInterpreter.java:185)
 at com.keplerrominfo.refapp.sil.impl.AbstractSimpleLanguageService.interpret(AbstractSimpleLanguageService.java:166)
 at com.keplerrominfo.refapp.sil.SILRunCallable.createResult(SILRunCallable.java:63)
 at com.keplerrominfo.jira.commons.sil.impl.JIRASILRunCallable.createResult(JIRASILRunCallable.java:65)
 at com.keplerrominfo.jira.commons.sil.impl.JIRASILRunCallable.createResult(JIRASILRunCallable.java:26)
 at com.keplerrominfo.refapp.threading.AsyncRunnerCallable.call(AsyncRunnerCallable.java:65)
 at com.keplerrominfo.refapp.threading.AsyncRunnerCallable.call(AsyncRunnerCallable.java:22)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at java.lang.Thread.run(Thread.java:745)
Caused by: com.sun.mail.smtp.SMTPSendFailedException: 550 5.7.1 Client does not have permissions to send as this sender

 at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2267)
 at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:2045)
 at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1260)
 at javax.mail.Transport.send0(Transport.java:255)
 at com.keplerrominfo.sil.email.direct.DirectMailSender.sendMail(DirectMailSender.java:162)
 ... 23 more

Randy, I am trying to get some developer support on this. Can you try changing to Container Sender in you Mail Sender Options?

Thanks

yeah i already done doing it. i tested with all the option. if i set it on container sender then it will run using the new smtp that i have configured. but when i used the Direct Sender, defaults the notification will run using different email, and the old smtp that i configure will works well in SIL sendEmail() routine, but if i use the new smtp email server it will not send any email. i found out that if I use different sender except on my old smtp email it will not work/send any email in Direct Sender, defaults. i appreciate your effort i need to fix this because its been 2weeks since i started debugging this scenario.

 

Changing my old smtp server configuration from(admin email) to (support email).


Copied at the top conversation:

Using Direct Sender, defaults:
"Scenario: if i will use my new email(support email) in sendEmail() routines it will not send email to the recipient, but if i will use the old email(admin email) in sendEmail() routine it works well.

I tried different things. changing the sender configuration, changing the project notification email but still i cant use my new smtp it will work fine if i will use the old one although i will not reset it back to the old smtp configuration still fine.

and if i will use the notification it will work fine. it only matters in the sendEmail() routine. "

Using Container Sender
Scenario: if i will use my new email(support email) in sendEmail() routines it will send email to the recipient, but if i will use other email like (admin email) in sendEmail() routine the email will not send  and will be in email queue. And send notification will not run/ will just stay at the mail queue unless I set the notification scheme to my new email (support email). 


just let me know if you still need more details. 



Thank you so much,
Randy

Clarification:

I just need to send custom email using different email using SIL sendEmail() routines only. example : i need to send email using support email and admin email as the sender.

thats was my goal here.

Thank you,
Randy

Hi Randy, the developers are telling me that the error message you are seeing means that there is a error in the email configuration. Some possible causes of this could be:

  • Incoming IP address is blacklisted
  • Improper SMTP address is being used
  • Individual client authorization issues

Either way it appears that this is an issue you will probably need to take up with your email administrator.

See the following links for some additional information about the error:

http://forums.msexchange.org/m_1800412481/printable.htm
https://community.ivanti.com/docs/DOC-53284

Hi Jonathan,

Ill check it out maybe give me a day to response about this.


Thank you,
Randy

Hi jonathan,

I just want to know if it is possible to send email using different user email address in sendEmail() routine on SIL? 

Thank you,
Randy

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

355 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you