masqmail-0.2

diff src/accept.c @ 13:49dab67fe461

code beautifying
author meillo@marmaro.de
date Wed, 29 Oct 2008 21:10:18 +0100
parents 26e34ae9a3e3
children a8f3424347dc
line diff
     1.1 --- a/src/accept.c	Wed Oct 29 16:34:13 2008 +0100
     1.2 +++ b/src/accept.c	Wed Oct 29 21:10:18 2008 +0100
     1.3 @@ -306,14 +306,17 @@
     1.4  
     1.5  				if ((msg->return_path = create_address_qualified(addr, FALSE, msg->received_host)) != NULL) {
     1.6  					DEBUG(3) debugf("setting return_path to %s\n", addr_string(msg->return_path));
     1.7 -					msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_UNKNOWN, "X-Warning: return path set from %s address\n", hdr->id == HEAD_SENDER ? "Sender:" : "From:"));
     1.8 +					msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_UNKNOWN,
     1.9 +					                              "X-Warning: return path set from %s address\n",
    1.10 +					                              hdr->id == HEAD_SENDER ? "Sender:" : "From:"));
    1.11  				}
    1.12  				g_free(addr);
    1.13  			}
    1.14  			if (msg->return_path == NULL) {  /* no Sender: or From: or create_address_qualified failed */
    1.15  				msg->return_path = create_address_qualified("postmaster", TRUE, conf.host_name);
    1.16  				DEBUG(3) debugf("setting return_path to %s\n", addr_string(msg->return_path));
    1.17 -				msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_UNKNOWN, "X-Warning: real return path is unkown\n"));
    1.18 +				msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_UNKNOWN,
    1.19 +				                              "X-Warning: real return path is unkown\n"));
    1.20  			}
    1.21  		}
    1.22  
    1.23 @@ -342,23 +345,19 @@
    1.24  			msg->hdr_list = g_list_append(msg->hdr_list,
    1.25  			                msg->full_sender_name
    1.26  			                ?
    1.27 -			                  create_header(HEAD_FROM,
    1.28 -			                  "From: \"%s\" <%s@%s>\n",
    1.29 -			                  msg->full_sender_name,
    1.30 -			                  msg->return_path->local_part,
    1.31 -			                  msg->return_path->
    1.32 -			                  domain)
    1.33 +			                  create_header(HEAD_FROM, "From: \"%s\" <%s@%s>\n", msg->full_sender_name,
    1.34 +			                                msg->return_path->local_part, msg->return_path->domain)
    1.35  			                :
    1.36  			                  create_header(HEAD_FROM, "From: <%s@%s>\n",
    1.37 -			                  msg->return_path->local_part,
    1.38 -			                  msg->return_path->domain)
    1.39 +			                                msg->return_path->local_part, msg->return_path->domain)
    1.40  			                );
    1.41  		}
    1.42  		if ((flags & ACC_HEAD_FROM_RCPT) && !has_rcpt) {
    1.43  			GList *node;
    1.44  			DEBUG(3) debugf("adding 'To' header(s)\n");
    1.45  			for (node = g_list_first(msg->rcpt_list); node; node = g_list_next(node)) {
    1.46 -				msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_TO, "To: %s\n", addr_string(msg-> return_path)));
    1.47 +				msg->hdr_list = g_list_append(msg->hdr_list,
    1.48 +				                              create_header(HEAD_TO, "To: %s\n", addr_string(msg-> return_path)));
    1.49  			}
    1.50  		}
    1.51  		if ((flags & ACC_DEL_BCC) && !has_to_or_cc) {
    1.52 @@ -372,7 +371,8 @@
    1.53  		}
    1.54  		if (!has_id) {
    1.55  			DEBUG(3) debugf("adding 'Message-ID:' header\n");
    1.56 -			msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_MESSAGE_ID, "Message-ID: <%s@%s>\n", msg->uid, conf.host_name));
    1.57 +			msg->hdr_list = g_list_append(msg->hdr_list,
    1.58 +			                              create_header(HEAD_MESSAGE_ID, "Message-ID: <%s@%s>\n", msg->uid, conf.host_name));
    1.59  		}
    1.60  	}
    1.61  
    1.62 @@ -390,40 +390,20 @@
    1.63  		}
    1.64  
    1.65  		if (msg->received_host == NULL) {
    1.66 -			hdr = create_header(HEAD_RECEIVED,
    1.67 -			                    "Received: from %s by %s"
    1.68 -			                    " with %s (%s %s) id %s%s;"
    1.69 -			                    " %s\n",
    1.70 -			                    passwd->pw_name, conf.host_name,
    1.71 -			                    prot_names[msg->received_prot],
    1.72 -			                    PACKAGE, VERSION,
    1.73 -			                    msg->uid, for_string ? for_string : "",
    1.74 -			                    rec_timestamp());
    1.75 +			hdr = create_header(HEAD_RECEIVED, "Received: from %s by %s with %s (%s %s) id %s%s; %s\n",
    1.76 +			                    passwd->pw_name, conf.host_name, prot_names[msg->received_prot],
    1.77 +			                    PACKAGE, VERSION, msg->uid, for_string ? for_string : "", rec_timestamp());
    1.78  		} else {
    1.79  #ifdef ENABLE_IDENT
    1.80  			DEBUG(5) debugf("adding 'Received:' header (5)\n");
    1.81 -			hdr = create_header(HEAD_RECEIVED,
    1.82 -			                    "Received: from %s (ident=%s) by %s"
    1.83 -			                    " with %s (%s %s) id %s%s;"
    1.84 -			                    " %s\n",
    1.85 -			                    msg->received_host,
    1.86 -			                    msg->ident ? msg->ident : "unknown",
    1.87 -			                    conf.host_name,
    1.88 -			                    prot_names[msg->received_prot],
    1.89 -			                    PACKAGE, VERSION,
    1.90 -			                    msg->uid, for_string ? for_string : "",
    1.91 +			hdr = create_header(HEAD_RECEIVED, "Received: from %s (ident=%s) by %s with %s (%s %s) id %s%s; %s\n",
    1.92 +			                    msg->received_host, msg->ident ? msg->ident : "unknown", conf.host_name,
    1.93 +			                    prot_names[msg->received_prot], PACKAGE, VERSION, msg->uid, for_string ? for_string : "",
    1.94  			                    rec_timestamp());
    1.95  #else
    1.96 -			hdr = create_header(HEAD_RECEIVED,
    1.97 -			                    "Received: from %s by %s"
    1.98 -			                    " with %s (%s %s) id %s%s;"
    1.99 -			                    " %s\n",
   1.100 -			                    msg->received_host,
   1.101 -			                    conf.host_name,
   1.102 -			                    prot_names[msg->received_prot],
   1.103 -			                    PACKAGE, VERSION,
   1.104 -			                    msg->uid, for_string ? for_string : "",
   1.105 -			                    rec_timestamp());
   1.106 +			hdr = create_header(HEAD_RECEIVED, "Received: from %s by %s with %s (%s %s) id %s%s; %s\n",
   1.107 +			                    msg->received_host, conf.host_name, prot_names[msg->received_prot],
   1.108 +			                    PACKAGE, VERSION, msg->uid, for_string ? for_string : "", rec_timestamp());
   1.109  #endif
   1.110  		}
   1.111  		header_fold(hdr);
   1.112 @@ -435,8 +415,8 @@
   1.113  
   1.114  	/* write message to spool: */
   1.115  	/* accept is no longer responsible for this
   1.116 -	   if(!spool_write(msg, TRUE))
   1.117 -	   return AERR_NOSPOOL;
   1.118 +	   if (!spool_write(msg, TRUE))
   1.119 +	     return AERR_NOSPOOL;
   1.120  	 */
   1.121  	return AERR_OK;
   1.122  }