masqmail

diff src/accept.c @ 304:d5ce2ba71e7b

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.
author markus schnalke <meillo@marmaro.de>
date Thu, 09 Dec 2010 18:28:11 -0300
parents 3e3c280ca5b2
children 29de6a1c4538
line diff
     1.1 --- a/src/accept.c	Thu Dec 09 18:01:46 2010 -0300
     1.2 +++ b/src/accept.c	Thu Dec 09 18:28:11 2010 -0300
     1.3 @@ -362,35 +362,33 @@
     1.4  
     1.5  	if (g_list_length(msg->rcpt_list) == 1) {
     1.6  		address *addr = (address *) (g_list_first(msg->rcpt_list)->data);
     1.7 -		for_string = g_strdup_printf(" for %s", addr_string(addr));
     1.8 +		for_string = g_strdup_printf("\n\tfor %s", addr_string(addr));
     1.9  	}
    1.10  
    1.11  	if (!msg->received_host) {
    1.12  		/* received locally */
    1.13  		hdr = create_header(HEAD_RECEIVED,
    1.14 -		    "Received: from %s by %s with %s (%s %s) id %s%s; %s\n",
    1.15 -		    passwd->pw_name, conf.host_name,
    1.16 -		    prot_names[msg->received_prot], PACKAGE, VERSION,
    1.17 +		    "Received: by %s (%s %s, from userid %d)\n\tid %s%s; %s\n",
    1.18 +		    conf.host_name, PACKAGE, VERSION, geteuid(),
    1.19  		    msg->uid, for_string ? for_string : "", rec_timestamp());
    1.20  	} else {
    1.21  		/* received from remote */
    1.22  #ifdef ENABLE_IDENT
    1.23  		DEBUG(5) debugf("adding 'Received:' header (5)\n");
    1.24  		hdr = create_header(HEAD_RECEIVED,
    1.25 -		    "Received: from %s (ident=%s) by %s with %s (%s %s) id %s%s; %s\n",
    1.26 +		    "Received: from %s (ident=%s)\n\tby %s with %s (%s %s)\n\tid %s%s; %s\n",
    1.27  		    msg->received_host, msg->ident ? msg->ident : "unknown",
    1.28  		    conf.host_name, prot_names[msg->received_prot], PACKAGE,
    1.29  		    VERSION, msg->uid, for_string ? for_string : "",
    1.30  		    rec_timestamp());
    1.31  #else
    1.32  		hdr = create_header(HEAD_RECEIVED,
    1.33 -		    "Received: from %s by %s with %s (%s %s) id %s%s; %s\n",
    1.34 +		    "Received: from %s\n\tby %s with %s (%s %s)\n\tid %s%s; %s\n",
    1.35  		    msg->received_host, conf.host_name,
    1.36  		    prot_names[msg->received_prot], PACKAGE, VERSION,
    1.37  		    msg->uid, for_string ? for_string : "", rec_timestamp());
    1.38  #endif
    1.39  	}
    1.40 -	header_fold(hdr, 78);
    1.41  	msg->hdr_list = g_list_prepend(msg->hdr_list, hdr);
    1.42  
    1.43  	if (for_string)