Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Email notification through Gmail: Connection Timeout to smtp.gmail.com:587

I get the following error
[ERROR] Sending the email to the following server failed : smtp.gmail.com:587: Could not connect to SMTP host: smtp.gmail.com, port: 587: Connection timed out -> [Help 1]

The plugin I'm trying to use to send the mail is the following:
<plugin>
<groupId>ch.fortysix</groupId>
<artifactId>maven-postman-plugin</artifactId>
<executions>
<execution>
<id>send a mail</id>
<phase>package</phase>
<goals>
<goal>send-mail</goal>
</goals>
<inherited>false</inherited>
<configuration>
<from>library.ci.build@gmail.com</from>
<subject>Build ${env.BUILD_NUMBER}</subject>
<failonerror>true</failonerror>
<mailssl>true</mailssl>
<mailcontenttype>text/html</mailcontenttype>
<mailhost>smtp.gmail.com</mailhost>
<!-- to get out of Jazz: 587 -->
<mailport>587</mailport>
<mailuser>XXX</mailuser>
<mailpassword>XXX</mailpassword>
<mailAltConfig>true</mailAltConfig>
<htmlMessage>Build page here: &lt;a href="https://hub.jazz.net/pipeline/corneliupetrescu/LibraryBackend/builds/4acc9fca-7562-4546-af3b-3e6b36c1ab48/${TASK_ID}"&gt;https://hub.jazz.net/pipeline/corneliupetrescu/LibraryBackend/builds/4acc9fca-7562-4546-af3b-3e6b36c1ab48/${TASK_ID}&lt;/a&gt;</htmlMessage>
<receivers>
<!-- <receiver>${git.commit.user.email}</receiver> -->
<receiver>victorrentea@gmail.com</receiver>
</receivers>

</configuration>
</execution>
</executions>
</plugin>

From my local machine, this works OK.

Do you have any idea? Please help.

0 votes



4 answers

Permanent link
Hi Victor,

According to https://support.google.com/a/answer/176600?hl=en
The port for SSL connections is 465. 587 is for TLS connections.

Cheers, Simon

0 votes


Permanent link
Hi Simon,

Thank you for your answer !

You're right. I've mixed the two. I tried again:
<mailssl>true</mailssl>
<mailport>465</mailport> 
and
<mailssl>false</mailssl>
<mailport>587</mailport> 
Both configurations hang for ~1 min when sending the mail, and then result in error:
[ERROR] Sending the email to the following server failed : smtp.gmail.com:587: Could not connect to SMTP host: smtp.gmail.com, port: 587: Connection timed out
I suspect that there is some port blocking in place, but I don't know how to work around it. I say this because I've tried to set the server to www.gmail.com : 80 and there was some response (that caused an error afterall) -- but at least there was some response from the remote server.

Thank you!
Victor

0 votes


Permanent link
Hi Victor, to check if there is a firewall blocking your access to these ports, try the following command from a DOS window (on Windows) or a terminal window (Linux or Unix).
telnet smtp.gmail.com 587

You should see the response:
220 mx.google.com ESMTP c8sm40836399wjw.6 - gsmtp

On Windows type "Ctrl+$" then "quit" to exit "telnet"
On Linux and Unix type "Ctrl+]" then "quit" to exit "telnet"

If you do not see the reply from google then something on your network is blocking the port. Ask your system administrator.

Cheers, Simon

0 votes

Comments

Unfortunately I don't have SSH access on the Jenkins server that runs the maven build :(
Do you know how I can connect via SSH to the Jenkins server undelying Jazz ?
Thanks,
Victor


Permanent link
Sorry, you will have to talk to your server administrator, you will need access to the server that is contacting Google in order to debug this problem. If you can not have direct access, maybe your server administrator can run the commands; The server administrator will also know if there is a firewall setup on the server or between the server and the internet that could block these outgoing requests.
Cheers,
Simon

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 383
× 52
× 45

Question asked: Aug 18 '14, 4:50 a.m.

Question was seen: 17,858 times

Last updated: Aug 18 '14, 5:38 a.m.

Confirmation Cancel Confirm