Redmine actionmailer ssl failure - actionmailer

I recently upgraded Redmine from 2.2.x to 2.3.0. At first it looked like the upgrade was smooth and successful, but my manager noticed that she wasn't getting any emails after the upgrade. I tried sending a test email from the email settings page and get the following error:
An error occurred while sending mail (uninitialized constant OpenSSL::SSL::VERIFY_OPENSSL)
gem
From my configuration.yml
default:
# Outgoing emails configuration (see examples above)
email_delivery:
delivery_method: :smtp
smtp_settings:
address: '192.168.10.211'
port: 25
domain: 'mydomain.com'
openssl_verify_mode: OpenSSL::SSL::VERIFY_NONE
We have a local mail relay that is open to the internal network, and this configuration worked fine with the previous version of Redmine. I have verified that I can reach the server and can send email through telnet, so the relay is accepting email from the server. The issue seems to be in Redmine / ruby.
Misc details that might be helpful:
Ruby 1.8.7
RubyGems 1.8.25
actionmailer (3.2.13, 3.2.11)
disclaimer: I am a PHP guy, so if you need more info just lemme know and I will try to track it down.

I found a solution to my issue after some playing around with the configuration settings and reading this issue.
I ended up with this:
# default configuration options for all environments
default:
# Outgoing emails configuration (see examples above)
email_delivery:
delivery_method: :smtp
smtp_settings:
address: '192.168.10.211'
port: 25
domain: 'mydomain.com'
enable_starttls_auto: false
#openssl_verify_mode: 'none'
From my config above I commented out openssl_verify_mode and added the enable_starttls_auto set to false. This seems to have gotten me back up and running.

Mine worked when I used both
enable_starttls_auto: false and openssl_verify_mode: 'none' together.

Related

Java Web application not sending Email on Ubuntu server

My play framework web application sends automatically emails to user using Apache commons email library, everything works fine on my machine, but when I deploy it on an Ubuntu server it is unable to send email.
It throws exceptions like org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.googlemail.com:465 (I also tried different configuration with smtp.google.mail port 465,25 and 587 with or without ssl and tls)
and connection timed out.
I starting to believe that is a problem of some configuration of my ubuntu server.
Any suggestion?
If i type ufw status command I receive status disabled.
Thanks
I am going to close this question, because I found the solution. Basically my Server provider (Scaleway) has a security configuration where SMTP is blocked. I asked them to unlock It.

SMTP Error: 454 4.7.0 Too many login attempts, please try again later

I have set up SMTP server with gmail account. It was working fine till few days back. When I checked the logs I found below entry in it:
SMTP Error: 454 4.7.0 Too many login attempts, please try again later.
I have restarted SMTP service twice. I have checked the configuration that was set up using this link. Everything is same as we have set up. I have restarted the SMTP server & the machine too.
I have checked for 2 step verification settings. It is not enabled. I have checked for "less secure" apps settings and it is set to Enabled as suggested here.
I have checked apps enabled as suggested here using below link.
https://security.google.com/settings/security/permissions?pli=1
But no apps are added. Can anyone suggest anything that I need to look for? Thanks in advance.
It is because you are attempting to create a new smtp connection for each email. You need to use SMTP pool.
Please see:
DELIVERING BULK MAIL
POOLED SMTP
Pooled smtp is mostly useful when you have a large number of messages that you want to send in batches or your provider allows you to only use a small amount of parallel connections.
If you are using Node-mailer:
const transporter = nodemailer.createTransport({
host: 'smtp.gmail.com',
port: 465,
secure: true,
pool: true, // This is the field you need to add
auth: {
user: 'test#test.com',
pass: 'your_password'
}});
Then, you need to close the pool once you send all the emails.
transporter.close();
I had the same issue. When I checked the Mail queue there were many unprocessed mails in the queue.
So I deleted the bulk mails and restarted the instance. Once the Mail Queue is cleared then it started to send mails as usual.
Hope this will be useful for anybody to have the above issue.
The Issue resolved with the TCP port changing to 587 from 25 in Outbound Connections settings in SMTP Server.
please follow the instructions below:
Open Gmail from a browser and only sign into the account you're
trying to add. Be sure to be signed out of all your other accounts
Go to this link: https://accounts.google.com/b/0/displayunlockcaptcha and click
Continue or confirm.
Now Test your program it will work fine
The Issue resolved change the password mail server password
It may be because the mail's size is greater than the allowed size (25MB).

Jenkins SMTP connection refused. What am I missing?

I've got Jenkins ver 1.524 installed on a Windows 7 box and I'm trying to configure email but the "Test configuration" is reporting errors. Jenkins is running as a service under my own domain account.
My settings are as follows:
SMTP server: smtp.corpdomain.com
Default user email suffix: #corpdomain.com
Not using authentication
Not using SSL
SMTP port: 25
Reply-To Address: tools#corpdomain.com
Charset: UTF-8
When I test the configuration, I usually get the following exception:
javax.mail.MessagingException: Could not connect to SMTP host: smtp.amazon.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
Yet every once in a while I receive the following instead:
com.sun.mail.smtp.SMTPSendFailedException: 553 5.1.8 <nobody#nowhere>... Domain of sender address nobody#nowhere does not exist
;
nested exception is:
com.sun.mail.smtp.SMTPSenderFailedException: 553 5.1.8 <nobody#nowhere>... Domain of sender address nobody#nowhere does not exist
However, I am able to send mail from the command line without errors via both python script and java (using javax.mail) without authentication, and I'm able to telnet to the SMTP server on port 25, so I don't see how it could be a firewall issue.
One other note that may be related: When I try to install a plug-in via the Jenkins web interface, I receive a 403 response for the URL "http://updates.jenkins-ci.org/update-center.json?uctest". However, I'm able to connect to that URL from a browser on the same machine.
Could this be a Tomcat configuration issue? I'm not familiar with Tomcat so I'm not sure where to even start looking. Maybe a Jenkins configuration that I've missed? Any other ideas?
Thanks in advance!
FWIW The nobody#nowhere address is the default address Jenkins comes with for the system admin email address (which is used as the from address when sending emails)
you can change it at
Manage Jenkins > Configure System > Jenkins Location
first, use port 465
second, get your email verified in AWS SES, and change your default sending email from here:
Jenkins -> Configure System -> Jenkins Location -> System Admin e-mail address
Still looks to me like your firewall is blocking Jenkins' service from accessing those ports -
especially as the connection times-out, which is typical for such cases.
Suggest you try to disable the firewall completely and see if there is any change.
Cheers
To check for conectivity problems from Jenkins, I would go to the Script Console at Manage Jenkins -> Script Console, and there, try to connect to the port you want to test (25 in your case), with a Groovy script like:
s = new Socket()
s.setSoTimeout(200)
s.connect(new InetSocketAddress("smtp.corpdomain.com", 25), 200)
s.close()
If you don't receive any kind of IOError, then there is no problem with the conectivity.
Note: I could have used simply new Socket("smtp.corpdomain.com", 25) but it will try forever to connect if the Firewall ignores your attempts.
For the SMTPSendFailedException you eventually receive, as #paul-henry mention:
The nobody#nowhere address is the default address Jenkins comes with for the system admin email address (which is used as the from address when sending emails)
you can change it at
Manage Jenkins > Configure System > Jenkins Location
Resources:
Networking with Groovy
Add a timeout when creating a new Socket
Thanks for submitting an edit. It is only visible to you until it’s been approved by trusted community members
first, use port 465 second, get your email verified in AWS SES, and change your default sending email from here: Jenkins -> Configure System -> Jenkins Location -> System Admin e-mail address
Thanks. It helps me!
My problem was "550-Verification failed for "

Symfony framework: How do I send email from localhost?

Using symfony framework how can I send test emails from localhost?
What are most easiest ways?
Thank you!
The easiest way, I suppose and what I normally do, is to configure the _dev environment to use good old Gmail (or any other provider for that matter). Set this up in your apps/frontend/config/factories.yml:
dev:
mailer:
class: sfMailer
param:
logging: %SF_LOGGING_ENABLED%
charset: %SF_CHARSET%
delivery_strategy: realtime
transport:
class: Swift_MailTransport
param:
host: smtp.gmail.com
port: 465
encryption: ssl
username: username#gmail.com
password: your-password
Sending e-mails will ofcourse take a little longer because PHP would have to connect to Google's servers and deliver the message.
This way you can worry about setting up a proper SMTP on your production server, and just let your dev machine be for development. Another advantage is if your develop on the road, and your local cafe / airport / kiosk blocks port 25 (they usually do) you won't have problems delivering mail.
You could install a mail server such as Postfix, and configure it to use an external mail server as an SMTP relay. Otherwise, most email services will either refuse to accept your message, or categorize it as spam.
This thread at serverfault might be helpful to you-it explains how to configure postfix to relay emails through gmail: Configure Postfix to send/relay emails Gmail (smtp.gmail.com) via port 587

How do I fix "501 Syntactically invalid HELO argument(s)"?

I'm using exim on both the sending and relay hosts, the sending host seems to offer:
HELO foo_bar.example.com
Response:
501 Syntactically invalid HELO argument(s)
Possibly a problem with underscores in the hostname?
http://www.exim.org/lurker/message/20041124.113314.c44c83b2.en.html
Underscores aren't actually valid in internet host names, despite some people using them anyway. A sane DNS server should not allow you to have records for them.
Change your system's host name so it's valid, hopefully this will fix it.
After spending so many hours trying to fix this problem, which in my case just come up from nothing, I ended up with a solution. In my case, only the systems deployed to Suse OSs suddenly stopped sending emails but not those ( the same ) running on Ubuntu. After exhausting and eliminating all the suggested possibilities of this problem and even considering to change de OS of those machines, I found out that somehow the send email service is sensible to the hostname of the host machine. In the Ubuntu machines the file /etc/hosts have only the following line:
127.0.0.1 localhost
and so were the Suse machines, which stopped sending the emails. After editing the /etc/hosts from Suse machines to
127.0.0.1 localhost proplad
where proplad is the hostname of the machine, the errors were vanished. It seems that some security policy ( maybe from the smtp service ) uses the hostname information carried through the API, which was being ignored in the case of the Ubuntu machines, but not in the case of Suse machines. Hope this helps others, avoiding massive hours of research over the internet.
Diago's answer helped me solve the problem I have been trying to figure out.
Our Suse OS also stopped working out of nowhere. Tried every suggestion that I found here and on google. Nothing worked. Tried adding our domain to etc/hosts but that did not help.
Got the hostname of server with the hostname command. Added that hostname to the etc/hosts file just like Digao suggested.
127.0.0.1 localhost susetest
I saved the changes, then ran postfix stop, postfix start. And works like a charm now.
The argument to HELO should be a hostname or an IP address. foo_bar.example.com is neither an IP address nor a hostname (underscores are illegal in hostnames), so the error message is correct and there is nothing to fix.
Using qmail I came across this problem. I realised this was because of a previously unfinished installation.
1) When sending email qmail announces itself to other SMTP servers with "HELO ..." and then it adds what is in the file at: /var/qmail/control/me
(sometimes the file is located at /var/qmail/control/helohost)
2) This file should have a hostname with a valid DNS entry in.
Mine did not it had (none) which is why mails were failing to be sent.
I found that my local dev server suddenly stopped sending emails (using external SMTP) and on the server logs I found:
rejected EHLO from cpc96762-*******.net [..**.68]: syntactically invalid argument(s): 127.0.0.1:8888/app_dev.php
127.0.0.1:8888/app_dev.php is my local URL, I am using Docker, Symfony and Swift Mailer.
The only solution that helped in my case was adding the parameter:
local_domain = "localhost"
to my Swift Mailer configuration. That solved all the problems.
See the docs for the Swift Mailer local_domain option: https://symfony.com/doc/current/reference/configuration/swiftmailer.html#local-domain