--- ./courier/submit.C.orig	Thu Jul 11 16:03:20 2002
+++ ./courier/submit.C	Fri Sep  6 20:47:17 2002
@@ -841,7 +841,7 @@
 	my_rcptinfo.whitelisted_only=0;
 	my_rcptinfo.nonwhitelisted_only=0;

-	free(sender);
+//	free(sender);

 	for (;; )
 	{
@@ -877,7 +877,7 @@
 			oreceipient="";
 			dsn="";
 		}
-		receipient.ReleaseBuffer(-1);
+//		receipient.ReleaseBuffer(-1);

 	struct	rw_info rwi;
 	struct	rfc822t *rfcp;
@@ -890,7 +890,7 @@
 		rwi.udata=(void *)&my_rcptinfo;
 		my_rcptinfo.errflag=0;
 		my_rcptinfo.prw_receipient=receipient;
-
+		receipient.ReleaseBuffer(-1);
 		rw_rewrite_module(mf->module, &rwi, getrcpt);

 		// CANNOT reject if errflag=0 any more, due to filtering
@@ -942,20 +942,27 @@

 	if (identinfo && *identinfo)
 	{
-		line += "\n  (";
+		line.Chop();
+		line += " ";
 		line += identinfo;
 		line += ')';
 	}

-	line += "\n  by ";
+	line += "\n\tby ";
 	line += config_me();
+	line += " (Courier ";
+	line += VERSION;

-	line += " with ";
+	line += ") with ";

 	line += mf->module->name;
-	line += "; ";
+	line += "\n\tfor <";
+	line += my_rcptinfo.prw_receipient.GetBuffer();
+	line += ">;  ";
 	line += rfc822_mkdate(submit_time);
-	line += "\n";
+	line += "\n\t(envelope-from <";
+	line += sender;
+	line += ">)\n";

 	for (p=line; *p; p++)
 		if ( (*p & 0x80) != 0)
@@ -982,6 +989,7 @@
 		}

 	my_rcptinfo.submitfile.Message(line);
+	free(sender);

 unsigned	received_cnt=0;

