[Mimedefang] MIMEDefang 2.69 - One compile issue - One Modification.

- kd6lvw at yahoo.com
Wed Jun 16 22:25:11 EDT 2010


gcc -g -O2 -Wall -Wstrict-prototypes -pthread -o mimedefang mimedefang.o drop_privs_threaded.o utils.o rm_r.o syslog-fac.o dynbuf.o milter_cap.o gen_id.o  -L../sendmail-8.14.5.Alpha0/obj.Linux.2.6.34.i686/libmilter -lmilter -lpthread -lnsl 
../sendmail-8.14.5.Alpha0/obj.Linux.2.6.34.i686/libmilter/libmilter.a(listener.o)(.text+0x5d5): In function `mi_milteropen':
: undefined reference to `freehostent'
collect2: ld returned 1 exit status
make: *** [mimedefang] Error 1


Needs "-lbind" when freehostent (3) is defined in libbind and NOT "stubbed" in libmilter.

See http://www.isc.org/software/libbind - version 6.0.


All other references to "bounce" (vs. reject) seem to be in documentation files.  I leave that for you to change.  Here is a unified-diff to the operational files for that change:


--- mimedefang.pl.in    2010-06-17 01:49:19.000000000 +0000
+++ mimedefang.pl.in    2010-06-17 01:55:59.000000000 +0000
@@ -1135,13 +1135,13 @@
 # %ARGUMENTS:
 #  None
 # %RETURNS:
-#  True if message has been rejected (with action_bounce or action_tempfail);
+#  True if message has been rejected (with action_reject or action_tempfail);
 #  false otherwise.
 #***********************************************************************
 sub message_rejected () {
     return 0 if (!in_message_context("message_rejected"));
     return (defined($Actions{'tempfail'}) ||
-           defined($Actions{'bounce'})   ||
+           defined($Actions{'reject'})   ||
            defined($Actions{'discard'}));
 }
 
@@ -1477,6 +1477,19 @@
     return 1;
 }
 
+sub action_reject ($;$$) {
+    my($reply, $code, $dsn) = @_;
+    return 0 if (!in_message_context("action_reject"));
+
+    $reply = "Forbidden for policy reasons" unless (defined($reply) and ($reply ne ""));
+    $code = 554 unless (defined($code) and $code =~ /^5\d\d$/);
+    $dsn = "5.7.1" unless (defined($dsn) and $dsn =~ /^5\.\d{1,3}\.\d{1,3}$/);
+
+    write_result_line('B', $code, $dsn, $reply);
+    $Actions{'reject'}++;
+    return 1;
+}
+
 #***********************************************************************
 # %PROCEDURE: action_bounce
 # %ARGUMENTS:
@@ -1486,21 +1499,11 @@
 # %RETURNS:
 #  Nothing
 # %DESCRIPTION:
-#  Causes the SMTP transaction to fail with an SMTP 554 failure code and the
-#  specified reply text.  If code or DSN are omitted or invalid,
-#  use 554 and 5.7.1.
+#  Backwards-compatible function call name for actin_reject() for versions
+#  of MIMEDefang prior to 2.70.
 #***********************************************************************
 sub action_bounce ($;$$) {
-    my($reply, $code, $dsn) = @_;
-    return 0 if (!in_message_context("action_bounce"));
-
-    $reply = "Forbidden for policy reasons" unless (defined($reply) and ($reply ne ""));
-    $code = 554 unless (defined($code) and $code =~ /^5\d\d$/);
-    $dsn = "5.7.1" unless (defined($dsn) and $dsn =~ /^5\.\d{1,3}\.\d{1,3}$/);
-
-    write_result_line('B', $code, $dsn, $reply);
-    $Actions{'bounce'}++;
-    return 1;
+    action_reject(@_);
 }
 
 #***********************************************************************
@@ -2286,7 +2289,7 @@
     foreach $recip (@Recipients) {
        if (!resend_message_one_recipient($recip)) {
            md_syslog('crit', 'stream_by_recipient: COULD NOT RESEND MESSAGE - PLEASE INVESTIGATE');
-           action_bounce("Unable to stream message");
+           action_reject("Unable to stream message");
 
            # We return 1 to avoid rest of filter
            return 1;
@@ -2334,7 +2337,7 @@
        foreach $key (keys %Domains) {
            if (!resend_message(@{$Domains{$key}})) {
                md_syslog('crit', 'stream_by_domain: COULD NOT RESEND MESSAGE - PLEASE INVESTIGATE');
-               action_bounce("Unable to stream message");
+               action_reject("Unable to stream message");
 
                # We return 1 to avoid rest of filter
                return 1;
@@ -5887,8 +5890,8 @@
     close FILE;
 
     if (!defined($entity) && $MaxMIMEParts > 0) {
-       # Message is too complex; bounce it
-       action_bounce("Message contained too many MIME parts.  We do not accept such complicated messages.");
+       # Message is too complex; reject it
+       action_reject("Message contained too many MIME parts.  We do not accept such complicated messages.");
        signal_unchanged();
        signal_complete();
        return;
--- mimedefang.c        2010-06-16 19:08:24.000000000 +0000
+++ mimedefang.c   2010-06-17 02:15:42.000000000 +0000
@@ -1662,7 +1662,7 @@
        if (*rptr == 'T' ||
            *rptr == 'D' ||
            *rptr == 'B') {
-           /* We are tempfailing, discarding or bouncing the message */
+           /* We are tempfailing, discarding or rejecting the message */
            rejecting = 1;
            break;
        }
@@ -1701,8 +1701,8 @@
 
        switch(*rptr) {
        case 'B':
-           /* Bounce */
-           syslog(LOG_DEBUG, "%s: Bouncing because filter instructed us to",
+           /* Reject */
+           syslog(LOG_DEBUG, "%s: Rejecting because filter instructed us to",
                   data->qid);
            split_on_space3(rptr+1, &code, &dsn, &reply);
            percent_decode(code);





More information about the MIMEDefang mailing list