[Mimedefang] Any way to get MD to accept a Postfix queue ID at RCPT time?

Bill Cole mdlist-20140424 at billmail.scconsult.com
Wed Apr 29 00:36:26 EDT 2015

On 28 Apr 2015, at 15:53, Dianne Skoll wrote:

> Hi,
> Actually, this is a more thought-through patch.  I don't use Postfix, 
> but
> if any Postfix users would care to give this a try, I'd appreciate it.

Built and installed 2.78 plus that patch, ~4 hours ago on my personal 
system, works as intended without any sign of trouble on 219 messages, 
all single-rcpt.

Doing the build reminded me of a longstanding unreported bug in 
t/unit/dates.t, in the rfc2822_date_works test. It assumes that it is 
using the GNU/Linux implementation of 'date' or another which includes 
'unrecognized' in the error message when it is given a bad option. BSD 
'date' accepts no 'long' options and says "date: illegal option -- -" so 
it breaks this. A quick and dirty hack is to add '|illegal' to the 
pattern match in the existing test, but frankly the whole model of 
looking for specific words in a merged stdout+stderr is a bit shabby. 
Here's an alternative, using a highly portable 'date' command and 
determining its success based simply on the return value:

--- t/unit/dates.t.orig	2015-04-29 00:05:30.000000000 -0400
+++ t/unit/dates.t	2015-04-29 00:02:30.000000000 -0400
@@ -23,8 +23,9 @@

  sub rfc2822_date_works : Test(1)
-	my $want = `date --rfc-822 2>&1`;
-	return '"date" command does not support --rfc-822 option' if $want =~ 
+	my $want = `LC_ALL=C date +"%a, %d %b %Y %H:%M:%S %z"`;
+	my $RC=$?;
+	return '"date" command returned $RC' if $RC != 0;
  	chomp $want;
  	$want =~ s/\d{2}:\d{2} (-+)/\\d{2}:\\d{2} $1/;
  	like(::main::rfc2822_date(), qr/$want/, 'Got correct RFC 2822 date');

More information about the MIMEDefang mailing list