Email sent to Gmail account is rejected

I have an app I wrote that handles user bug reports. One of the things it does it email my replies to the users. I’ve been using this app (with occasional updates) for about 15 years, and suddenly in the last two weeks, emails it sends to Gmail accounts get kicked back (mxes.net is my email host):


This is the Postfix program at host smtp-out-2.mxes.net.

I’m sorry to have to inform you that your message could not be
delivered to one or more recipients. Here is the reason why the
message could not be delivered.

rgara@gmail.com: host gmail-smtp-in.l.google.com[74.125.141.26] said:
550-5.7.1 [67.222.241.249 11] Our system has detected that this
message is 550-5.7.1 not RFC 5322 compliant: 550-5.7.1 ‘From’ header is
missing. 550-5.7.1 To reduce the amount of spam sent to Gmail, this message
has been 550-5.7.1 blocked. Please visit 550-5.7.1
https://support.google.com/mail/?p=RfcMessageNonCompliant 550 5.7.1 and
review RFC 5322 specifications for more information. u6si4031360vkg.18 -
gsmtp (in reply to end of DATA command)
Reporting-MTA: dns; smtp-out-2.mxes.net
X-Postfix-Queue-ID: E7F7327505
X-Postfix-Sender: rfc822; lbugs@mckernon.com
Arrival-Date: Sun, 12 Nov 2017 16:15:00 -0500 (EST)

Final-Recipient: rfc822; rgara@gmail.com
Original-Recipient: rfc822; rgara@gmail.com
Action: failed
Status: 5.7.1
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.1 [67.222.241.249 11] Our system has
detected that this message is 550-5.7.1 not RFC 5322 compliant: 550-5.7.1
‘From’ header is missing. 550-5.7.1 To reduce the amount of spam sent to
Gmail, this message has been 550-5.7.1 blocked. Please visit 550-5.7.1
https://support.google.com/mail/?p=RfcMessageNonCompliant 550 5.7.1 and
review RFC 5322 specifications for more information. u6si4031360vkg.18 -
gsmtp

I’m pretty sure the email I’m sending does have a ‘From’ header. Here’s a snippet of the code that sends the email:


mail = new emailMessage

mail.fromAddress = gSMFrom 'gSMFrom is my sending email address

mail.subject ==EmailWnd.SubjectEF.Text

mail.headers.appendHeader “X-Mailer”,“JMS Bug Reports Database”

mail.AddRecipient gCustEmailStr 'The recipient’s email address

mail.bodyPlainText=gEmailWnd.MessageEF.Text

gWnd.SMSocket.messages.append mail

gWnd.SMSocket.sendMail

The mail socket’s all set up it has a username, password, port, etc. -

Am I missing something? Email to everyone else around the world works fine, just not gmail. I’m using Xojo 2017 r 2.1

You should check your server side over which your sending email maybe it’s older or they changed some rules of handling e-mails which are going over them. So best way to start is to contact mxes.net tech. support and tell them for this issue.

Also give try with bellow thing combination for TO and/or FROM part

FROM/TO part of message to make as formation:

FLName <sendtoemail@mail.com>

rather then

(FLName) sendtoemail@mail.com

The From should only be the email address. Nothing else.

The mails are sent over your own host, aren’t they? That’s not really a good idea. This was discussed a couple of times here on the forum. Use Sendgrid or similar to send your mails so that your mails have less chance to get flagged as spam.

Hi John,

Should redact the email addresses (when posting in a public forum) to prevent spam crawling/harvesting.

[quote=358972:@Bogdan Pavlovic]You should check your server side over which your sending email maybe it’s older or they changed some rules of handling e-mails which are going over them. So best way to start is to contact mxes.net tech. support and tell them for this issue.

Also give try with bellow thing combination for TO and/or FROM part

FROM/TO part of message to make as formation:

FLName sendtoemail@mail.com[/quote]

Yep!

Tuffmail thinks the specification requires < > brackets around both To: and From: email addresses.

Example: Use johnstill@gmail.com instead of johnstill@gmail.com

The Xojo email examples should probably be updated to use this format.

@John McKernon :slight_smile: Guess I wrote & answered what should be a issue.

Tip: Same issue may come for other free mail service providers such as MS hotmail, outlook, msn, yahoo and etc.

So if you can by pass this issue it would be a great otherwise you can tweak by using PHP scripting on your own server to use as any ‘in middle’ guy to send mails :slight_smile:

Cheers.

Hmmm, Tuffmail probably changed a config in the last few weeks and broke it.

https://tools.ietf.org/html/rfc5322#section-3.4

[quote]Normally, a mailbox is composed of two parts: (1) an optional display
name that indicates the name of the recipient (which can be a person
or a system) that could be displayed to the user of a mail
application, and (2) an addr-spec address enclosed in angle brackets
(“<” and “>”). There is an alternate simple form of a mailbox where
the addr-spec address appears alone, without the recipient’s name or
the angle brackets.
The Internet addr-spec address is described in
section 3.4.1.[/quote]

How a company that deals in email (tuffmail) cant know what is allowed is a bit :open_mouth:

I just fired an email at a gmail account using my mail server and it worked fine using the following code:

[code]dim Socket1 As new SMTPSocket

Dim mail As EmailMessage

// set up the socket
Socket1.Address = “REDACTED”
Socket1.Port = 25

Socket1.UserName = “REDACTED”
Socket1.Password = “REDACTED”

// populate the email message
mail = New EmailMessage
mail.FromAddress = “REDACTED” ’ no <> used just a@a.com format
mail.Subject = “Test”
mail.AddRecipient(“REDACTED@gmail.com”) ’ no <> used
mail.BodyPlainText = “Test!”
mail.Headers.AppendHeader(“X-Mailer”,“SMTP Test”)

// send the email
Socket1.Messages.Append(mail)
Socket1.SendMail[/code]

It does really look like a tuffmail config issue.

@ Keep in mind that both things can be a problem, and e-mail formation and server side.

[quote=358984:@]Hmmm, Tuffmail probably changed a config in the last few weeks and broke it.

[/quote]

If Tuffmail did make a change, then wouldn’t non-Gmail addresses also stop working? Apple Mail manages to send email to Gmail accounts using my Tuffmail account, is it possible they use brackets?

In any case, I’m in talks with Tuffmail about how to solve this - we’ll see where it goes.

Tuffmail (according to their 90ish website) is for HOSTING mail. I meant that you use a company for SENDING mail.

Gmail is a diva so it’s normal that only Gmail is acting up.

Its impossible to say without knowing how their filters/mail transfer agents work.

Yes, Apple Mail is probably sending your email address across as:

John McKernon <a@a.com>

so it’ll work.

just clear out with mail service provider to be sure.
everything else is a bit then easier to handle and take care.

[quote=358982:@John McKernon]Yep!

Tuffmail thinks the specification requires < > brackets around both To: and From: email addresses.

Example: Use johnstill@gmail.com instead of johnstill@gmail.com

The Xojo email examples should probably be updated to use this format.[/quote]
I use Tuffmail as my personal mail server and I have a Web app that lets users send email via any of 3 smtp servers I can choose in the admin system preferences screen of that app. I only use Tuffmail for testing purposes, otherwise I use either SMTP2GO (my preference) or Mailgun. So I just tested it using Tuffmail’s smtp server with the TO address not having brackets (that’s the way the app is configured anyway). It worked fine.

This app uses brackets in the FROM address, so I just compiled a fresh test app that’s configured to not use brackets in the FROM address and that worked fine too.