I could not find a easy solution to record the env-receipient in
the environment for filtering, but got a new Received-style.
The line now also contains the software and version, ident-info has
been moved into the comment for rfc-compatibility, and the envelope-
receipient will be recorded.
I like this outfit (similar to other 'big' mta) much better than the
minimalistic 'qmail-style', its easier to read and even gives courier
some kind of personality and a friendly face...
I also found the receipient.ReleaseBuffer(-1); called too early,
see comments.
--- courier-0.35.1.orig/courier/submit.C Thu May 3 04:09:57 2001
+++ courier-0.35.1/courier/submit.C Fri Sep 21 08:24:01 2001
@@ -807,7 +808,8 @@
my_rcptinfo.whitelisted_only=0;
my_rcptinfo.nonwhitelisted_only=0;
- free(sender);
+ // PATCH: pretty-received uses sender
+ // free(sender);
for (;; )
{
@@ -834,7 +836,8 @@
oreceipient="";
dsn="";
}
- receipient.ReleaseBuffer(-1);
+ // variable used some lines below, line moved
+ // receipient.ReleaseBuffer(-1);
struct rw_info rwi;
struct rfc822t *rfcp;
@@ -847,6 +850,8 @@
rwi.udata=(void *)&my_rcptinfo;
my_rcptinfo.errflag=0;
my_rcptinfo.prw_receipient=receipient;
+ // now it should safe...
+ receipient.ReleaseBuffer(-1);
rw_rewrite_module(mf->module, &rwi, getrcpt);
@@ -897,24 +902,35 @@
line += p;
+ // PATCH pretty-received
if (identinfo && *identinfo)
{
- line += "\n (";
+ line.Chop(); // integrate into comment
+ line += " ";
line += identinfo;
line += ')';
}
- line += "\n by ";
+ line += "\n by ";
line += config_me();
line += " with ";
line += mf->module->name;
- line += "; ";
+ line += " (";
+ line += PACKAGE; // show off
+ line += " ";
+ line += VERSION;
+ line += ")\n for <"; // record envelope receipient
+ line += my_rcptinfo.prw_receipient.GetBuffer();
+ line += ">; ";
line += rfc822_mkdate(submit_time);
line += "\n";
my_rcptinfo.submitfile.Message(line);
+ free(sender);
+ // PATCH pretty-received end
+
unsigned received_cnt=0;
while (line.readline(cin, 5000) > 0)