fphilipe/premailer-rails3 — Issue #21: Attachments not working
Author: Facens
Created: 2012-02-18 12:48:43+00:00
State: open

Attachments are interpreted as an 'alternative' to text/html and text/plain. To be more precise, this is as it is now:

```
Subject: [SUBJECT]
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_4f3f93ff19851_232b80434f4c466bf";
charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Gm-Message-State: ALoCoQklBXxw350+ohWjgoEN7hwcLka6gnFP91+s2pgrQnmO68zsfOk2FytAG8lKURw+ZnSEGv09

----==_mimepart_4f3f93ff19851_232b80434f4c466bf
Date: Sat, 18 Feb 2012 13:05:19 +0100
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <4f3f93ff2bd9d_232b80434f4c468fa@Ad-Maiora.local.mail>

[HTML]

----==_mimepart_4f3f93ff19851_232b80434f4c466bf
Date: Sat, 18 Feb 2012 13:05:19 +0100
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <4f3f93ff22259_232b80434f4c4672f@Ad-Maiora.local.mail>

[PLAIN_TEXT]

----==_mimepart_4f3f93ff19851_232b80434f4c466bf
Date: Sat, 18 Feb 2012 13:05:19 +0100
Mime-Version: 1.0
Content-Type: application/pdf;
charset=UTF-8;
filename="iubenda - invoice 2012-2 - boh-it.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="iubenda - invoice 2012-2 - boh-it.pdf"
Content-ID: <4f3f93fe12603_232b80434f4c4632f@Ad-Maiora.local.mail>

[ATTACHMENT]

----==_mimepart_4f3f93ff19851_232b80434f4c466bf--

```

This is as it *should* be (the following *works)

```
Subject: [SUBJECT]
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="--==_mimepart_4f3f9a55ce2e8_27a480434f4c45522";
charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Gm-Message-State: ALoCoQlheI2MEADdbZu+TmYeXlhJkmL8Nrxlcv6jUPhvXCXAQT2dlOIfsMx3vKnR5I/786l1g9X5

----==_mimepart_4f3f9a55ce2e8_27a480434f4c45522
Date: Sat, 18 Feb 2012 13:32:21 +0100
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_4f3f9a55c2d41_27a480434f4c454e3";
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <4f3f9a55dd6f0_27a480434f4c458f6@Ad-Maiora.local.mail>

----==_mimepart_4f3f9a55c2d41_27a480434f4c454e3
Date: Sat, 18 Feb 2012 13:32:21 +0100
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <4f3f9a55dce3a_27a480434f4c45783@Ad-Maiora.local.mail>

[HTML]

----==_mimepart_4f3f9a55c2d41_27a480434f4c454e3
Date: Sat, 18 Feb 2012 13:32:21 +0100
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <4f3f9a55d5bfa_27a480434f4c45651@Ad-Maiora.local.mail>

[PLAIN_TEXT]

----==_mimepart_4f3f9a55c2d41_27a480434f4c454e3--

----==_mimepart_4f3f9a55ce2e8_27a480434f4c45522
Date: Sat, 18 Feb 2012 13:32:21 +0100
Mime-Version: 1.0
Content-Type: application/pdf;
charset=UTF-8;
filename="iubenda - invoice 2012-2 - boh-it.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="iubenda - invoice 2012-2 - boh-it.pdf"
Content-ID: <4f3f9a553f8b9_27a480434f4c45354@Ad-Maiora.local.mail>

[ATTACHMENT]

----==_mimepart_4f3f9a55ce2e8_27a480434f4c45522--

```

I know that it's more likely to be a premailer's bug, but I'm reporting it here first since alexdunae doesn't seem to be that active.

Thank you in advance.