# HG changeset patch # User meillo@marmaro.de # Date 1225311018 -3600 # Node ID 49dab67fe4619b79a4183ec32e529d2fd9ad14ef # Parent 9fb7ddbaf129bb7e52c3d23c9189adaeee8e170f code beautifying diff -r 9fb7ddbaf129 -r 49dab67fe461 src/accept.c --- a/src/accept.c Wed Oct 29 16:34:13 2008 +0100 +++ b/src/accept.c Wed Oct 29 21:10:18 2008 +0100 @@ -306,14 +306,17 @@ if ((msg->return_path = create_address_qualified(addr, FALSE, msg->received_host)) != NULL) { DEBUG(3) debugf("setting return_path to %s\n", addr_string(msg->return_path)); - 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:")); + 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:")); } g_free(addr); } if (msg->return_path == NULL) { /* no Sender: or From: or create_address_qualified failed */ msg->return_path = create_address_qualified("postmaster", TRUE, conf.host_name); DEBUG(3) debugf("setting return_path to %s\n", addr_string(msg->return_path)); - msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_UNKNOWN, "X-Warning: real return path is unkown\n")); + msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_UNKNOWN, + "X-Warning: real return path is unkown\n")); } } @@ -342,23 +345,19 @@ msg->hdr_list = g_list_append(msg->hdr_list, msg->full_sender_name ? - create_header(HEAD_FROM, - "From: \"%s\" <%s@%s>\n", - msg->full_sender_name, - msg->return_path->local_part, - msg->return_path-> - domain) + create_header(HEAD_FROM, "From: \"%s\" <%s@%s>\n", msg->full_sender_name, + msg->return_path->local_part, msg->return_path->domain) : create_header(HEAD_FROM, "From: <%s@%s>\n", - msg->return_path->local_part, - msg->return_path->domain) + msg->return_path->local_part, msg->return_path->domain) ); } if ((flags & ACC_HEAD_FROM_RCPT) && !has_rcpt) { GList *node; DEBUG(3) debugf("adding 'To' header(s)\n"); for (node = g_list_first(msg->rcpt_list); node; node = g_list_next(node)) { - msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_TO, "To: %s\n", addr_string(msg-> return_path))); + msg->hdr_list = g_list_append(msg->hdr_list, + create_header(HEAD_TO, "To: %s\n", addr_string(msg-> return_path))); } } if ((flags & ACC_DEL_BCC) && !has_to_or_cc) { @@ -372,7 +371,8 @@ } if (!has_id) { DEBUG(3) debugf("adding 'Message-ID:' header\n"); - msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_MESSAGE_ID, "Message-ID: <%s@%s>\n", msg->uid, conf.host_name)); + msg->hdr_list = g_list_append(msg->hdr_list, + create_header(HEAD_MESSAGE_ID, "Message-ID: <%s@%s>\n", msg->uid, conf.host_name)); } } @@ -390,40 +390,20 @@ } if (msg->received_host == NULL) { - 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, - msg->uid, for_string ? for_string : "", - rec_timestamp()); + 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, msg->uid, for_string ? for_string : "", rec_timestamp()); } else { #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", - msg->received_host, - msg->ident ? msg->ident : "unknown", - conf.host_name, - prot_names[msg->received_prot], - PACKAGE, VERSION, - msg->uid, for_string ? for_string : "", + hdr = create_header(HEAD_RECEIVED, "Received: from %s (ident=%s) by %s with %s (%s %s) id %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", - msg->received_host, - conf.host_name, - prot_names[msg->received_prot], - PACKAGE, VERSION, - msg->uid, for_string ? for_string : "", - rec_timestamp()); + hdr = create_header(HEAD_RECEIVED, "Received: from %s by %s with %s (%s %s) id %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); @@ -435,8 +415,8 @@ /* write message to spool: */ /* accept is no longer responsible for this - if(!spool_write(msg, TRUE)) - return AERR_NOSPOOL; + if (!spool_write(msg, TRUE)) + return AERR_NOSPOOL; */ return AERR_OK; } diff -r 9fb7ddbaf129 -r 49dab67fe461 src/address.c --- a/src/address.c Wed Oct 29 16:34:13 2008 +0100 +++ b/src/address.c Wed Oct 29 21:10:18 2008 +0100 @@ -43,8 +43,7 @@ return addr; } -/* nothing special about pipes here, - but its only called for that purpose */ +/* nothing special about pipes here, but its only called for that purpose */ address* create_address_pipe(gchar * path) { @@ -103,9 +102,8 @@ gboolean addr_isequal(address * addr1, address * addr2) { - return - (strcmp(addr1->local_part, addr2->local_part) == 0) && - (strcasecmp(addr1->domain, addr2->domain) == 0); + return (strcmp(addr1->local_part, addr2->local_part) == 0) + && (strcasecmp(addr1->domain, addr2->domain) == 0); } /* searches in ancestors of addr1 */ diff -r 9fb7ddbaf129 -r 49dab67fe461 src/conf.c --- a/src/conf.c Wed Oct 29 16:34:13 2008 +0100 +++ b/src/conf.c Wed Oct 29 21:10:18 2008 +0100 @@ -16,11 +16,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include +#include + #include "masqmail.h" -#include "pwd.h" -#include "grp.h" - masqmail_conf conf; void @@ -107,9 +107,7 @@ return list; } -/* given a semicolon separated string, this function - makes a GList out of it. -*/ +/* given a semicolon separated string, this function makes a GList out of it. */ GList* parse_list(gchar * line, gboolean read_file) { @@ -354,8 +352,7 @@ c = fgetc(in); if (c != '\"') { - while ((isalnum(c) || c == '_' || c == '-' || c == '.' || c == '/' - || c == '@' || c == ';') + while ((isalnum(c) || c == '_' || c == '-' || c == '.' || c == '/' || c == '@' || c == ';') && (ptr < buf + size - 1) && (c != EOF)) { *ptr = c; @@ -368,7 +365,7 @@ gboolean escape = FALSE; c = fgetc(in); while (((c != '\"') || escape) && (ptr < buf + size - 1)) { - if (c != '\n') { /* ignore line breaks */ + if (c != '\n') { /* ignore line breaks */ if ((c == '\\') && (!escape)) { escape = TRUE; } else { @@ -410,8 +407,7 @@ return TRUE; } } else { - fprintf(stderr, "'=' expected after %s, char was '%c'\n", lval, - c); + fprintf(stderr, "'=' expected after %s, char was '%c'\n", lval, c); } } return FALSE;