Author Topic: Multiple Content-Type header?  (Read 11402 times)

0 Members and 1 Guest are viewing this topic.

kurtzweber

  • Guest
Multiple Content-Type header?
« on: January 23, 2009, 10:43:27 AM »
Hello!

Our company is sending mails to our customers: some of them - all using Avast Home - are calling us about a warning they receive:
Code: [Select]
Multiple Content-Type header - HIGH DANGER!
We're trying to understand the reason why only avast consider dangerous our mails, could you please explain which checks trigger that warning?

Here's a sample mail we're sending (obfuscated only personal data):

Code: [Select]
                                                                                                                                                                                                                                                               
Delivered-To: xx@gmail.com
Received: by yy with SMTP id y2cs145767qbh;
        Thu, 22 Jan 2009 00:24:29 -0800 (PST)
Received: by yy with SMTP id q14mr532732qbp.56.1232612668824;
        Thu, 22 Jan 2009 00:24:28 -0800 (PST)
Received-SPF: softfail (google.com: domain of transitioning xx@yy does not designate yy as permitted sender) client-ip=yy;
Received: by xx with POP3 id o12mf1908282qba.16;
        Thu, 22 Jan 2009 00:24:28 -0800 (PST)
X-Gmail-Fetch-Info: aa 2 bb 110 cc
Return-Path: <xx@yy>
Delivered-To: aa@bb
Received: (qmail 25247 invoked by uid 89); 22 Jan 2009 08:20:36 -0000
Received: by simscan 1.2.0 ppid: 25229, pid: 25236, t: 0.0701s
         scanners: clamav: 0.90.3/m:/d:3620
Received: from unknown (HELO aa) (bb)
  by cc with SMTP; 22 Jan 2009 08:20:36 -0000
Message-Id: <7113b3$rna2@prdiport02.ingdirect.it>
X-IronPort-AV: E=Sophos;i="4.37,305,1231110000";
   d="scan'208,217";a="908610"
Received: from unknown (HELO aa) ([ii])
  by aa with SMTP; 22 Jan 2009 09:13:36 +0100
MIME-Version: 1.0
To: xxx
From: "xxx" <yyy>
Subject: sss
Reply-To: contoarancio@ingdirectitalia.it
Content-Type: multipart/alternative; boundary="a1b2c3d4e3f2g1"
--a1b2c3d4e3f2g1
content-type: text/plain; charset=us-ascii
X-Spam-Rating: xx 1.6.2 0/1000/N

blablablabla

--a1b2c3d4e3f2g1
content-type: text/html;

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>bla</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bodybgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0">
blablabla
</body>
</html>


--a1b2c3d4e3f2g1--



sedina

  • Guest
Re: Multiple Content-Type header?
« Reply #1 on: January 23, 2009, 12:28:31 PM »
Hi,
header of you email contains two content-type fields, it's very suspicious (there is no reason why to send such emails). I think that in this case it's only mistake in composing of your email. I think that you mentioned to create following:
...
Subject: sss
Reply-To: contoarancio@ingdirectitalia.it
Content-Type: multipart/alternative; boundary="a1b2c3d4e3f2g1"

--a1b2c3d4e3f2g1
content-type: text/plain; charset=us-ascii
X-Spam-Rating: xx 1.6.2 0/1000/N

It should help, because with this new line, it's perfectly formatted email and no warning will appear.

Best regards,
Pavel Sedina

kurtzweber

  • Guest
Re: Multiple Content-Type header?
« Reply #2 on: January 23, 2009, 12:40:19 PM »
Hello!

Thanks for your reply... I can't find the difference between the original header and your suggestion  :-[
Did you add a blank line in this point?

Content-Type: multipart/alternative; boundary="a1b2c3d4e3f2g1"
(here)
--a1b2c3d4e3f2g1

Why this could make a difference?
Sorry, I'm not very expert in mail syntax: our mails are produced by an automatic system
Thanks again

kurtzweber

  • Guest
Re: Multiple Content-Type header?
« Reply #3 on: January 23, 2009, 03:05:25 PM »
Hello!

To help your analysis, I asked our software house and they sent me a snippet taken from the method which send mails:

Code: [Select]
    l_temp := l_temp || 'MIME-Version: 1.0' ||  chr(13) || chr(10);
    l_temp := l_temp || 'To: ' || p_to || chr(13) || chr(10);
    l_temp := l_temp || 'From: ' || p_from || chr(13) || chr(10);
    l_temp := l_temp || 'Subject: ' || p_subject || chr(13) || chr(10);
    l_temp := l_temp || 'Reply-To: ' || p_from ||  chr(13) || chr(10);
    l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' || chr(34) || l_boundary ||  chr(34) || chr(13) || chr(10);

thanks!

sedina

  • Guest
Re: Multiple Content-Type header?
« Reply #4 on: January 23, 2009, 03:28:25 PM »
The difference is that empty line - it must be there!

--a1b2c3d4e3f2g1 string defines a block of the email with given meaning (text - plain; text - html; etc.)
These blocks are the parts of the email body (not header!). And the body is defined as everything after first empty line:
..
..
EMAIL HEADER
..
..
<EMPTY LINE>
..
..
EMAIL BODY
..
..

This is the basic syntax of emails acording rfc822 specification.

So, I think that you should change your code (the last line) following way:
l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' || chr(34) || l_boundary ||  chr(34) || chr(13) || chr(10) || || chr(13) || chr(10);

hope it will help,
Pavel Sedina

kurtzweber

  • Guest
Re: Multiple Content-Type header?
« Reply #5 on: January 26, 2009, 05:42:03 PM »
THANKS!

You solved our issue: the new procedure (with the blank line) was able to send out correctly formatted emails which are no more rejected.
bye