Need clarification about Content-Type on email

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Need clarification about Content-Type on email

wodel youchi
Hi,

I need some clarification about Content-Type on an email.

Who does fix the Content-Type of an email?
The mail client? or the sending server or both?

We have postfix as our MTA and we use Horde Groupware for the web mail and both outllook and thuderbird as mail client.

And know we are in phase of integrating a new application, developed by a third party, in our company that uses our mail server to send mail to our clients.

The problem : if we edit mails using the webmail or the mail clients using non ASCII characters, they're well interpreted, but when using the application to send emails via our mail server, the non ASCII characters are not show properly.

The third party says that it's a problem with our mail server, they need to know the  : SMTP Server encoding, and the UTF-8 encoding details.

I searched the net about postfix and utf-8 but I didn't find any thing about showing the SMTP server encoding neither UTF-8 encoding details.

Any idea?

Regards.

Garanti sans virus. www.avast.com
Reply | Threaded
Open this post in threaded view
|

Re: Need clarification about Content-Type on email

Nicolas Bellemand
Hi,


This look like more client's related to retrieve and edit the mails rather than postfix itself, and you might require to look deeper into the email once corrupted.
Does the corrupted is identical/similar between the Webmail VS your email client?

Postfix does by default allow and understand such of formatting, however you might require to enable/force the UTF-8 support on postfix.

postconf "smtputf8_enable = yes"

http://www.postfix.org/SMTPUTF8_README.html#enabling

you can verify if this is well announced at the ehlo command
Postfix SMTP server announces SMTPUTF8 support in the EHLO response.  


Good luck.
Nicolas.



On 22 November 2017 at 08:46, wodel youchi <[hidden email]> wrote:
Hi,

I need some clarification about Content-Type on an email.

Who does fix the Content-Type of an email?
The mail client? or the sending server or both?

We have postfix as our MTA and we use Horde Groupware for the web mail and both outllook and thuderbird as mail client.

And know we are in phase of integrating a new application, developed by a third party, in our company that uses our mail server to send mail to our clients.

The problem : if we edit mails using the webmail or the mail clients using non ASCII characters, they're well interpreted, but when using the application to send emails via our mail server, the non ASCII characters are not show properly.

The third party says that it's a problem with our mail server, they need to know the  : SMTP Server encoding, and the UTF-8 encoding details.

I searched the net about postfix and utf-8 but I didn't find any thing about showing the SMTP server encoding neither UTF-8 encoding details.

Any idea?

Regards.

Garanti sans virus. www.avast.com

Reply | Threaded
Open this post in threaded view
|

Re: Need clarification about Content-Type on email

Nicky Thomassen
In reply to this post by wodel youchi
Wed, 22 Nov 2017 09:46:39 +0100 skrev wodel youchi <[hidden email]>:

> The problem : if we edit mails using the webmail or the mail clients using
> non ASCII characters, they're well interpreted, but when using the
> application to send emails via our mail server, the non ASCII characters
> are not show properly.

Postfix just transmits what your program gives it; you need to edit the program
to construct the mail in a better way. Something like setting a charset might
help
https://www.w3.org/Protocols/rfc1341/7_1_Text.html

Try to examine a mail sent from the webmail where non-ASCII works.

--
Nicky
Reply | Threaded
Open this post in threaded view
|

Re: Need clarification about Content-Type on email

Wietse Venema
In reply to this post by wodel youchi
wodel youchi:
> Hi,
>
> I need some clarification about Content-Type on an email.
>
> Who does fix the Content-Type of an email?
> The mail client? or the sending server or both?

The sender (mail client). If text contains non-ASCII then the
client must specify

Either:

    MIME-Version: 1.0 header
    8BITMIME option in the MAIL FROM command
    content-type (including charset) header
    content-transfer-encoding: 8bit header

Or:

    MIME-Version: 1.0 header
    content-type (including charset) header
    content-transfer-encoding: quoted-printable or base64 header

SEE also:
   RFC 2045 (MIME: Format of Internet Message Bodies)
   RFC 2046 (MIME: Media Types)

> The problem : if we edit mails using the webmail or the mail clients using
> non ASCII characters, they're well interpreted, but when using the
> application to send emails via our mail server, the non ASCII characters
> are not show properly.

The receiver needs to know the charset and encoding.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Need clarification about Content-Type on email

wodel youchi
Thank you all for your responses,

I am not sure if I can confirm that the problem came from the third party application, but after some search and comparing things I found :

In the faulty mail, I found that all characters that are miss-displayed were replaced by the utf-8 "replacement character" =EF=BF=BD

Searching on the web about quoted-printable, I found this site http://www.webatic.com/run/convert/qp.php which gave me the correct code for the characters with accent, using them in the faulty message fixed the problem.

So somewhere along the way, the characters with accent were miss-encoded? could that be the application?

Here some lines from the message :

MIME-Version: 1.0
Content-Type: multipart/mixed;
        boundary="----=_Part_76_1062807220.1510653473038"
X-Priority: 1

------=_Part_76_1062807220.1510653473038
Content-Type: image/jpeg; name="temp.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=temp.gif
Content-ID: <2F47766C7A454C4561674D51585556385369355378513D3D>

R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAEALAAAAAABAAEAAAgEAAMEBAA7
------=_Part_76_1062807220.1510653473038
Content-Type: text/html;charset=utf-8
Content-Transfer-Encoding: quoted-printable


<img src=3D"cid:2F47766C7A454C4561674D51585556385369355378513D3D" ><p><titl=
e></title><span style=3D"font-size: 14pt;"></span><br type=3D"_moz"></p><p>=
<meta name=3D"generator" content=3D"LibreOffice 5.4.2.2 (Windows)"></p><p><=
meta name=3D"created" content=3D"2017-10-19T08:35:48.046000000"></p><p><met=
a name=3D"changed" content=3D"2017-10-22T09:39:46.669000000"><style type=3D=
"text/css">
=09=09@page { margin: 2.5cm }
=09=09p { margin-bottom: 0.25cm; line-height: 120% }
=09=09a:link { so-language: zxx }</style></p><p style=3D"line-height: 150%;=
 margin-bottom: 0cm;"><font face=3D"Tahoma, serif"><font size=3D"3" style=
=3D"font-size: 12pt;"><b>DIVISION COMMERCIALE&nbsp; </b></font></font></p><=
p style=3D"line-height: 150%; text-indent: 1.25cm; margin-bottom: 0cm;"><br=
></p><p align=3D"right" style=3D"line-height: 150%; margin-bottom: 0cm;"><f=
ont face=3D"Tahoma, serif"><font size=3D"3" style=3D"font-size: 12pt;">14 N=
ovember 2017</font></font></p><p style=3D"line-height: 150%; margin-bottom:=
 0cm; margin-left: 7.75cm;"><br></p><p align=3D"center" style=3D"line-heigh=
t: 150%; margin-bottom: 0cm;"><font face=3D"Tahoma, serif"><font size=3D"3"=
 style=3D"font-size: 12pt;">Madame&nbsp;</font></font></p><p ali=
gn=3D"center" style=3D"line-height: 150%; margin-bottom: 0cm;"><br></p><p a=
lign=3D"center" style=3D"line-height: 150%; margin-bottom: 0cm;"><br></p><p=
 style=3D"line-height: 150%; margin-bottom: 0cm; margin-left: 7.75cm;"><br>=
</p><p style=3D"line-height: 150%; text-indent: -0.25cm; margin-bottom: 0cm=
;"><font face=3D"Tahoma, serif"><font size=3D"3" style=3D"font-size: 12pt;"=
><u><b>Objet</b></u></font></font> <font face=3D"Tahoma, serif"><font size=
=3D"3" style=3D"font-size: 12pt;"><b>/ </b></font></font><font face=3D"Taho=
ma, serif"><font size=3D"3" style=3D"font-size: 12pt;">Votre R=C3=A9clam=
ation REF N=EF=BF=BD


In this example, this last line is in plain french : Votre Réclamation

This sentence encoded in quoted-printable should be : Votre R=C3=A9clamation

Any idea?

Regards.

Garanti sans virus. www.avast.com

2017-11-22 13:34 GMT+01:00 Wietse Venema <[hidden email]>:
wodel youchi:
> Hi,
>
> I need some clarification about Content-Type on an email.
>
> Who does fix the Content-Type of an email?
> The mail client? or the sending server or both?

The sender (mail client). If text contains non-ASCII then the
client must specify

Either:

    MIME-Version: 1.0 header
    8BITMIME option in the MAIL FROM command
    content-type (including charset) header
    content-transfer-encoding: 8bit header

Or:

    MIME-Version: 1.0 header
    content-type (including charset) header
    content-transfer-encoding: quoted-printable or base64 header

SEE also:
   RFC 2045 (MIME: Format of Internet Message Bodies)
   RFC 2046 (MIME: Media Types)

> The problem : if we edit mails using the webmail or the mail clients using
> non ASCII characters, they're well interpreted, but when using the
> application to send emails via our mail server, the non ASCII characters
> are not show properly.

The receiver needs to know the charset and encoding.

        Wietse

Reply | Threaded
Open this post in threaded view
|

Re: Need clarification about Content-Type on email

Viktor Dukhovni
In reply to this post by wodel youchi


> On Nov 22, 2017, at 3:46 AM, wodel youchi <[hidden email]> wrote:
>
> The problem : if we edit mails using the webmail or the mail clients using non ASCII characters, they're well interpreted, but when using the application to send emails via our mail server, the non ASCII characters are not show properly.

That is, your server is working fine.

> The third party says that it's a problem with our mail server, they need to know the  : SMTP Server encoding, and the UTF-8 encoding details.

The third party's support people you're talking to are clueless bozos,
or (worse) their application developers are clueless bozos, or both.

> I searched the net about postfix and utf-8 but I didn't find any thing
> about showing the SMTP server encoding neither UTF-8 encoding details.
>
> Any idea?

The content of email messages is created and read by user agents,
all MTAs do is move it around from source to destination, and in
some cases apply an 8-bit to 7-bit content transfer encoding when
relaying mail from an 8BITMIME source to an ASCII-only destination.
We're assuming that you don't have any header_checks rules that
damage the MIME structure of received messages (unlikely since
regular mail works fine).

MIME content transfer encodings do not change the content seen by
users, the receiving user agent will undo any transfer encoding
(either base64 or quoted-printable).

You need to capture (with "tcpdump" or similar) the SMTP stream
between the application and your SMTP server and see whether the
application is emitting correctly encoded messages.

   http://www.postfix.org/DEBUG_README.html#sniffer

--
        Viktor.
Reply | Threaded
Open this post in threaded view
|

Re: Need clarification about Content-Type on email

Wietse Venema
In reply to this post by wodel youchi
wodel youchi:
> ------=_Part_76_1062807220.1510653473038
>
> *Content-Type: text/html;charset=utf-8Content-Transfer-Encoding:
> quoted-printable*

That looks effed-up. There should be a line break between 'charset=utf-8'
and 'Content-Transfer-Encoding'. Unfortunately, computera are not smart
enough to 'do what you mean'.

        Wietse