Hi,

running MIMEDefang 2.71.
I'm running into the following problem. I have a mimedefang-filter script, which tries to determine the message's (top or outer) header content-type to decide what to do with the message:

sub filter_begin {
   my($entity, $name, $ext, $type) = @_;

   $head = $entity->head;
   $toptype = $head->get('Content-type');

Now this run's fine when I send 'multipart' messages through the filter (i.e. messages with a content type multipart/... in the header). The content-type is determined correctly and can be used to decide what to do next.

However, as soon as I send a text/plain message through the filter, the content-type that is 'seen' by the mimedefang-filter is not 'text/plain', but it is 'multipart/mixed'. Then, when this same message is received (unalterated) by the recipient, the content-type is just 'plain/text' as it originally was (not 'multipart/mixed').

Analysing this problem, I decide to dump the complete header of the message to a log file. This showed me that the original content-type was not present in the $head object, instead the $head object had a content-type line at the end of the header.

Input header (injected with telnet via port 25):

From: [email protected]
To: [email protected]
Subject: test content type
Content-type: text/plain
Date: 16 Aug 2011 12:15:00 +0200

The header as dumped (using $head->as_string) shows this header as:

From: [email protected]
To: [email protected]
Subject: test content type
Date: 16 Aug 2011 12:15:00 +0200
Message-Id: <[email protected]>
Content-type: multipart/mixed; boundary="----------=_1313492497-15062-0"

Please note the difference in content-type.

Mimedefang is called from within Postfix, where Postfix inserted the Message-ID. I have looked througout the Postfix configuration, but I can't find anywhere a place in the Postfix configuration which could be responsible for the fact that MIMEdefang sees a content-type multipart/mixed instead of text/plain. Besides that, the recipient system shows a text/plain content-type as well.

On the receiving side, the message header shows this:

MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain
From: [email protected]
To: [email protected]
Subject: test content type
Date: Tue, 16 Aug 2011 12:15:00 +0200
Message-id: <[email protected]>
X-Scanned-By: MIMEDefang 2.71 on 10.60.1.180

BTW: determining the effective content type:

$effecttype = $entity->effective_type;

shows exactly the same as the $toptype (i.e. multipart/mixed instead of text/plain).

Where does MIMEDefang (or MIME::Entity) gets this content-type multipart/mixed from? And how can I solve this problem? Is there any chance on stale data after a run of MIMEdefang?

Any help appreciated.
/rolf

_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to