• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue msmtp Error 550 - The from address does not match a verified Sender Identity

myplesk

New Pleskian
Hi,

This is my first post in the forum, just getting started on Plesk.

My Plesk configuration:
I am having issues getting the external SMTP server to work for my Plesk setup. I have followed the guide (https://support.plesk.com/hc/en-us/...to-configure-an-external-SMTP-server-in-Plesk).

I configured external SMTP server as follows:
1650452306335.png

I configured a cron job to send notification email:
1650452435523.png
echo "Hello world" > /dev/null | echo "Scheduled task executed successfully"

Here's my /var/log/maillog everytime the cron runs:
Apr 20 17:37:02 plesk msmtp: host=smtp.sendgrid.net tls=on auth=on user=apikey from=[email protected] recipients=[email protected] smtpstatus=550 smtpmsg='550 The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit Sender Identity to see the Sender Identity requirements' errormsg='the server did not accept the mail' exitcode=EX_UNAVAILABLE

Given I have done the domain verification, and the Sendgrid telnet test (How to Send an SMTP Email) was successfully, I doubt there is any issue on my Sendgrid API.

Is there something that I can check / configure further in Plesk?

Thank you.
 
No, this is something you need to configure at the sendgrid side.
Which domain did you authenticate? xxdomain.com or plesk.xxdomain.com?
 
No, this is something you need to configure at the sendgrid side.
Which domain did you authenticate? xxdomain.com or plesk.xxdomain.com?
@mow both domains (xxdomain.com & plesk.xxdomain.com) have been Domain Authenticated within Sendgrid, and respective MX record, CNAME, TXT record are added to DNS.

The Sendgrid telnet test was done on the Plesk server, and no issues creating a test email as [email protected] to my email address. So I presume the authentication at Sendgrid end is sufficient. Or is there some other tests that could be done?

Any ideas?

Thank you.
 
it is strange, because this error usually mean that the sender of the email has not been verified via SendGrid.
see Sender Identity

I'm right that you fully passed domain verification at SendGrid
and all respective MX, CNAME, TXT records fully updated in ns (for example nslookup -type=TXT plesk.xxdomain.com 8.8.8.8 returns that you expected) ?

the idea that is some time needed for DNS being updated.

for the first look this problem is not related to Plesk.
maybe troubleshooting guide at Troubleshooting Sender Authentication will be able help you.
 
it is strange, because this error usually mean that the sender of the email has not been verified via SendGrid.
see Sender Identity

I'm right that you fully passed domain verification at SendGrid
and all respective MX, CNAME, TXT records fully updated in ns (for example nslookup -type=TXT plesk.xxdomain.com 8.8.8.8 returns that you expected) ?

the idea that is some time needed for DNS being updated.

for the first look this problem is not related to Plesk.
maybe troubleshooting guide at Troubleshooting Sender Authentication will be able help you.
@Nik G Thank you for the guides provided. So far the nslookup values seems able to retrieve.

I saw a comment in https://support.plesk.com/hc/en-us/...to-configure-an-external-SMTP-server-in-Plesk and there's a command to test using the msmtp utility with debug, so I ran this on my Plesk server:
echo -e "Subject: Test Mail\r\n\r\nThis is a test mail." | msmtp --from [email protected] -t [email protected] --debug

The email is received at [email protected] email account.

Here's a snippet of the debug log:
<-- 235 Authentication successful
--> MAIL FROM:<[email protected]>
--> RCPT TO:<[email protected]>
--> DATA
<-- 250 Sender address accepted
<-- 250 Recipient address accepted
<-- 354 Continue
--> From: [email protected]
--> Date: Thu, 21 Apr 2022 12:28:51 +0800
--> Subject: Test Mail
-->
--> This is a test mail.
--> .
<-- 250 Ok: queued as xyz
--> QUIT
<-- 221 See you later

So if this msmtp utility test works on Plesk server, why is it not able to send any email (i.e. including the cron job notification email)?

Thank you.
 
are you able to send test email to Plesk Administrator's email with msmtp in the same way as you did it to [email protected] ?

or [email protected] - is the Plesk Administrator's email ?
did you successfully received your test email in in [email protected] mailbox ?

is sending test mail with msmtp to some google/outlook/yahoo mailbox also successful ?
 
are you able to send test email to Plesk Administrator's email with msmtp in the same way as you did it to [email protected] ?

or [email protected] - is the Plesk Administrator's email ?
did you successfully received your test email in in [email protected] mailbox ?

is sending test mail with msmtp to some google/outlook/yahoo mailbox also successful ?
Yes, I ran the msmtp utility commands on:
Both test emails are received in respective email account Inbox.

Here's the /var/log/maillog output on the 2 successful runs on the msmtp command:
Apr 21 12:18:14 plesk msmtp: host=smtp.sendgrid.net tls=on auth=on user=apikey from=[email protected] recipients=[email protected] mailsize=115 smtpstatus=250 smtpmsg='250 Ok: queued as xxxxxx exitcode=EX_OK
Apr 21 12:28:52 plesk msmtp: host=smtp.sendgrid.net tls=on auth=on user=apikey from=[email protected] recipients=[email protected] mailsize=115 smtpstatus=250 smtpmsg='250 Ok: queued as yyyyyy exitcode=EX_OK

So it is strange that manual run works, but rest of the notification emails do not send...could it be configuration issue, or potentially a bug?
 
it looks like some misconfiguration :confused:

I think the problem with 'echo' command itself, but not sure.
probably you can use another command for test, like 'date -U' or '/usr/bin/apt update' , or something else except echo ?
 
@Nik G noted on the cron.

For another test, I have this testmail.txt:
------------------------
To: [email protected]
From: [email protected]
Subject: Test email

Hello there.
------------------------


Testing without 'echo', here's what I ran:
date -u >> testmail.txt && cat testmail.txt | msmtp -a default [email protected]
The email is received in the inbox of [email protected], and the output in /var/log/maillog is:
Apr 21 19:42:26 plesk msmtp: host=smtp.sendgrid.net tls=on auth=on user=apikey from=[email protected] recipients=[email protected] mailsize=256 smtpstatus=250 smtpmsg='250 Ok: queued as xxxxxx exitcode=EX_OK

>> As per previous test, it works with manual msmtp command.


As for the cron, I updated the command to below (every minute * * * * *):
date -u >> /tmp/testmail.txt | echo "Scheduled task executed successfully"
The /tmp/testmail.txt does get added with cron timing (from date -u), and the output in /var/log/maillog is:
Apr 21 19:55:01 plesk msmtp: host=smtp.sendgrid.net tls=on auth=on user=apikey from=[email protected] recipients=[email protected] smtpstatus=550 smtpmsg='550 The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit https://sendgrid.com/docs/for-developers/sending-email/sender-identity/ to see the Sender Identity requirements' errormsg='the server did not accept the mail' exitcode=EX_UNAVAILABLE

>> As per previous test, it didn't work with cron.

I'm still wondering what went wrong o_O
 
Try sending a mail with "mail". Does that work?
Do you have more than one sendgrid account configured?
 
Try sending a mail with "mail". Does that work?
Do you have more than one sendgrid account configured?
@mow May I know the "mail" you're referring to which? Currently I only have msmtp installed.

Currently I only have 1 Sendgrid account configured.
 
will the test e-mail be delivered in such way:
:~# cat /tmp/mail.txt
To: [email protected]
From: [email protected]
Subject: Test email

Hello there.
:~# cat /tmp/mail.txt | sendmail -oi -t
?

please check that remote port configured correctly.

probably you should use port 465 or uncheck 'SMTP server requires encrypted connection'
 
will the test e-mail be delivered in such way:

?

please check that remote port configured correctly.

probably you should use port 465 or uncheck 'SMTP server requires encrypted connection'
@Nik G Here's what I send:

# cat /tmp/testmail.txt
To: [email protected]
From: [email protected]
Subject: Test email

Hello there.
# cat /tmp/testmail.txt | sendmail -oi -t

Here's the /var/log/maillog/:
Apr 22 12:50:34 plesk msmtp: host=smtp.sendgrid.net tls=on auth=on user=apikey from=[email protected] recipients=[email protected] mailsize=285 smtpstatus=250 smtpmsg='250 Ok: queued as xxxxxx exitcode=EX_OK

The mail is received in [email protected] also...It only worked with port 587.
 
did you try uncheck "smtp server requires encrypted connection" but leave port 587 ?
will it work this way ?

it looks like some strange misconfiguration. but I can't understand what can be wrong.

if you're able to send mails with sendmail and msmtp commands - this mean that mail sending works fine.
 
did you try uncheck "smtp server requires encrypted connection" but leave port 587 ?
will it work this way ?

it looks like some strange misconfiguration. but I can't understand what can be wrong.

if you're able to send mails with sendmail and msmtp commands - this mean that mail sending works fine.
Yes I have tried this option:
1650609535241.png

Here is the output when I ran the same command
# cat /tmp/testmail.txt | sendmail -oi -t
sendmail: cannot use a secure authentication method
sendmail: could not send mail (account default from /etc/msmtprc)

Here's the output of /var/log/maillog:
Apr 22 14:39:01 plesk msmtp: host=smtp.sendgrid.net tls=off auth=on user=apikey from=[email protected] recipients=[email protected] errormsg='cannot use a secure authentication method' exitcode=EX_UNAVAILABLE
 
email you received from update manager should be send on behalf of Plesk's administrator e-mail address.
so it is expected to have Plesk's admin email address in such emails.

there's some problem with sender validation on sendgrid side.

I've found interesting thing: on my test server with configured msmtp headers of receved letter from Cron looks like below:
Return-Path: <[email protected]>
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from a10-52-64-180.qa.plesk.int (unknown [10.52.64.180])
by a10-52-68-4.qa.plesk.int (Postfix) with ESMTPA id 2A687200FBD51
for <[email protected]>; Fri, 22 Apr 2022 08:35:01
Date: Fri, 22 Apr 2022 07:35:01 UTC
From: "(Cron Daemon)" <root>
To: [email protected]
Subject: Cron <root@a10-52-64-180> /usr/local/psa/admin/sbin/fetch_url 'a10-52-68-4.qa.plesk.int/bfile.php'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8

this may be a reason.

please under root execute crontab -e command and add to the very first line something like
this will add envelope from address for the notifications from cron jobs executed under the root account.
 
email you received from update manager should be send on behalf of Plesk's administrator e-mail address.
so it is expected to have Plesk's admin email address in such emails.
That's good to know.

Anyway, in my /var/log/maillog, that email was having this entry:
Apr 22 06:25:28 plesk msmtp: host=smtp.sendgrid.net tls=on auth=on user=apikey from=[email protected] recipients=[email protected] mailsize=11421 smtpstatus=250 smtpmsg='250 Ok: queued as xxxxxx exitcode=EX_OK

Just interesting to see that the 'from' is [email protected] but the received email 'from' is [email protected] account.

From your cron email, are these the users:
Is there postfix?

there's some problem with sender validation on sendgrid side.
Based on the header, is there something that you see?
 
please under root execute crontab -e command and add to the very first line something like
this will add envelope from address for the notifications from cron jobs executed under the root account.

I added and rerun the cron:
1650625587397.png

It is still unable to send (/var/log/maillog):
Apr 22 17:15:02 plesk msmtp: host=smtp.sendgrid.net tls=on auth=on user=apikey from=[email protected] recipients=[email protected] smtpstatus=550 smtpmsg='550 The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit Sender Identity to see the Sender Identity requirements' errormsg='the server did not accept the mail' exitcode=EX_UNAVAILABLE

Could the auto-generated /etc/msmtprc overriding something?
---------------------------------------------------------------------------
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

# MSMTP configuration file. See msmtp(1) for syntax.
# This file was generated by msmtpmng utility.

#
# Global settings section
#
defaults

syslog LOG_MAIL

tls_certcheck off
tls on

# Automatic envelope-from generation.
# Caution: this overrides explicitly set envelope-from via --from or other means.
auto_from on

# Set a domain part for the generation of an envelope-from address.
maildomain plesk.xxdomain.com

# This command sets the argument of the SMTP EHLO (or LMTP LHLO) command.
domain plesk.xxdomain.com

#
# Default account.
#
account default

host smtp.sendgrid.net
port 587

auth on
user apikey
# Password is actually stored in /etc/psa/private/msmtp-pwdeval.conf
passwordeval /usr/lib/plesk-9.0/msmtp-pwdeval
---------------------------------------------------------------------------
 
Back
Top