sendmail ERROR => Received: 550 5.7.1 Message Rejected

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Post Reply
magestic
Level 1
Level 1
Posts: 14
Joined: Fri Apr 19, 2019 4:10 pm

sendmail ERROR => Received: 550 5.7.1 Message Rejected

Post by magestic »

I had used sendmail for a long time in s shell script, but recently discovered it stopped working and getting rejected msg from my smtp host. They were not able to help me resolve the problem and suggested i seek help from here. The error from sendmail is:

Aug 25 18:54:45 magemint sendemail[2091400]: ERROR => Received: 550 5.7.1 Message Rejected (104) [B69E9160003/1693014884-259565]
I am sending with username/password authentication through smtp at mail.noip.com with a port of 587
any help ?

here is the bash command line i am using with cron:

body="$(grep fail /var/log/auth.log)" && echo "$body" | sendemail -f user@email.com -t user@email.com -u auth -s mail.noip.com:587 -xu user@email.com -xp mypassword

user@email.com replaces the actual email address's used.
User avatar
stevengarland
Level 5
Level 5
Posts: 803
Joined: Tue Mar 05, 2019 4:04 pm
Location: Michigan

Re: sendmail ERROR => Received: 550 5.7.1 Message Rejected

Post by stevengarland »

Keep It Simple Sweetheart
magestic
Level 1
Level 1
Posts: 14
Joined: Fri Apr 19, 2019 4:10 pm

Re: sendmail ERROR => Received: 550 5.7.1 Message Rejected

Post by magestic »

there are at least 8 different reasons for 550, "5.7.1"

that's why i can figure out what is wrong.
User avatar
stevengarland
Level 5
Level 5
Posts: 803
Joined: Tue Mar 05, 2019 4:04 pm
Location: Michigan

Re: sendmail ERROR => Received: 550 5.7.1 Message Rejected

Post by stevengarland »

Try them one at a time.
Keep It Simple Sweetheart
User avatar
coffee412
Level 8
Level 8
Posts: 2099
Joined: Mon Nov 12, 2012 7:38 pm
Location: I dont know
Contact:

Re: sendmail ERROR => Received: 550 5.7.1 Message Rejected

Post by coffee412 »

I have found that the rejection of the email is because DKIM and _Dmarc are not setup at your DNS server. 'Gag me Google' , Woopie yahoo and the rest are rejecting emails if you do not have these setup correctly - well DKIM at least. Its a very good idea to setup _dmarc also.

Here is a link:

https://www.dmarcly.com/blog/how-to-add ... etup-guide

The same principal can be applied to whoever you have for your DNS server.

I had the same problem the other day with one of my clients domains for his email. I also had to add my _dmarc in my email
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics
Dell PE T610, Dell PE T710
- List your hardware Profile: inxi -Fxpmrz
MeshCentral * Virtualbox * Debian * InvoiceNinja * NextCloud * Linux since kernel 2.0.36
magestic
Level 1
Level 1
Posts: 14
Joined: Fri Apr 19, 2019 4:10 pm

Re: sendmail ERROR => Received: 550 5.7.1 Message Rejected

Post by magestic »

I think I added the record for _dmarc and when I check this with this checker url

https://dmarcly.com/tools/dmarc-checker

this checker says Success! Everything appears fine with your DMARC record.

the host config panel says “DomainKeys and DKIM records are now managed as free-form TXT records.” What does that mean ?

I still get the 550 5.7.1 Message Rejected after _dmarc setup

i would like to add that Microsoft Outlook is able to send and receive just fine using this email account.
User avatar
coffee412
Level 8
Level 8
Posts: 2099
Joined: Mon Nov 12, 2012 7:38 pm
Location: I dont know
Contact:

Re: sendmail ERROR => Received: 550 5.7.1 Message Rejected

Post by coffee412 »

magestic wrote: Sat Sep 09, 2023 6:10 pm “DomainKeys and DKIM records are now managed as free-form TXT records.” What does that mean ?
Not sure on that. I guess free-form is the key word there.

Anyways, You should go in and make sure your DKIM is actually setup. If it is on the DNS server then on your actual Mail server you might have to import the DKIM keys and set it up.

I had to do this with my rackspace email server and my process when like this:

Log into rackspace and go to DNS records/advanced
Select Create a DKIM
Then I also logged into my DNS service (godaddy) and went to DNS records/advanced
I selected 'Create a TXT entry' and copy/paste the key value in and also the key name. Now, The only mistake I made that cost me some time was I accidently included the domain name in the keyname. You shouldnt have to do that. Just the actual key name and then the key value. Also, Set the timeout to 1/2 hour.

Google and the others will reject email without a DKIM or SPF (?) setting.

DKIM basically verifies to the email servers (google ect..) that the email is actually coming from you. The dmarc is there so no one can spoof your email address and send spam.
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics
Dell PE T610, Dell PE T710
- List your hardware Profile: inxi -Fxpmrz
MeshCentral * Virtualbox * Debian * InvoiceNinja * NextCloud * Linux since kernel 2.0.36
magestic
Level 1
Level 1
Posts: 14
Joined: Fri Apr 19, 2019 4:10 pm

Re: sendmail ERROR => Received: 550 5.7.1 Message Rejected

Post by magestic »

i don't know if i should add but the domain DNS points to my dynamic routers IP address "Comcast" but the email is hosted with https://www.noip.com

i ran some tests and some sites are saying that DKIM authentication failed.

i'm not sure how to get DKIM setup, i will ask my hosters for advice.
User avatar
coffee412
Level 8
Level 8
Posts: 2099
Joined: Mon Nov 12, 2012 7:38 pm
Location: I dont know
Contact:

Re: sendmail ERROR => Received: 550 5.7.1 Message Rejected

Post by coffee412 »

Just to give you some background on how this all works.

You have a register website where you register your domain name. Now they can handle all functions - DNS, Email - If you want them too. However, Its like having all your eggs in one basket. I do not like to do that. I break them up. I have Rackspace as my email provider. I have namecheap.com as my DNS Server and then Registered my domain at godaddy.com. So, They do not have that much control over me.

Anyways,

With your email provider, In their settings you should be able to generate a DKIM key. You go to your DNS provider and in the DNS settings you can add a TXT record. The two things that you get with the DKIM key are the name of the key and the big long key itself. You copy them into the TXT record you are creating. So, Now your DNS service and your Email provider have this key and they can verify that the email is actually coming from you and not someone else. Then google and some others will start accepting your email.

Once you do one TXT record you will learn quickly and it becomes quite easy.

Rather dated but gives you an idea of how it works with godaddy. The others will be very close if not the same.

https://community.godaddy.com/s/questio ... in-manager
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics
Dell PE T610, Dell PE T710
- List your hardware Profile: inxi -Fxpmrz
MeshCentral * Virtualbox * Debian * InvoiceNinja * NextCloud * Linux since kernel 2.0.36
Discovemail
Level 1
Level 1
Posts: 1
Joined: Fri Nov 24, 2023 1:51 am

Re: sendmail ERROR => Received: 550 5.7.1 Message Rejected

Post by Discovemail »

Hi Majestic, you need to verify the email you're sending to. To decrease the chances of your email bouncing. I recommend Discovemail https://www.discovemail.com/trailarea/email-verifier to verify your emails. If you want to verify your email list in bulk? Try Discovemail bulk email verifier https://www.discovemail.com/bulk-tasks/ ... l-verifier. It's free as of 24/11/2023
Post Reply

Return to “Scripts & Bash”