Formatting email header correctly for multiple TO addresses

sozotech

Well-Known Member
Jul 26, 2013
116
6
68
cPanel Access Level
Root Administrator
I have a customer who has an application sending emails via a cPanel server. For many years they have had no issues sending to GMAIL but recently have been getting this error.

550-5.7.1 This message is not RFC 5322 compliant. There are multiple To headers. 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

It appears this issue is caused because their application is putting multiple TO lines in the header of the email like such:

RCPT TO: [email protected]
RCPT TO: [email protected]

So they have tried to reformat the header like such:

RCPT TO: [email protected], [email protected]

But the server is responding with the following:

501 [email protected], [email protected]: malformed address: ,
[email protected] may not follow [email protected]

From what I can tell the comma separated list of emails should be supported by exim so I am not sure what might be causing this issue or how to properly format the email to accept multiple emails on the TO line.

Any thoughts?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
Hey there! Here are the official details from Google, which you have likely already found:


I'm wondering if you just need to remove the space between the addresses, as Exim does support comma-separated lists of addresses.
 

sozotech

Well-Known Member
Jul 26, 2013
116
6
68
cPanel Access Level
Root Administrator
Hey there! Here are the official details from Google, which you have likely already found:


I'm wondering if you just need to remove the space between the addresses, as Exim does support comma-separated lists of addresses.
I don't think the space is the issue as when I send an email to multiple recipients from an mail client and look at the headers, it has spaces in it between email addresses.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
At least this confirms the issue is in the application. Is there a way to try it without the space in the application just to be sure?

Either way, it seems like this isn't related to cPanel but the way the app is handing over the email list to Exim. It should accept the list and then process each recipient separately.
 

sozotech

Well-Known Member
Jul 26, 2013
116
6
68
cPanel Access Level
Root Administrator
At least this confirms the issue is in the application. Is there a way to try it without the space in the application just to be sure?

Either way, it seems like this isn't related to cPanel but the way the app is handing over the email list to Exim. It should accept the list and then process each recipient separately.
 

sozotech

Well-Known Member
Jul 26, 2013
116
6
68
cPanel Access Level
Root Administrator
At least this confirms the issue is in the application. Is there a way to try it without the space in the application just to be sure?

Either way, it seems like this isn't related to cPanel but the way the app is handing over the email list to Exim. It should accept the list and then process each recipient separately.
I verified via telnetting to port 25 and manually entering in the RCTP TO:<[email protected]>, <[email protected]> gives this error so I know it is not just the application. I will have to do some more investigation I guess to figure out why this is happening.
 
Last edited:

quietFinn

Well-Known Member
Feb 4, 2006
2,109
580
493
Finland
cPanel Access Level
Root Administrator
I verified via telnetting to port 25 and manually entering in the FROM:<[email protected]>, <[email protected]> gives this error so I know it is not just the application. I will have to do some more investigation I guess to figure out why this is happening.
It's a bit confusing, you tell you are getting various error messages, but you don't (always) tell from where the errors are coming from, i.e is it the local Exim, or the receiving (Gmail?) server.

Besides I don't think you can have multiple addresses in FROM
 

sozotech

Well-Known Member
Jul 26, 2013
116
6
68
cPanel Access Level
Root Administrator
It's a bit confusing, you tell you are getting various error messages, but you don't (always) tell from where the errors are coming from, i.e is it the local Exim, or the receiving (Gmail?) server.

Besides I don't think you can have multiple addresses in FROM
Sorry for the confusion, first off the FROM should have been RCPT TO: and this is the connection to the cPanel server attempting to send to Gmail getting the error. Hopefully I will get more time today to trouble shoot this, I've just not seen this before as to why the server won't accept multiple To recipients. It has to be something wrong with the handshake to the server from their app but just not sure why I get the same error manually inputing the email via telnet.
 
  • Like
Reactions: cPRex
Thread starter Similar threads Forum Replies Date
R Email 1
O Email 1
D Email 2
E Email 1
B Email 2