SMTPC relay Amazon SES error 554 Missing Final domain

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
guidoadam
New user
New user
Posts: 8
Joined: 2020-11-05 14:48

SMTPC relay Amazon SES error 554 Missing Final domain

Post by guidoadam » 2020-11-05 14:57

Dear all,

We've been using hMailserver for several years now, but switched to Amazon SES for SMTP delivery. Problem now is that email to some domains are delivered correctly and email to other domains are not delivered with error: RECEIVED: 554 Transaction failed: Missing final '@domain'

- The receiving domains can be on the same hosting provider (using same config background) with different outcome of delivery success
- Most big/critic providers (hotmail/live/gmail etc) are receiving the mails without any problems
- Delivery outcome not seems to be TLD related

Part of the log of a non delivered mail:
"SMTPC" 2880 64 "2020-11-05 13:45:13.405" "34.255.89.251" "SENT: EHLO XXXXXXXXXXXXe.com"
"SMTPC" 2860 64 "2020-11-05 13:45:13.421" "34.255.89.251" "RECEIVED: 250-email-smtp.amazonaws.com[nl]250-8BITMIME[nl]250-STARTTLS[nl]250-AUTH PLAIN LOGIN[nl]250 Ok"
"SMTPC" 2860 64 "2020-11-05 13:45:13.421" "34.255.89.251" "SENT: AUTH LOGIN"
"SMTPC" 2848 64 "2020-11-05 13:45:13.436" "34.255.89.251" "RECEIVED: 334 XXXXXXXXXXXX"
"SMTPC" 2848 64 "2020-11-05 13:45:13.452" "34.255.89.251" "SENT: XXXXXXXXXXXX"
"SMTPC" 2860 64 "2020-11-05 13:45:13.468" "34.255.89.251" "RECEIVED: 334 XXXXXXXXXXXX"
"SMTPC" 2860 64 "2020-11-05 13:45:13.468" "34.255.89.251" "SENT: ***"
"SMTPC" 2876 64 "2020-11-05 13:45:13.499" "34.255.89.251" "RECEIVED: 235 Authentication successful."
"SMTPC" 2876 64 "2020-11-05 13:45:13.499" "34.255.89.251" "SENT: ***"
"SMTPC" 2844 64 "2020-11-05 13:45:13.515" "34.255.89.251" "RECEIVED: 250 Ok"
"SMTPC" 2844 64 "2020-11-05 13:45:13.515" "34.255.89.251" "SENT: RCPT TO:<guido@XXXXXXXXXXXX.nl>"
"SMTPC" 2848 64 "2020-11-05 13:45:13.530" "34.255.89.251" "RECEIVED: 250 Ok"
"SMTPC" 2848 64 "2020-11-05 13:45:13.530" "34.255.89.251" "SENT: DATA"
"SMTPC" 2860 64 "2020-11-05 13:45:13.561" "34.255.89.251" "RECEIVED: 354 End data with <CR><LF>.<CR><LF>"
"SMTPC" 2860 64 "2020-11-05 13:45:13.561" "34.255.89.251" "SENT: [nl]."
"SMTPC" 2876 64 "2020-11-05 13:45:13.608" "34.255.89.251" "RECEIVED: 554 Transaction failed: Missing final '@domain'"
"SMTPC" 2876 64 "2020-11-05 13:45:13.608" "34.255.89.251" "SENT: QUIT"
"SMTPC" 2844 64 "2020-11-05 13:45:13.640" "34.255.89.251" "RECEIVED: 221 Bye"

I hope someone can point me in de right direction to the solution. Thanks a lot!

User avatar
mattg
Moderator
Moderator
Posts: 21268
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: SMTPC relay Amazon SES error 554 Missing Final domain

Post by mattg » 2020-11-05 15:30

Not a hMailserver error

Do you Authenticate to the AmazonAWS with a domain name included in your credentials??
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

guidoadam
New user
New user
Posts: 8
Joined: 2020-11-05 14:48

Re: SMTPC relay Amazon SES error 554 Missing Final domain

Post by guidoadam » 2020-11-05 16:36

Hi Matt, thanks for your response.

It's not a HMailServer error, correct. But imho it can be an hMailServer setting/behaviour that causes Amazon SES to respond with this error, since sending with powershell from this server does work.

We do not authenticate to Amazon with a domain name included in the credentials.

After more investigation our current progress points to: we need to send the message with an Amazon validated sender FROM address. We assume that this is done, but despite all logging we're having a hard time debugging what's really sent to Amazon during the process. Stays odd that the error is consistent recipient dependent.

Sources on this:
https://evanhoffman.com/tag/missing-final-domain/
http://www.bashbang.com/geek/aws-ses-mta/

User avatar
jimimaseye
Moderator
Moderator
Posts: 8917
Joined: 2011-09-08 17:48

Re: SMTPC relay Amazon SES error 554 Missing Final domain

Post by jimimaseye » 2020-11-05 22:53

There's a district lack of MAIL FROM in the conversation.

Do you have a from address header on your email?

[Entered by mobile. Excuse my spelling.]
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

guidoadam
New user
New user
Posts: 8
Joined: 2020-11-05 14:48

Re: SMTPC relay Amazon SES error 554 Missing Final domain

Post by guidoadam » 2020-11-06 09:28

Hi Jimimaseye, thanks for your post.

There's indeed a lack of a proper MAIL FROM in de SMTPC process. However there is a FROM address in the initial connection to hMailServer. I tried to add the address to the SMTPC process with scripting, but did not succeed. Also, I am not quite sure if this has to be present.

Thanks again!

For better understanding I'll add my complete log here:

-- LOG OF FAILED MAIL --

"DEBUG" 2868 "2020-11-05 14:43:55.449" "TCP connection started for session 99"
"SMTPD" 2868 99 "2020-11-05 14:43:55.449" "84.241.142.46" "SENT: 220 Welcome to Dutchbreeze SMTP"
"SMTPD" 2852 99 "2020-11-05 14:43:55.449" "84.241.142.46" "RECEIVED: EHLO DBWS10"
"SMTPD" 2852 99 "2020-11-05 14:43:55.449" "84.241.142.46" "SENT: 250-dutchbreeze.com[nl]250-SIZE 20480000[nl]250-AUTH LOGIN PLAIN[nl]250 HELP"
"SMTPD" 2844 99 "2020-11-05 14:43:55.464" "84.241.142.46" "RECEIVED: AUTH LOGIN"
"SMTPD" 2844 99 "2020-11-05 14:43:55.464" "84.241.142.46" "SENT: 334 XXXXXXXXXXXXXXXX"
"SMTPD" 2844 99 "2020-11-05 14:43:55.464" "84.241.142.46" "RECEIVED: XXXXXXXXXXXXXXXX
"SMTPD" 2844 99 "2020-11-05 14:43:55.464" "84.241.142.46" "SENT: 334 XXXXXXXXXXXXXXXX"
"SMTPD" 2844 99 "2020-11-05 14:43:55.464" "84.241.142.46" "RECEIVED: ***"
"SMTPD" 2844 99 "2020-11-05 14:43:55.480" "84.241.142.46" "SENT: 235 authenticated."
"SMTPD" 2844 99 "2020-11-05 14:43:55.522" "84.241.142.46" "RECEIVED: MAIL FROM: <info@guidoadam.com>"
"SMTPD" 2844 99 "2020-11-05 14:43:55.522" "84.241.142.46" "SENT: 250 OK"
"SMTPD" 2868 99 "2020-11-05 14:43:55.527" "84.241.142.46" "RECEIVED: RCPT TO: <guido@cluca.nl>"
"SMTPD" 2868 99 "2020-11-05 14:43:55.527" "84.241.142.46" "SENT: 250 OK"
"SMTPD" 2856 99 "2020-11-05 14:43:55.527" "84.241.142.46" "RECEIVED: DATA"
"SMTPD" 2856 99 "2020-11-05 14:43:55.527" "84.241.142.46" "SENT: 354 OK, send."
"DEBUG" 2836 "2020-11-05 14:43:55.684" "Adding task AsynchronousTask to work queue Asynchronous task queue"
"DEBUG" 2672 "2020-11-05 14:43:55.684" "Executing task AsynchronousTask in work queue Asynchronous task queue"
"DEBUG" 2672 "2020-11-05 14:43:55.700" "Saving message: {EE4CAA6D-4411-46E4-BF3D-283561627CF0}.eml"
"DEBUG" 2672 "2020-11-05 14:43:55.716" "Requesting SMTPDeliveryManager to start message delivery"
"SMTPD" 2672 99 "2020-11-05 14:43:55.716" "84.241.142.46" "SENT: 250 Queued (0.172 seconds)"
"DEBUG" 2688 "2020-11-05 14:43:55.731" "Adding task DeliveryTask to work queue SMTP delivery queue"
"DEBUG" 2732 "2020-11-05 14:43:55.731" "Executing task DeliveryTask in work queue SMTP delivery queue"
"DEBUG" 2732 "2020-11-05 14:43:55.731" "Delivering message..."
"APPLICATION" 2732 "2020-11-05 14:43:55.731" "SMTPDeliverer - Message 1198: Delivering message from info@guidoadam.com to guido@cluca.nl. File: C:\Program Files (x86)\hMailServer\Data\{EE4CAA6D-4411-46E4-BF3D-283561627CF0}.eml"
"DEBUG" 2732 "2020-11-05 14:43:55.731" "Applying rules"
"DEBUG" 2732 "2020-11-05 14:43:55.731" "Performing local delivery"
"DEBUG" 2732 "2020-11-05 14:43:55.731" "Local delivery completed"
"APPLICATION" 2732 "2020-11-05 14:43:55.762" "SMTPDeliverer - Message 1198: Relaying to host email-smtp.eu-west-1.amazonaws.com."
"DEBUG" 2732 "2020-11-05 14:43:55.762" "Starting external delivery process. Server: email-smtp.eu-west-1.amazonaws.com (18.203.208.162), Port: 587, Security: 2, User name: XXXXXXXXXXXXXXXX"
"DEBUG" 2732 "2020-11-05 14:43:55.762" "Creating session 113"
"TCPIP" 2732 "2020-11-05 14:43:55.762" "Connecting to 18.203.208.162:587..."
"DEBUG" 2860 "2020-11-05 14:43:55.778" "TCP connection started for session 113"
"SMTPC" 2860 113 "2020-11-05 14:43:55.825" "18.203.208.162" "RECEIVED: 220 email-smtp.amazonaws.com ESMTP SimpleEmailService-d-Z89OLKB17 XXXXXXXXXXXXXXXX"
"SMTPC" 2860 113 "2020-11-05 14:43:55.825" "18.203.208.162" "SENT: EHLO dutchbreeze.com"
"SMTPC" 2852 113 "2020-11-05 14:43:55.856" "18.203.208.162" "RECEIVED: 250-email-smtp.amazonaws.com[nl]250-8BITMIME[nl]250-STARTTLS[nl]250-AUTH PLAIN LOGIN[nl]250 Ok"
"SMTPC" 2852 113 "2020-11-05 14:43:55.856" "18.203.208.162" "SENT: STARTTLS"
"SMTPC" 2848 113 "2020-11-05 14:43:55.872" "18.203.208.162" "RECEIVED: 220 Ready to start TLS"
"DEBUG" 2848 "2020-11-05 14:43:55.872" "Performing SSL/TLS handshake for session 113. Verify certificate: True, Expected remote host name: email-smtp.eu-west-1.amazonaws.com"
"DEBUG" 2868 "2020-11-05 14:43:55.903" "Certificate verification succeeded for session 113."
"TCPIP" 2848 "2020-11-05 14:43:55.981" "TCPConnection - TLS/SSL handshake completed. Session Id: 113, Remote IP: 18.203.208.162, Version: TLSv1.2, Cipher: ECDHE-RSA-AES128-GCM-SHA256, Bits: 128"
"SMTPC" 2848 113 "2020-11-05 14:43:55.981" "18.203.208.162" "SENT: EHLO dutchbreeze.com"
"SMTPC" 2860 113 "2020-11-05 14:43:55.994" "18.203.208.162" "RECEIVED: 250-email-smtp.amazonaws.com[nl]250-8BITMIME[nl]250-STARTTLS[nl]250-AUTH PLAIN LOGIN[nl]250 Ok"
"SMTPC" 2860 113 "2020-11-05 14:43:55.994" "18.203.208.162" "SENT: AUTH LOGIN"
"SMTPC" 2860 113 "2020-11-05 14:43:56.010" "18.203.208.162" "RECEIVED: 334 XXXXXXXXXXXXXXXX"
"SMTPC" 2860 113 "2020-11-05 14:43:56.010" "18.203.208.162" "SENT: XXXXXXXXXXXXXXXX"
"SMTPC" 2856 113 "2020-11-05 14:43:56.041" "18.203.208.162" "RECEIVED: 334 XXXXXXXXXXXXXXXX"
"SMTPC" 2856 113 "2020-11-05 14:43:56.041" "18.203.208.162" "SENT: ***"
"SMTPC" 2868 113 "2020-11-05 14:43:56.080" "18.203.208.162" "RECEIVED: 235 Authentication successful."
"SMTPC" 2868 113 "2020-11-05 14:43:56.080" "18.203.208.162" "SENT: ***"
"SMTPC" 2844 113 "2020-11-05 14:43:56.102" "18.203.208.162" "RECEIVED: 250 Ok"
"SMTPC" 2844 113 "2020-11-05 14:43:56.102" "18.203.208.162" "SENT: RCPT TO:<guido@cluca.nl>"
"SMTPC" 2860 113 "2020-11-05 14:43:56.120" "18.203.208.162" "RECEIVED: 250 Ok"
"SMTPC" 2860 113 "2020-11-05 14:43:56.120" "18.203.208.162" "SENT: DATA"
"SMTPC" 2856 113 "2020-11-05 14:43:56.135" "18.203.208.162" "RECEIVED: 354 End data with <CR><LF>.<CR><LF>"
"SMTPC" 2856 113 "2020-11-05 14:43:56.135" "18.203.208.162" "SENT: [nl]."
"SMTPC" 2868 113 "2020-11-05 14:43:56.198" "18.203.208.162" "RECEIVED: 554 Transaction failed: Missing final '@domain'"
"SMTPC" 2868 113 "2020-11-05 14:43:56.198" "18.203.208.162" "SENT: QUIT"
"SMTPC" 2844 113 "2020-11-05 14:43:56.229" "18.203.208.162" "RECEIVED: 221 Bye"
Last edited by guidoadam on 2020-11-06 09:34, edited 1 time in total.

guidoadam
New user
New user
Posts: 8
Joined: 2020-11-05 14:48

Re: SMTPC relay Amazon SES error 554 Missing Final domain

Post by guidoadam » 2020-11-06 09:34

To be all complete, this is a log from a mail receiver that succeeds. It has the same TLD and in this case both are O365 mailaddresses:

-- LOG OF SUCCEEDED MAIL --

"DEBUG" 860 "2020-11-06 08:30:57.055" "TCP connection started for session 530"
"SMTPD" 860 530 "2020-11-06 08:30:57.055" "136.143.97.130" "SENT: 220 Welcome to Dutchbreeze SMTP"
"SMTPD" 164 530 "2020-11-06 08:30:57.102" "136.143.97.130" "RECEIVED: EHLO GPAAWS50"
"SMTPD" 164 530 "2020-11-06 08:30:57.102" "136.143.97.130" "SENT: 250-dutchbreeze.com[nl]250-SIZE 20480000[nl]250-AUTH LOGIN[nl]250 HELP"
"SMTPD" 6080 530 "2020-11-06 08:30:57.118" "136.143.97.130" "RECEIVED: AUTH LOGIN"
"SMTPD" 6080 530 "2020-11-06 08:30:57.118" "136.143.97.130" "SENT: 334 XXXXXXXXXXXXXXXX"
"SMTPD" 5444 530 "2020-11-06 08:30:57.118" "136.143.97.130" "RECEIVED: XXXXXXXXXXXXXXXX"
"SMTPD" 5444 530 "2020-11-06 08:30:57.118" "136.143.97.130" "SENT: 334 XXXXXXXXXXXXXXXX""
"SMTPD" 860 530 "2020-11-06 08:30:57.133" "136.143.97.130" "RECEIVED: ***"
"SMTPD" 860 530 "2020-11-06 08:30:57.149" "136.143.97.130" "SENT: 235 authenticated."
"SMTPD" 5444 530 "2020-11-06 08:30:57.180" "136.143.97.130" "RECEIVED: MAIL FROM: <info@guidoadam.com>"
"SMTPD" 5444 530 "2020-11-06 08:30:57.196" "136.143.97.130" "SENT: 250 OK"
"SMTPD" 164 530 "2020-11-06 08:30:57.196" "136.143.97.130" "RECEIVED: RCPT TO: <guido@dutchbreeze.nl>"
"SMTPD" 164 530 "2020-11-06 08:30:57.196" "136.143.97.130" "SENT: 250 OK"
"SMTPD" 6080 530 "2020-11-06 08:30:57.211" "136.143.97.130" "RECEIVED: DATA"
"SMTPD" 6080 530 "2020-11-06 08:30:57.211" "136.143.97.130" "SENT: 354 OK, send."
"DEBUG" 1472 "2020-11-06 08:30:57.258" "Adding task AsynchronousTask to work queue Asynchronous task queue"
"DEBUG" 5992 "2020-11-06 08:30:57.258" "Executing task AsynchronousTask in work queue Asynchronous task queue"
"DEBUG" 5992 "2020-11-06 08:30:57.258" "Executing event OnAcceptMessage"
"DEBUG" 5992 "2020-11-06 08:30:57.274" "Event completed"
"DEBUG" 5992 "2020-11-06 08:30:57.274" "Saving message: {045A8294-3F88-4222-AF35-FFEC68B140AC}.eml"
"DEBUG" 5992 "2020-11-06 08:30:57.289" "Requesting SMTPDeliveryManager to start message delivery"
"SMTPD" 5992 530 "2020-11-06 08:30:57.305" "136.143.97.130" "SENT: 250 Queued (0.048 seconds)"
"DEBUG" 4316 "2020-11-06 08:30:57.305" "Adding task DeliveryTask to work queue SMTP delivery queue"
"DEBUG" 4364 "2020-11-06 08:30:57.305" "Executing task DeliveryTask in work queue SMTP delivery queue"
"DEBUG" 4364 "2020-11-06 08:30:57.305" "Delivering message..."
"APPLICATION" 4364 "2020-11-06 08:30:57.323" "SMTPDeliverer - Message 1240: Delivering message from info@guidoadam.com to guido@dutchbreeze.nl. File: C:\Program Files (x86)\hMailServer\Data\{045A8294-3F88-4222-AF35-FFEC68B140AC}.eml"
"DEBUG" 4364 "2020-11-06 08:30:57.323" "Applying rules"
"DEBUG" 4364 "2020-11-06 08:30:57.323" "Performing local delivery"
"DEBUG" 4364 "2020-11-06 08:30:57.323" "Local delivery completed"
"APPLICATION" 4364 "2020-11-06 08:30:57.323" "SMTPDeliverer - Message 1240: Relaying to host email-smtp.eu-west-1.amazonaws.com."
"DEBUG" 4364 "2020-11-06 08:30:57.323" "Starting external delivery process. Server: email-smtp.eu-west-1.amazonaws.com (34.252.67.216), Port: 587, Security: 2, User name: XXXXXXXXXXXXXXXX""
"DEBUG" 4364 "2020-11-06 08:30:57.323" "Creating session 598"
"TCPIP" 4364 "2020-11-06 08:30:57.323" "Connecting to 34.252.67.216:587..."
"DEBUG" 5444 "2020-11-06 08:30:57.336" "TCP connection started for session 598"
"SMTPC" 5444 598 "2020-11-06 08:30:57.383" "34.252.67.216" "RECEIVED: 220 email-smtp.amazonaws.com ESMTP SimpleEmailService-d-1WAUPLA17 XXXXXXXXXXXXXXXX""
"SMTPC" 5444 598 "2020-11-06 08:30:57.383" "34.252.67.216" "SENT: EHLO dutchbreeze.com"
"SMTPC" 1472 598 "2020-11-06 08:30:57.399" "34.252.67.216" "RECEIVED: 250-email-smtp.amazonaws.com[nl]250-8BITMIME[nl]250-STARTTLS[nl]250-AUTH PLAIN LOGIN[nl]250 Ok"
"SMTPC" 1472 598 "2020-11-06 08:30:57.399" "34.252.67.216" "SENT: STARTTLS"
"SMTPC" 6080 598 "2020-11-06 08:30:57.430" "34.252.67.216" "RECEIVED: 220 Ready to start TLS"
"DEBUG" 6080 "2020-11-06 08:30:57.430" "Performing SSL/TLS handshake for session 598. Verify certificate: True, Expected remote host name: email-smtp.eu-west-1.amazonaws.com"
"DEBUG" 5792 "2020-11-06 08:30:57.461" "Certificate verification succeeded for session 598."
"TCPIP" 6080 "2020-11-06 08:30:57.540" "TCPConnection - TLS/SSL handshake completed. Session Id: 598, Remote IP: 34.252.67.216, Version: TLSv1.2, Cipher: ECDHE-RSA-AES128-GCM-SHA256, Bits: 128"
"SMTPC" 6080 598 "2020-11-06 08:30:57.540" "34.252.67.216" "SENT: EHLO dutchbreeze.com"
"SMTPC" 5444 598 "2020-11-06 08:30:57.555" "34.252.67.216" "RECEIVED: 250-email-smtp.amazonaws.com[nl]250-8BITMIME[nl]250-STARTTLS[nl]250-AUTH PLAIN LOGIN[nl]250 Ok"
"SMTPC" 5444 598 "2020-11-06 08:30:57.555" "34.252.67.216" "SENT: AUTH LOGIN"
"SMTPC" 164 598 "2020-11-06 08:30:57.571" "34.252.67.216" "RECEIVED: 334 XXXXXXXXXXXXXXXX""
"SMTPC" 164 598 "2020-11-06 08:30:57.571" "34.252.67.216" "SENT: XXXXXXXXXXXXXXXX""
"SMTPC" 860 598 "2020-11-06 08:30:57.586" "34.252.67.216" "RECEIVED: 334 XXXXXXXXXXXXXXXX""
"SMTPC" 860 598 "2020-11-06 08:30:57.602" "34.252.67.216" "SENT: ***"
"SMTPC" 5444 598 "2020-11-06 08:30:57.633" "34.252.67.216" "RECEIVED: 235 Authentication successful."
"SMTPC" 5444 598 "2020-11-06 08:30:57.633" "34.252.67.216" "SENT: ***"
"SMTPC" 164 598 "2020-11-06 08:30:57.649" "34.252.67.216" "RECEIVED: 250 Ok"
"SMTPC" 164 598 "2020-11-06 08:30:57.649" "34.252.67.216" "SENT: RCPT TO:<guido@dutchbreeze.nl>"
"SMTPC" 1472 598 "2020-11-06 08:30:57.664" "34.252.67.216" "RECEIVED: 250 Ok"
"SMTPC" 1472 598 "2020-11-06 08:30:57.664" "34.252.67.216" "SENT: DATA"
"SMTPC" 860 598 "2020-11-06 08:30:57.680" "34.252.67.216" "RECEIVED: 354 End data with <CR><LF>.<CR><LF>"
"SMTPC" 860 598 "2020-11-06 08:30:57.680" "34.252.67.216" "SENT: [nl]."
"SMTPC" 860 598 "2020-11-06 08:30:57.931" "34.252.67.216" "RECEIVED: 250 Ok 010201759c772e3f-11f922ad-997b-4ae8-886d-2c3bc04e021c-000000"
"SMTPC" 860 598 "2020-11-06 08:30:57.931" "34.252.67.216" "SENT: QUIT"
"SMTPC" 5444 598 "2020-11-06 08:30:57.962" "34.252.67.216" "RECEIVED: 221 Bye"

User avatar
johang
Senior user
Senior user
Posts: 448
Joined: 2008-09-01 09:20

Re: SMTPC relay Amazon SES error 554 Missing Final domain

Post by johang » 2020-11-07 01:30

i cant find any difference ( well expect from the obvious RECEIVED: 554 Transaction failed: Missing final '@domain ) is it the same credentials in front of the @ when you authenticate ? or do you use different ones ?

but my real question is .. since you are reffering to trying adding senderaddress to the SMTPC process.. are you doing other homebrew things as well ??
i have never been able to make my default hmailserver ignore using "mail from"

is it a behaviour for specific servers in aws ses ?
i notice that relay servers are 2 separate hosts... what happens if you hard copy 34.255.89.251 as relay server ? do all sending fail then ?
( if you put in 18.203.208.162 do all work ? )
i would try out of curiosity

and then perhaps send your question to aws ses and ask why one work and one fails
___________________________________________________________end of the line

guidoadam
New user
New user
Posts: 8
Joined: 2020-11-05 14:48

Re: SMTPC relay Amazon SES error 554 Missing Final domain

Post by guidoadam » 2020-11-07 13:33

Ho Johang, thanks for your reply.

1. There is no homebrew whatsoever. I did test to achieve this by scripting, but didn't succeed. There are no custom scripts running.

2. Behavious SES: we connect on the same domain, but it seems that SES is redirecting the request to multiple servers with different IP's. However, the problem is really consistent. Only when mailing to the different (mentioned) emailaddresses, the error raises, while the other address succeeds. I've seen logs where the same ip is used for sending with different outcome.

Thanks again!

palinka
Senior user
Senior user
Posts: 2475
Joined: 2017-09-12 17:57

Re: SMTPC relay Amazon SES error 554 Missing Final domain

Post by palinka » 2020-11-07 14:22

guidoadam wrote:
2020-11-05 16:36
After more investigation our current progress points to: we need to send the message with an Amazon validated sender FROM address.
Have a look at this: https://stackoverflow.com/questions/861 ... n#10840386

I also read something about improper return-path. I believe that should already have been inserted by hmailserver by the time hmailserver relays the message through aws. But if you attempt to send directly via script, keep that in mind.

Also, one of your links said recipients need to be validated until you request that to be unlocked. Have you done that?
It’s important to note that initially your account will only be able to send email to verified addresses. According to this thread, you need to submit a production access request to send to unverified To: addresses. I did this and got my “approval” email about 30 minutes later.

guidoadam
New user
New user
Posts: 8
Joined: 2020-11-05 14:48

Re: SMTPC relay Amazon SES error 554 Missing Final domain

Post by guidoadam » 2020-11-07 16:17

Hi Palinka, thanks for your response. I just finished working on the solution. To share with all hMailServer/Amazon SES users:

PROBLEM:
The problem seems that SES expects a quote formatted qualified emailadres: "Guido Adam" <guido@cluca.nl>. When an email client does an autocomplete like we could get an output like: Guido Adam <guido@cluca.nl>. Mention the quotes around the name. SES does not accept this and throw the error 'Missing final @domain'.

SOLUTION:
I did a rewrite on all receiving addresses in the message to plan email. I did not yes find a way to extract the name, so that is left blank for now.
This is the script I use:
----------------------------------------
'if you have any questions or additions to this script: guido@dutchbreeze.com
Dim oRecipients
Dim sAddress(10)
Dim bAddressChange
Dim iNumbRecipients
iNumbRecipients = 0

Set oRecipients = oMessage.Recipients
iNumbRecipients = CInt(oRecipients.Count) 'get the number of recipients

EventLog.write("Number Recipients = " & iNumbRecipients)


For i = 0 To iNumbRecipients -1
EventLog.write("Old Address = " & oRecipients(i).Address)
sAddress(i) = oRecipients(i).Address
Next

oMessage.ClearRecipients()

For i = 0 To iNumbRecipients -1
oMessage.AddRecipient "", sAddress(i)
EventLog.write("New Address = " & sAddress(i))
Next

oMessage.save
Result.value =0

----------------------------------------

Thanks to all people that put effort in helping me out!

User avatar
SorenR
Senior user
Senior user
Posts: 4198
Joined: 2006-08-21 15:38
Location: Denmark

Re: SMTPC relay Amazon SES error 554 Missing Final domain

Post by SorenR » 2020-11-07 17:53

guidoadam wrote:
2020-11-07 16:17
PROBLEM:
The problem seems that SES expects a quote formatted qualified emailadres: "Guido Adam" <guido@cluca.nl>. When an email client does an autocomplete like we could get an output like: Guido Adam <guido@cluca.nl>. Mention the quotes around the name. SES does not accept this and throw the error 'Missing final @domain'.
I believe you got it wrong...

oMessage.Recipients is the ENVELOPE RECIPIENTS and oMessage.FromAddress is the ENVELOPE SENDER and use the format

guido(a)cluca.nl

The ENVELOPE addressing is the "MAIL FROM:" and "RCPT TO:" listed in the SMTP conversation and is how the servers exchange addressing information.

Code: Select all

"SENT: 220 mx.acme.inc ESMTP"
"RECEIVED: EHLO warnerbros.com"
"SENT: 250-mx.acme.inc[nl]250-SIZE[nl]250 STARTTLS"
"RECEIVED: MAIL FROM: <daffy@warnerbros.com>"
"SENT: 250 OK"
"RECEIVED: RCPT TO: <coyote@acme.inc>"
"SENT: 250 OK"
"RECEIVED: DATA"
"SENT: 354 OK, send."
"SENT: 250 Queued (32.256 seconds)"
"RECEIVED: QUIT"
"SENT: 221 goodbye"
The MAIL HEADERS oMessage.From, oMessage.To, oMessage.Cc use the format

"Guido Adam" <guido(a)cluca.nl>

MAIL HEADERS contain the addressing shown by the client as "To:", "From: and "Cc:".

The hMailServer API Function oMessage.AddRecipient "Wile E. Coyote", "coyote(a)acme.inc" will build the addressing automatically thus insert "coyote(a)acme.inc" into oMessage.Recipients and insert '' "Wile E. Coyote" <coyote(a)acme.inc> '' into oMessage.To

For inspiration I use this on incoming messages:

Code: Select all

    Dim i, strTo, strOriginalTo
    For i = 0 To oMessage.Recipients.Count-1
        If (i = 0) Then
            strTo = oMessage.Recipients(i).Address
            strOriginalTo = oMessage.Recipients(i).OriginalAddress
        Else
            strTo = strTo & ", " & oMessage.Recipients(i).Address
            strOriginalTo = strOriginalTo & ", " & oMessage.Recipients(i).OriginalAddress
        End If
    Next
    oMessage.HeaderValue("X-Envelope-To") = strTo
    oMessage.HeaderValue("X-Envelope-OriginalTo") = strOriginalTo
    oMessage.HeaderValue("X-Envelope-From") = oMessage.FromAddress
    oMessage.Save
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

User avatar
SorenR
Senior user
Senior user
Posts: 4198
Joined: 2006-08-21 15:38
Location: Denmark

Re: SMTPC relay Amazon SES error 554 Missing Final domain

Post by SorenR » 2020-11-07 18:02

Hmm... Drupal users experience this problem if there is no "Reply-To" header in the email...

https://www.drupal.org/project/swiftmai ... es/3172111
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

guidoadam
New user
New user
Posts: 8
Joined: 2020-11-05 14:48

Re: SMTPC relay Amazon SES error 554 Missing Final domain

Post by guidoadam » 2020-11-09 10:09

SorenR wrote:
2020-11-07 17:53
I believe you got it wrong...

oMessage.Recipients is the ENVELOPE RECIPIENTS and oMessage.FromAddress is the ENVELOPE SENDER and use the format

guido(a)cluca.nl

The ENVELOPE addressing is the "MAIL FROM:" and "RCPT TO:" listed in the SMTP conversation and is how the servers exchange addressing information.....
Hi Soren, I'll defintely have a look at this. Thanks for the detailed explanation and if needed, I'll modify the apparent solution so that others won't just take it for granted.

User avatar
SorenR
Senior user
Senior user
Posts: 4198
Joined: 2006-08-21 15:38
Location: Denmark

Re: SMTPC relay Amazon SES error 554 Missing Final domain

Post by SorenR » 2020-11-09 15:23

FYI:
So, afaict SES requires a domain in both the "from" and "to" fields.
https://serverfault.com/questions/61734 ... cron-email
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

guidoadam
New user
New user
Posts: 8
Joined: 2020-11-05 14:48

Re: SMTPC relay Amazon SES error 554 Missing Final domain

Post by guidoadam » 2020-11-10 10:44

Hi Soren, thanks again for investigating. I really appreciate this.

Clear. It seems that in the SMTPC part of the sending, the from address is not populated. I would have to figure out if I can add this manually. From what I recall, this can't (easily) done by scripting, but have to test that.

Post Reply