Can't send test email after configuring Confluence (server edition) to send emails
Asked by Dialectik:

Confluence configuration for sending emails is done according to the information: <https://confluence.atlassian.com/conf74/configuring-a-server-for-outgoing-mail-1003129449.html>

It should be noted that at the beginning Confluence (server version) was installed on a server with a different IP address. Then the IP address was changed. But the mail server was configured with the same IP address of the server, which was originally and with a new IP address.

We set up our own mail server (192.168.Y.XXX) - sending from port 25. Physically, the mail server is located on the same machine as the server with Confluence installed (with the IP address 192.168.Y.ZZZ). The result is an error:

"An error has occurred with sending the test email:  

com.atlassian.mail.MailException: javax.mail.SendFailedException: Invalid Addresses;  

nested exception is:  

com.sun.mail.smtp.SMTPAddressFailedException: 554 5.7.1 \<evgen@mysite.ua\>: Recipient address rejected: SMTP AUTH is required for users under this sender domain ... "

There was also an attempt to configure sending mail through the Google service smtp.gmail.com through port 465. But this also produces an error:

"An error has occurred with sending the test email:

com.atlassian.mail.MailException: javax.mail.AuthenticationFailedException: 534-5.7.14 \<[https://accounts.google.com/signin/continue?sarp=1\&scc=1\&plt=AKgnsbt](https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbt)

534-5.7.14 ErwQQhmyYGEzhLBUitBsW3d7ujGpJcp2hyAIjbfmcIcoxinjfiS41a1Vc3eyilDekDbxk

534-5.7.14 ljcC76aIBNy129IdVx3U0c4m6xwSeFedYUMRK1Cp_4koxrmV4PsFA_vi9wV1ZFYG\>

534-5.7.14 Please log in via your web browser and then try again.

534-5.7.14 Learn more at

534 5.7.14 <https://support.google.com/mail/answer/78754> i18sm70145ljj.84 - gsmtp "

Logins and passwords are correct, Google authentication is one-factor (not two-factor). If I register port 587 for Google, then a timeout error is obtained.

I would be glad for any help.


Answers:
author: Kishan Sharma
body: Hi [@Dialectik](/t5/user/viewprofilepage/user-id/4199793) For the google smtp service, i can see "AuthenticationFailedException" in the error, you can refer [this thread](https://community.atlassian.com/t5/Confluence-questions/Problem-with-Mail-server-of-confluence/qaq-p/1805371) where similar issue was fixed.

comments: author: Dialectik
body: Thanks for the google smtp service it worked. But the main task is to send letters via own mail server (192.168.Y.XXX). This task has not yet been solved.


author: Kishan Sharma
body: Great. For your mail server, are you not able to send email to any user who has a valid email address as the error you are getting says "SendFailedException: ***Invalid Addresses***"


author: Dialectik
body: For now, the solution was to use Google SMTP with two factor authentication and app password


author: Brant Schroeder
body: [@Dialectik](/t5/user/viewprofilepage/user-id/4199793)

Is the connection actually happening? Do you have any software firewalls on the server that could be blocking the connection? Have you traced the connection to make sure it is going through?

comments: author: Dialectik
body: There is a firewall, but an exception is written for it, according to which it must pass all connections for sending mail from the corresponding server


author: Brant Schroeder
body: Have you tried disabling the firewall to see if it works when the firewall is off? Or have you done a trace to make sure the traffic is making it through?


author: Dialectik
body: Firewall is not a problem because there is no firewall except fail2ban - but this ip is whitelisted. log from server:

![image_2021_09_14T19_39_43_350Z.png](https://community.atlassian.com/t5/image/serverpage/image-id/160652iB007EE3B4B25C822/image-size/large?v=v2&px=999 "image_2021_09_14T19_39_43_350Z.png")


Tags: confluence-server

server