trouble with sending mail with Spring mail through somain registrar 1and1 smtp - spring-boot

I'm trying to send an email from a spring boot application with spring mail (1.5.8.RELEASE) JavaMailSender
sending through gmail SMTP is fine. however sending email through my domain registrar's amtp (registrar name- 1and1, in case someone already worked this out) is not working.
I'm getting this error, which imo - is more generic than useful:
com.sun.mail.smtp.SMTPSenderFailedException: 550-Requested action not taken: mailbox unavailable
550 invalid DNS MX or A/AAAA resource record
domain I'm sending through is bank.org, and has this DNS settings:
bank.org. 3600 IN A 178.79.161.205
bank.org. 3600 IN MX 11 mx01.1and1.com.
bank.org. 3600 IN MX 10 mx00.1and1.com.
the issue is, I'm able to send emails to gmail with the settings specified in this guide:
http://www.baeldung.com/spring-email
these are settings to send with gmail:
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=<login user to smtp server>
spring.mail.password=<login password to smtp server>
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
However when i try to send messages via my registrar these settings are not successful:
spring.mail.host=smtp.1and1.com
spring.mail.port=587
spring.mail.username=username
spring.mail.password=password
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
thew issue is - I am able to connect to the 1and1 SMTP using thunderbird email client. so I know the credentials are working.
I guess what I need is to find out a way to detect the correct settings because the support team can't assist with issues related to sending email programmatically from spring mail

the cause of the issue was - I didn't programmatically set the sender field (The "From" field) in my outgoing message
Once i set the From field the issue was resolved.
unfortunately the response from 1and1's SMTP was irrelevant ("550 invalid DNS MX or A/AAAA resource record")
Hope this helps anyone

Related

Expected response code "250" but got code "550", with message "550-Requested action not taken: mailbox unavailable 550 Sender address has null MX"

I have a Laravel 9.x site that I'm hosting on IONOS (shared-hosting).
In my site, I utilize mail a lot. So I'm sending mails to my customer frequently. While developing the system - I was using MailTrap.io - but for deployment, I need all the mails to go to my IONOS Mail Account i.e info#domain.com - for that, I need to use IONOS' Mail Configuration.
Following is my mail config (censoring out private info):
MAIL_MAILER=smtp
MAIL_HOST=smtp.ionos.com
MAIL_PORT=587
MAIL_USERNAME=############.com
MAIL_PASSWORD=################
MAIL_ENCRYPTION=tls
MAIL_FROM_NAME="${APP_NAME}"
MAIL_FROM_ADDRESS=#############.com
This is the error I'm getting:
This is the piece of manual documentation I got from IONOS' Dashboard:
How do I fix this? What is causing this issue? Like I mentioned before, all of it was working fine with MailTrap.io - so I'm really curious what am I doing wrong.
Thank you :)
As per ionos.com documentation
550 Sender address has null MX
The domain from which you send email has a configured No Service MX record (zero MX). The IONOS SMTP recipient rejects such emails
Delete the No Service MX entry in the DNS settings of your domain. For more information about a No Service MX entry, see RFC 7505.

Redmine email configuration using Exchange online

I keep getting this error when trying to send test email in Redmine
An error occurred while sending mail (501 5.1.5 Recipient address reserved by RFC 2606 )
And here is what my email configuration looks like
email_delivery:
delivery_method: :smtp
smtp_settings:
enable_starttls_auto: true
address: "smtp.office365.com"
port: 587
domain: "somedomain.com"
authentication: :login
user_name: "no.reply.address#somedomain.com"
password: "a very complex password"
What is the problem with my email configuration? I have this configuration in another application (odoo python) and it is working.
Your Redmine email settings are good.
However, it appears that you are trying to send Test email to non-existing Test domain.
Office 365 is actually using Microsoft Exchange servers, and thus, all of RFC 2606 domain addresses will be blocked.
The only way is change you test user (admin or other) email's domain name from "example.com", "example.net","example.org", "contoso.com", "domain.com" or "yourcompany.com" to some other domain name which aren't a RFC 2606 domain address.

Issue in sending email with SMTP and CodeIgniter

I am using CI for a quiz system. But during sending mail through SMTP. I am getting this error
following SMTP error was encountered: 111 Connection refused
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method
What may be possible reasons of this error.
Configurations used
SMTP
Smtp.gmail.com
467
Gmail username
Gmail password
Mail type text

Can't send mail from my server (Ubuntu14 / mailinabox) to gmail

I have an issue with my mail server on Digital Ocean. My mail server works on the “Mail in a box” app. Each time, when I tried to sent mail to, for example: some#gmail.com I had the same response:
Undelivered Mail Returned to Sender
From
MAILER-DAEMON#mail.sporta.io
This is the mail system at host mail.sporta.io.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The mail system
<denis.rohlinsky#gmail.com>: host gmail-smtp-in.l.google.com[108.177.126.27]
said: 550-5.7.1 This message does not have authentication information or
fails to pass 550-5.7.1 authentication checks. To best protect our users
from spam, the 550-5.7.1 message has been blocked. Please visit 550-5.7.1
https://support.google.com/mail/answer/81126#authentication for more 550
5.7.1 information. v27si4529334edm.111 - gsmtp (in reply to end of DATA
command)
Reporting-MTA: dns; mail.sporta.io
X-Postfix-Queue-ID: 83217200D6
X-Postfix-Sender: rfc822; admin#sporta.io
Arrival-Date: Fri, 1 Feb 2019 20:27:51 +0100 (CET)
Final-Recipient: rfc822; denis.rohlinsky#gmail.com
Original-Recipient: rfc822;denis.rohlinsky#gmail.com
Action: failed
Status: 5.7.1
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.1 This message does not have authentication
information or fails to pass 550-5.7.1 authentication checks. To best
protect our users from spam, the 550-5.7.1 message has been blocked. Please
visit 550-5.7.1
https://support.google.com/mail/answer/81126#authentication for more 550
5.7.1 information. v27si4529334edm.111 – gsmtp
Subject
test
From
admin#sporta.io
To
denis.rohlinsky#gmail.com
Date
Today 21:27
P.S. I checked my server via another services (sent message to mail.io, mail.com, mail.ru)
and it worked correctly. I can send mails to this services without any problems, but gmail continues to block my mail. What do I need to resolve this issue?
to send mail to mail.com, mail.ru successfully
to receive my messages from gmail
Register the sending email address with Gmail and wait for it to be authenticated. Gmail will accept mail only from gmail addresses or addresses known to be associated with a Gmail account.
As Juan mentioned in his reply here, you would probably need to add required DNS TXT records. Alternatively, you could look into the Google Postmaster Tools. It might shed some light on the issue at hand.
Emails without authentication often get rejected or marked as spam to protect recipients from phishing scams. Unauthenticated emails with attachments might get completely rejected for security reasons.
To ensure Gmail can authenticate you:
Send from the same IP address
Keep valid reverse DNS records your IP address that point to your domain
Choose the same address in the 'From:' header for every bulk message
For mail.sporta.io Reverse DNS Resolution - No PTR Record found.
For dmarc:sporta.io DNS Record not found.
For spf:sporta.io DNS Record not found.

Mandrill for outgoing mail in a mail client

I'm using Mandrill for my transaction email needs and it works great. Unfortunately very often when I send emails via my email client the emails go to the recipients spam folder.
Is there a way to use Mandrill for outgoing emails via a mail client (such as Apple Mail or Thunderbird)?
You can use the Mandrill's Outgoing Server (SMTP) Setting in the MailClient of your choice.
SMTP Settings
Outgoing Server: smtp.mandrillapp.com
Outgoing Server Port: 587
Auth Required: True
TLS: True
Username: complete email-id
Changing the MailClient is not probably going to mark your mails as legitimate.
There are multiple reasons for mail going to spam folder of recipient like:
Mandrill's IP address got blacklisted in recipient's SMTP (MX) server.
Your mail contains some links or content which is recognized as suspicious and hence recipient marks such mails as spam.
In short, mail getting marked as spam depends upon:
Sender SMTP server's reputation.
Sender's mail content.
Receiving SMTP (MX) (i.e recipient's) server business logic for mail classification.

Resources