[Mimedefang] MIMEDefang 2.74 is released

Philip Prindeville philipp_subx at redfish-solutions.com
Thu Jun 6 14:52:49 EDT 2013


On Jun 6, 2013, at 11:50 AM, Philip Prindeville <philipp_subx at redfish-solutions.com> wrote:

> Minor gripe… Seems that the Perl parser requires a forward declaration with prototype for recursive functions, i.e.:


Ok, less minor gripe… looks like filter_relay() and filter_helo() are always receiving $myport as '0'.

Jun  6 12:17:51 mail mimedefang.pl[5260]: filter_relay(192.168.1.38, macmini.redfish-solutions.com, 49228, 192.168.1.3, 0)


So it looks like I need to have:

MD_EXTRA="y"

set on all Fedora systems running 8.14.7 or later… Would be nice to not have to set this manually.  I'll ask on #fedora-devel if there's a simple work around for this… Although passing in a -DFLAG at compile time saying "we'll always build on post-8.14.4 systems" would be handy if it alleviated the need for this arg at runtime.

Would it also make sense to tweak MIME::Entity->build() to not add an 'X-Mailer' field except when Top != 0?

@@ -923,15 +948,15 @@ sub action_add_part ($$$$$$;$) {
     my ($part);
 
     $part = MIME::Entity->build(Type => $type,
+                               Top => 0,
+                               'X-Mailer' => undef,
                                Encoding => $encoding,
                                Data => ["$data"]);
     defined ($fname) && $part->head->mime_attr("Content-Type.name" => $fname);


In which case, in this chunk:


@@ -953,7 +978,8 @@ sub process_added_parts ($) {
 
     # Make sure we have a multipart/mixed container
     if (lc($rebuilt->head->mime_type) ne "multipart/mixed") {
-       $entity = MIME::Entity->build(Type => "multipart/mixed");
+       $entity = MIME::Entity->build(Type => "multipart/mixed",
+                                     'X-Mailer' => undef);
        $entity->add_part($rebuilt);
     } else {
        $entity = $rebuilt;

we should just set Top => 0, and not pass in 'X-Mailer' … and here:


@@ -1172,13 +1198,14 @@ sub action_replace_with_warning ($) {
     return 0 if (!in_filter_context("action_replace_with_warning"));
     $Actions{'replace_with_warning'}++;
     $Action = "replace";
-    $ReplacementEntity = MIME::Entity->build(Type => "text/plain",
-                                            Encoding => "-suggest",
-                                            Data => [ "$msg\n" ]);
     $WarningCounter++;
-    $ReplacementEntity->head->mime_attr("Content-Type.name" => "warning$WarningCounter.txt");
-    $ReplacementEntity->head->mime_attr("Content-Disposition" => "inline");
-    $ReplacementEntity->head->mime_attr("Content-Disposition.filename" => "warning$WarningCounter.txt");
+    $ReplacementEntity = MIME::Entity->build(Top => 0,
+                                            Type => "text/plain",
+                                            Encoding => "-suggest",
+                                            Disposition => "inline",
+                                            Filename => "warning$WarningCounter.txt",
+                                            'X-Mailer' => undef,
+                                            Data => [ "$msg\n" ]);
     return 1;
 }
 

and a couple of other places.

Just some random thoughts.

-Philip










More information about the MIMEDefang mailing list