pencil icon indicating copy to clipboard operation
pencil copied to clipboard

Emails are not delivered to icloud accounts

Open tnaumova opened this issue 4 years ago • 1 comments

Hi,

I'm using this library to send some html email with attachments, and there is issue when emails are sent to iCloud accounts.

The email content is pretty simple, html + pdf file. However, emails are rejected by iCloud mail server.

The error iCloud mail server returns is (not much more explanation):

554 5.7.1 [CS01] Message rejected due to local policy. Please visit https://support.apple.com/en-us/HT204137

The culprit seems to be Message-ID header. Once it is present those emails are rejected.

For the test I sent a simple email via curl and then another one with Message-ID generated by the library, - the second email got blocked.

curl --ssl-reqd \
--url 'smtp://smtp.gmail.com:587' \
--user 'user:pass' \
--mail-from [email protected] \
--mail-rcpt <some>@icloud.com \
--upload-file - <<EOF
From: <[email protected]>
To: <[email protected]>
Message-ID: <GENERATED>
Subject: You are awesome!
Content-Type: multipart/alternative; boundary="boundary-string"

--boundary-string
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

This is the body 

--boundary-string
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

<!doctype html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body style="font-family: sans-serif;">
  This is html body 
  </body>
</html>

--boundary-string--
EOF

Сan it be made optional/removed?

Thanks in advance!

tnaumova avatar Oct 21 '21 08:10 tnaumova

@tnaumova thank you for reporting this issue and using this library in general. I'm a little bit busy at the moment but I will have a look

minosiants avatar Oct 25 '21 08:10 minosiants