Author: Alexander Zangerl <az@debian.org>
Subject: repair MDN generation for nmh 1.5++

diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' exmh-2.8.0~/lib/receipt.tcl exmh-2.8.0/lib/receipt.tcl
--- exmh-2.8.0~/lib/receipt.tcl	2012-05-21 20:23:57.000000000 +1000
+++ exmh-2.8.0/lib/receipt.tcl	2012-05-21 20:24:08.409987225 +1000
@@ -485,9 +485,14 @@
 	close $in
 	error "Cannot create mdn"
     }
-    # Bug - someplace right here, we need to make 'post' generate
-    # a 'MAIL FROM:<>' to be fully RFC compliant.,..
-    puts $out "Subject: Disposition notification\nTo: $address"
+    puts $out "Subject: Disposition notification\nTo: $address\nFrom: $rcpt"
+    # if nmh 1.5 or newer, use Envelope-From: to force mail from: <>
+    catch {exec scan -version} nmhversion
+    if [ regexp {nmh-(\d+)\.(\d+)} $nmhversion allofit major minor ] { 
+	if {$major >= 1 && $minor >= 5 } {
+	    puts $out "Envelope-From:"
+	}
+    }
 
     set bdry [FvMimeStartMulti $out \
 	"multipart/report; report-type=disposition-notification" 0]
