Unable to send email using Jenkins and SES - email

I am running Jenkins version 1.554.1 on Amazon EC2 Instance
I am using mailer plugin and currently trying to configure sending emails on failed job builds.
Hitting "test configuration" button gives me "javax.mail.AuthenticationFailedException: 501 Input line length is too long!" error.
Screenshot of settings is attached. I also tried to check "Use SSL" checkbox, but result was equal.
What do I miss?

The problem was that I was trying to use my AWS credentials (AWS access key ID and secret access key). This document describes how to create SES credentials: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html?icmpid=docs_ses_console
So, solution was to open SES SMTP Settings, create new credentials and use them.

Amazon SES requires Transport Layer Security (TLS) connection. This is different than an SSL connection.
I would check the instance OS documentation on setting up TLS.
Here's an SO post about Jenkins and TLS

Related

Dynamics CRM Email Router not using proxy

I am trying to set up the CRM Email Router to allow our internally hosted ADX Studio Portal to communicate with our externally hosted Dynamics CRM instance.
I have set up the Configuration profile to meet the requirements of our exchange server and created a deployment to an online service provider with the necessary details.
When I attempt to load the data the Email Router Config Manager states that it was unable to retrieve the data:
Metadata contains a reference that cannot be resolved:
'https://CRM.URL/XrmServices/2011/Discovery.svc?wsdl
When we traced the email router with Fiddler the request receives a 407 Proxy Authentication Required message:
Your credentials could not be authenticated: "Credentials are
missing."
We have tested the Email Router tool on a personal network (with no proxy requirements) and everything works correctly. However once we are on the internal network which requires the proxy the Email Router Config Manager no longer works.
We have tried using the Dynamics CRM SDK and and the crmsvcutil.exe command line tool but are not sure how it actually tells the Email Router what configuration to use.
Any help is greatly appreciated. Thanks.
The only way to resolve this is to add an authentication bypass on proxy server for the server and/or service account of the email router.
You can try add section to email router .config file, with proxy settings. This is .net app, so it should pick it up. I never tried this for email router, but might be worth a shot. look here for details
The answer we received from a MS support technician was "you need to ensure that the proxy will let through (without any modification) any requests to the CRM Web Serviceā€.
We also tried modifying the .config file to include the proxy settings but it didn't work.
We are going to open an official case with MS. Will let you know if we ever get it working.

use smtp.mydomain.com to forward to smtp.gmail.com?

I am using google apps for email. I can send email out through c# code fine with smtp.gmail.com.
I would like to be able to use the name smtp.mydomain.com instead, but still have it go to smtp.gmail.com. I tried just seeing a CNAME in my DNS settings, but I get this error:
"The remote certificate is invalid according to the validation procedure."
Any ideas?
Thanks.
Yes, you can't, the TLS certificate used to communicate privately with the remote SMTP server is signed with smtp.gmail.com. The only solution is to create a SMTP relay with sendmail for example on your own server.

using Windows Azure Connect local endpoint to send email from web role

I am trying to send email using one of our on-premises servers from one of my web roles hosted on azure. We've got a Windows Azure Connect endpoint installed on this on-premises server which has an SMTP server.
We've configured the web role so that it contains an activation code I acquired using the windows azure portal and the azure subscription we have. The web role has been deployed to azure with this configuration. Looking in the virtual network section of the portal I can see our on-premises server listed as well as the instance of said web role. I Created a group connecting the local endpoint to the web role instance.
The problem I'm having now is figuring out exactly what I have to do in order for the emails I send from the web role to be relayed through the smtp server on the on-premises server.
My first thought was to just specify the local endpoint name as it appears in our azure portal as the host to use when I create my SmtpClient object in code. Of course this didn't work as I received an SmtpException just saying Failure Sending Email.
So my question is once I've set everything up as described above, what do I need to do in ,my web role code and/or configuration in order to use the local endpoint as the smtp host for sending out my emails??
How about open your firewall for the SMTP on both your azure VM and local server.
As I know the azure VM firewall disabled the PING (ICMP) but doesn't know if it blocked all ports except those defined in your CSDEF file.

Using authsmtp from a Grails server

This is quite a specific question, and I have had no luck on the grails nabble forum, so I thought I would post here. I am using the grails mail plug-in, but I think my question is a general one about using authsmtp as an email gateway from my server.
I am having trouble sending mail from my app using authsmtp. I have installed and configured the mail plugin and was originally using my ISP's SMTP server to send mails. However when I deployed to AWS EC2 this failed because my elastic IP was blocked by the SMTP host. So I bought myself an authsmtp account and set up my server email address as an accepted one at authsmtp.
I then changed my configuration in SecurityConfig.groovy to point to the authsmtp server that I had been designated...
mailHost = "mail.authsmtp.com"
mailUsername = "myusername"
mailPassword = "mypassword"
mailProtocol = "smtp"
mailFrom = "valid-authsmtp-address#mydomain.com"
mailPort = 2525
...and I'm just trying to get this to work locally before I deploy back up to AWS. Sending mail fails and in my log I have this exception:
2010-02-13 10:59:44,218 [http-8080-1] ERROR service.EmailerService - Failed to send emails: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 513 5.0.0 Your email system must authenticate before sending mail.
org.springframework.mail.MailSendException; nested exception details (1) are:
Failed message 1:
com.sun.mail.smtp.SMTPSendFailedException: 513 5.0.0 Your email system must authenticate before sending mail. at
com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)
I'm a bit lost since the username and password I provide in the
configuration are definitely correct.
A terse and not very helpful conversation with authsmtp support suggests
that I need to MD5 and/or base64 encode my credentials before sending, so my
question is in three parts...
1) any idea what's going on with the failure and why that message is
appearing?
2) how would I encode the credentials to pass to authsmtp and how would I
configure that for the mail plugin
3) has anyone successfully connected and sent mail through authsmtp from the
mail plugin and specifically from AWS EC2?
When sending Email using the Acegi plugin, under the hood a Spring JavaMailSenderImpl is used. Looking at its docs:
Note that the underlying JavaMail Session has to be configured with the property "mail.smtp.auth" set to true, else the specified password will not be sent to the mail server by the JavaMail runtime. If you are not explicitly passing in a Session to use, simply specify this setting via setJavaMailProperties(java.util.Properties).
So append to your SecurityConfig.groovy the following:
javaMailProperties = [ "mail.smtp.auth": true]
I didn't find a solution to this using the Grails mail plugin, so I'm still interested in an answer, however I did find a workround. It may be useful in case anyone else follows me down this lonely path.

Dotproject

I Have install dot project on linux machine. using ssmtp for gmail account to sending emails for mails notifications . but when i create any user it doesn't send mails to user email ID for account creation. but i send maail form shell prompt.the error i am getting is Failed to send email: 530 5.7.0 Must issue a STARTTLS command first. 22sm11794837wfd.6 added :( . Please help me if any one have solution....
Gmail requires a secure connection (TLS or SSL).
You need to configure SSMPT (not dotProject) to talk securely with Google's SMTP server.
I think you can just add the following to your ssmtp.conf file and (assuming your SSMTP package was compiled with SSL support) it should then work:
UseTLS=YES
Or perhaps:
UseSTARTTLS=YES
More info here.
I assume "530 5.7.0 Must issue a STARTTLS command first." means that you have to connect with TLS (Transport Layer Security). Does dot project support that?