Skip to content

Emails are not delivered to icloud accounts #57

Description

@tnaumova

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 some@example.com \
--mail-rcpt <some>@icloud.com \
--upload-file - <<EOF
From: <some@example.com>
To: <some@icloud.com>
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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions