spamass-milt-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

duplicate headers -- subject/content-type


From: Cowles, Steve
Subject: duplicate headers -- subject/content-type
Date: Wed, 18 Sep 2002 11:47:12 -0500

I'm running sendmail-8.12.5 with spamass-milter-0.1.2 along with
spamassassin.2.41. Sendmail is configured to relay all inbound e-mails to
our Exchange server using a mailertable entry (no local delivery). Had no
problems installing or configuring SA/spamass-milter, but I am getting
multiple header entries when spamassassin tags an e-mail as spam. e.g

Subject: Save 75% off Printer Inks Only for a Limited Time
Subject: Save 75% off Printer Inks Only for a Limited Time
Mime-Version: 1.0
Content-Type: text/html
Content-Type: text/html

...and the corresponding maillog entries:

Sep 18 07:08:59 excelsior sm-mta[8109]: g8IC8vG1008109: Milter add: header:
X-Spam-Level: *******
Sep 18 07:08:59 excelsior sm-mta[8109]: g8IC8vG1008109: Milter add: header:
X-Spam-Checker-Version: SpamAssassin 2.41 (1.115.2.8-2002-09-05-exp)
Sep 18 07:08:59 excelsior sm-mta[8109]: g8IC8vG1008109: Milter add: header:
Subject: Save 75% off Printer Inks Only for a Limited Time
Sep 18 07:08:59 excelsior sm-mta[8109]: g8IC8vG1008109: Milter add: header:
Content-Type: text/html
Sep 18 07:08:59 excelsior sm-mta[8109]: g8IC8vG1008109: Milter message: body
replaced


After looking at the milter code, I "think" I have found the source of this
problem, but my programming/debugging skills are limited (anyway, see
below). Based on my understanding of the milter code, this looks like it
could be a SA return value problem, perl libs or simply an invalid test
within the milter. I can't really tell. Thus the reason I'm making this
post. 

Since I have SA configured to NOT modify the subject line and defang_mime
set to off, I'm confused as to why the milter is adding these headers
instead of skipping them all together. I'd be happy if the milter simply
selected "replace header".

Can someone possibly point me in the right direction on how to fix this
problem? I'll be glad to post this problem to the SA list, but I thought I
would start here. Any pointers/RTFM's would be appreciated.

BTW: I have the following options set in SA's local.cf

   rewrite_subject 0
   report_header 1
   use_terse_report 1
   defang_mime 0

--------- milter code I think is causing this problem ---------------
  //  However, only issue the header replacement calls if the content has
  //  actually changed. If SA didn't change subject or content-type, don't
  //  replace here unnecessarily.
  if (assassin->spam_flag().size()>0)
    {
      string oldstring;
      string newstring;

      // Subject header //
      // find it:
      newstring = retrieve_field(assassin->d().substr(0, eoh),
string("Subject"));
      oldstring = assassin->subject();

      old = assassin->set_subject(oldstring);

      // change if old one was present, append if non-null
      if (old > 0 && newstring != oldstring)
        smfi_chgheader(ctx,"Subject",1,newstring.size() > 0 ?
                       const_cast<char*>(newstring.c_str()) : NULL );
      else if (newstring.size()>0)
        smfi_addheader(ctx, "Subject",
                       const_cast<char*>(newstring.c_str()));


      // Content-Type header //
      // find it:
      newstring = retrieve_field(assassin->d().substr(0, eoh),
string("Content-Type"));
      oldstring = assassin->content_type();

      old = assassin->set_content_type(oldstring);

      // change if old one was present, append if non-null
      if (old > 0 && newstring != oldstring)
        smfi_chgheader(ctx,"Content-Type",1,newstring.size() > 0 ?
                       const_cast<char*>(newstring.c_str()) : NULL );
      else if (assassin->content_type().size()>0)
        smfi_addheader(ctx, "Content-Type",
                       const_cast<char*>(newstring.c_str()));

Steve Cowles




reply via email to

[Prev in Thread] Current Thread [Next in Thread]