jmeter mail reader sampler connection issues - email

I am trying to check my gmail with a mail reader sampler in jmeter and enabled both imap and pop3 in my gmail account.
Everytime I try to connect to gmail, I keep getting this error:
Response message: javax.mail.MessagingException: Connect failed;
nested exception is: java.net.ConnectException: Connection refused: connect
This is my query:
Click me
I tried both SSL and TLS option at the bottom. I tried adding and leaving out the port. Also experimented with leaving out "#gmail.com" portion in my email address. And also wrote the protocol as pop3 and as pop3s. Not sure why it won't work.
I am on a corporate wifi, I don't know if that could be the thing causing the issue.

First of all, make sure JMeter can connect the Internet. To validate it add HTTP Request sampler and insert any Internet IP address or hostname in the relevant input, i.e. example.com
If the request succeeds - double check Mail Reader Sampler settings. If request is failing - most likely you're sitting behind corporate proxy and need to configure JMeter to use it.
In regards to the Mail Reader Sampler configuration for POP3 protocol should look as follows:
Protocol: pop3s
Host: pop.googlemail.com
Port: 995
Username: username#gmail.com
Password: your account password
Security Settings: Use SSL
You may also need to turn on access for less secure apps in your Google Account settings
See Load Testing Your Email Server: How to Send and Receive E-mails with JMeter

Thanks for your response! It was a wifi issue so I had to use the public wifi offerred by the company to make it work.
Also, note that I got it to work with imap instead. Here are the configs I used:
Protocol: imaps
Host: imap.gmail.com
Port: 993
Username: username (don't include #gmail.com)
Password: your account password
Security Settings: Use SSL

Related

Jenkins SMTP Configuration - 535 Authentication Failed

I'm trying to configure Jenkins email notification via Mailer plugin 1.21.
I'm using secureserver.net as a mailing server.
I have a problem with "SMTP Authentication", the "Test configuration" is reporting 535 Authentication:
Failed to send out e-mail
javax.mail.AuthenticationFailedException: 535 Authentication Failed
for jenkins#xxxx.com
at
com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:809)
at
com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:752)
at
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:669)
at javax.mail.Service.connect(Service.java:317) at
javax.mail.Service.connect(Service.java:176) at
javax.mail.Service.connect(Service.java:125) at
javax.mail.Transport.send0(Transport.java:194) at
javax.mail.Transport.send(Transport.java:124)
My settings are as follows:
SMTP server: smtpout.secureserver.net
Use SMTP Authentication: yes
User Name: jenkins#xxxx.com
Password: ******
Use SSL - yes
SMTP Port - 465
Charset - UTF-8
I'm using the same credentials to connect via webmail: https://email11.secureserver.net/webmail.php. I don't have a connection problem.
Do you have any explanation why jenkins refuse to authenticate?
As google doesn't allow login from less secure apps you have do the following steps:
1. Login to "https://myaccount.google.com/security"
2. Enable "Allow less secure apps" to "ON"
Then check the "Test configuration" in jenkins.
From https://products.secureserver.net/email/email_outlook.htm:
NOTE: "smtpout.secureserver.net" is an SMTP relay server. In order to
use this server to send e-mails, you must first activate SMTP relay on
your e-mail account. Log on to your Manage Email Accounts page to set
up SMTP relay.
Did you do this?
I solved similar issue by creating a new SMTP credential from AWS SES.
But I am still amazed why old credentials didn't work with jenkins even if it was working with other applications.

SwiftMailer not send mail with Google App account

I'm using Symfony and I'm trying to send an email with swiftmailer. I have an account set up with google app (produccion#mydomain.com) and when I try to send shows me the following error:
Failed to authenticate on SMTP server with username
"produccion#mydomain.com" using 2 possible authenticators
I tried it with my personal gmail account and send the message correctly with the same settings. Just change the username and password.
# Swiftmailer Configuration
swiftmailer:
transport: smtp
host: smtp.gmail.com
username: produccion#mydomain.com #email#gmail.com
password: google_app_password #gmail_password
auth_mode: login
port: 587
encryption: tls
I've been searching the internet and I've found this page from Google, where I can change the access to less secure applications.
https://www.google.com/settings/security/lesssecureapps
In my gmail account this option is active, but if I turn shows me the same error when sending email.
I've been trying to change this setting in google app account but it tells me that this option is not available for google app.
Any idea to send emails from this account by google app? I have to set something else?
EDIT
It seems Gmail prefers OAuth, Swiftmailer supports this authentication mech but its not really documented.
https://developers.google.com/gmail/xoauth2_protocol
https://github.com/swiftmailer/swiftmailer/blob/5.x/lib/classes/Swift/Transport/Esmtp/Auth/XOAuth2Authenticator.php
Any idea how I use it in Symfony?
Have you tried setting the transport parameter to gmail as mentioned in the cookbook? http://symfony.com/doc/current/cookbook/email/gmail.html
# Swiftmailer Configuration
swiftmailer:
transport: gmail
username: your_gmail_username
password: your_gmail_password

Stuck while trying to send email notification from SonarQube

I could'n send email notification from sonarqube even after configuring the email server, from Settings > General Settings > General > Email
I tried following : this suggestion but I got the same message error : Sending the email to the following server failed : smtp.gmail.com:587
Have I to set up something out of SonarQube ?
To send email through GMail SMTP server, you should use the following configuration:
SMTP Host: smtp.gmail.com
SMTP Port: 465
Use secure connection: SSL/TLS
Obviously, you have to specify your username ("foo.bar#gmail.com") and a password (generated in your GMail security settings).
From your SonarQube instance go to:
Settings > General Settings > General > Email
Set:
SMTP Host: smtp.gmail.com
SMTP Port: 587
Use secure connection: SSL/TLS
Fill in your smtp.username and smtp.password by generating an app password in gmail. This link might work.

Authentication failed. Please check your username/password. [Server response: DNS Error: Domain name not found code(0) ]

i am trying to configure my host mail to gmail. POP3 is working. But while trying to configure it shows following error. DNS working perfectly and i can able to receive mails via POP3 in gmail. Only i cannot able to reply from this same mail id, which is receiving.
PORTs are tried is : 587 and 465
both are not working. Please help me out
Authentication failed. Please check your username/password.[Server response: DNS Error: Domain name not found code(0) can]
what will i have to do?
It was happen because the service was down at the time. Later , I have configured again in 587 port with Secured connection using TLS (recommended) method.

Gmail smtp configuration for Drupal 7

I want to send email in Drupal 7. So, does anyone know how to configure Gmail SMTP on Drupal 7?
Download SMTP module and enable it.
Go to Admin > Configuration > SMTP authentication support and set the following values:
Turn on the module at the Install options fieldset at the top.
SMTP server settings:
smtp server: smtp.gmail.com
smtp backup server: leave blank.
smtp port: 465
use encrypted protocol: select "use SSL"
SMTP authentication:
Enter a valid Gmail email address and password.
Email options:
Set the same email address that you used at SMTP Authentication. Using a different account is called Phishing
Send test email: set an email to receive a sample email.
Enable debugging: yes.
3. Click on submit and verify that the email was submitted and that you received it. If not, read carefully the debug information at the top of the screen. Once satisfied, remember to deactivate the debug checkbox.
Step 1: Download SMTP module and enable it.
Step 2: Go to Admin > Configuration > System > SMTP authentication support and set the following values:
Turn this module on or off: On.
SMTP server settings:
smtp server: smtp.gmail.com
smtp backup server: leave blank.
smtp port: 465
use encrypted protocol: select "use SSL"
SMTP authentication:
Enter a valid Gmail email address and password.
Email options:
Set the same email address that you used at SMTP Authentication.
Send test email: set an email to receive a sample email and to test whether the module is working.
Enable debugging: yes.
Step 2a(Optional): Allow Less Secure Apps Access which is here: http://www.google.com/settings/security/lesssecureapps
Step 3: Click on Save and go to your inbox to check. If there is an testing email then it is fine.
Note: Your email address provided in your smpt setting MUST be the same like in your site information.
I hope SMTP Authentication Support module will help you.
For me, just following the steps in Juampy's answer didn't work. The error "Unable to send mail. Contact site administrator." continued to display. Do the following first and then configure SMTP module as per his answer.
Before installing SMTP module, download PHPMailer and extract it. Rename the folder as 'phpmailer' and copy the folder into module folder of SMTP module. Then, install the SMTP module.
An alternative configuration is as follows:
smtp port: 587
use encrypted protocol: select "use TLS"
This blog entry has some more up-to-date info:
http://www.stevepolitodesign.com/blog/drupal-configure-smtp-module-work-gmail-updated
Install and set-up module:
Install the SMTP Authentication Support module in the usual way.
Navigate to the configuration page admin/config/system/smtp
Under Turn this module on or off select On. You can leave Send mail
by queue and Retry sending mail on error. deselected by default, but
selecting them won't affect Gmail.
Under SMTP server enter the following smtp.gmail.com. Leave SMTP
backup server blank
Under SMTP port enter 587 ​
Under Use encrypted protocol select Use TLS ​
Under SMTP AUTHENTICATION enter a Gmail address and password.
Under E-MAIL OPTIONS use the same Gmail address as you did above and
enter an E-mail from name
Click Save
Update gmail account settings:
Login to your Gmail account at https://myaccount.google.com/
On the account homepage, click Sign-in & security or navigate to https://myaccount.google.com/security
Scroll down to the Allow less secure apps: widget, and have it enabled.
Now navigate to https://accounts.google.com/DisplayUnlockCaptcha and click Continue
Go back to the SMTP configuration page admin/config/system/smtp
Enter an email address you would like to receive a test message from and click Save configuration
Check your inbox to confirm you received the test message.