# HG changeset patch # User markus schnalke # Date 1291930091 10800 # Node ID d5ce2ba71e7b4e0fba74e4c355e9719efa0ca11a # Parent 3e3c280ca5b2b350632413dabdc0af14caf0c67b manual formating of Received: hdrs; changed hdr for local receival Now the Received: headers are much friendlier to read. About folding: We must fold any line at 998 chars before transfer. We should fold the lines we produce at 78 chars. That is what RFC 2821 requests. We should think about it, somewhen. The header for locally (i.e. non-SMTP) received mail is changed to the format postfix uses. This matches RFC 2821 better. The `from' clause should contain a domain or IP, not a user name. Also, the `with' clause should contain a registered standard protocol name, which ``local'' is not. diff -r 3e3c280ca5b2 -r d5ce2ba71e7b src/accept.c --- a/src/accept.c Thu Dec 09 18:01:46 2010 -0300 +++ b/src/accept.c Thu Dec 09 18:28:11 2010 -0300 @@ -362,35 +362,33 @@ if (g_list_length(msg->rcpt_list) == 1) { address *addr = (address *) (g_list_first(msg->rcpt_list)->data); - for_string = g_strdup_printf(" for %s", addr_string(addr)); + for_string = g_strdup_printf("\n\tfor %s", addr_string(addr)); } if (!msg->received_host) { /* received locally */ hdr = create_header(HEAD_RECEIVED, - "Received: from %s by %s with %s (%s %s) id %s%s; %s\n", - passwd->pw_name, conf.host_name, - prot_names[msg->received_prot], PACKAGE, VERSION, + "Received: by %s (%s %s, from userid %d)\n\tid %s%s; %s\n", + conf.host_name, PACKAGE, VERSION, geteuid(), msg->uid, for_string ? for_string : "", rec_timestamp()); } else { /* received from remote */ #ifdef ENABLE_IDENT DEBUG(5) debugf("adding 'Received:' header (5)\n"); hdr = create_header(HEAD_RECEIVED, - "Received: from %s (ident=%s) by %s with %s (%s %s) id %s%s; %s\n", + "Received: from %s (ident=%s)\n\tby %s with %s (%s %s)\n\tid %s%s; %s\n", msg->received_host, msg->ident ? msg->ident : "unknown", conf.host_name, prot_names[msg->received_prot], PACKAGE, VERSION, msg->uid, for_string ? for_string : "", rec_timestamp()); #else hdr = create_header(HEAD_RECEIVED, - "Received: from %s by %s with %s (%s %s) id %s%s; %s\n", + "Received: from %s\n\tby %s with %s (%s %s)\n\tid %s%s; %s\n", msg->received_host, conf.host_name, prot_names[msg->received_prot], PACKAGE, VERSION, msg->uid, for_string ? for_string : "", rec_timestamp()); #endif } - header_fold(hdr, 78); msg->hdr_list = g_list_prepend(msg->hdr_list, hdr); if (for_string)