From a23ff3b4ab81658d0c8107ab01a518e6ca06bd6e Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sun, 23 Oct 2016 18:15:26 +0100 Subject: [PATCH] tidying --- src/src/daemon.c | 2 +- src/src/deliver.c | 4 ++-- src/src/ip.c | 2 +- src/src/smtp_in.c | 28 +++++++++++++++------------- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/src/daemon.c b/src/src/daemon.c index 3ace7e9db..35e61dbfd 100644 --- a/src/src/daemon.c +++ b/src/src/daemon.c @@ -1460,7 +1460,7 @@ if (daemon_listen && !inetd_wait_mode) #ifdef TCP_FASTOPEN if (setsockopt(listen_sockets[sk], IPPROTO_TCP, TCP_FASTOPEN, &smtp_connect_backlog, sizeof(smtp_connect_backlog))) - DEBUG(D_any) debug_printf("setsockopt FASTOPEN: %s", strerror(errno)); + DEBUG(D_any) debug_printf("setsockopt FASTOPEN: %s\n", strerror(errno)); #endif /* Start listening on the bound socket, establishing the maximum backlog of diff --git a/src/src/deliver.c b/src/src/deliver.c index f596cb684..9fe74df7c 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -2360,7 +2360,7 @@ if ((pid = fork()) == 0) ) ) ) - log_write(0, LOG_MAIN|LOG_PANIC, "Failed writing transport results to pipe: %s\n", + log_write(0, LOG_MAIN|LOG_PANIC, "Failed writing transport results to pipe: %s", ret == -1 ? strerror(errno) : "short write"); /* Now any messages */ @@ -2371,7 +2371,7 @@ if ((pid = fork()) == 0) if( (ret = write(pfd[pipe_write], &message_length, sizeof(int))) != sizeof(int) || message_length > 0 && (ret = write(pfd[pipe_write], s, message_length)) != message_length ) - log_write(0, LOG_MAIN|LOG_PANIC, "Failed writing transport results to pipe: %s\n", + log_write(0, LOG_MAIN|LOG_PANIC, "Failed writing transport results to pipe: %s", ret == -1 ? strerror(errno) : "short write"); } } diff --git a/src/src/ip.c b/src/src/ip.c index ee70cf469..c275b1f00 100644 --- a/src/src/ip.c +++ b/src/src/ip.c @@ -240,7 +240,7 @@ if (fastopen) ) { DEBUG(D_transport) - debug_printf("Tried TCP Fast Open but apparently not enabled by sysctl"); + debug_printf("Tried TCP Fast Open but apparently not enabled by sysctl\n"); rc = connect(sock, s_ptr, s_len); } } diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index f12799279..d7080168a 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -4653,20 +4653,22 @@ while (done <= 0) there may be a delay in this, re-check for a synchronization error afterwards, unless pipelining was advertised. */ - if (recipients_discarded) rc = DISCARD; else - { - rc = acl_check(ACL_WHERE_RCPT, recipient, acl_smtp_rcpt, &user_msg, - &log_msg); - if (rc == OK && !pipelining_advertised && !check_sync()) + if (recipients_discarded) + rc = DISCARD; + else + if ( (rc = acl_check(ACL_WHERE_RCPT, recipient, acl_smtp_rcpt, &user_msg, + &log_msg)) == OK + && !pipelining_advertised && !check_sync()) goto SYNC_FAILURE; - } /* The ACL was happy */ if (rc == OK) { - if (user_msg == NULL) smtp_printf("250 Accepted\r\n"); - else smtp_user_msg(US"250", user_msg); + if (user_msg) + smtp_user_msg(US"250", user_msg); + else + smtp_printf("250 Accepted\r\n"); receive_add_recipient(recipient, -1); /* Set the dsn flags in the recipients_list */ @@ -4682,8 +4684,10 @@ while (done <= 0) else if (rc == DISCARD) { - if (user_msg == NULL) smtp_printf("250 Accepted\r\n"); - else smtp_user_msg(US"250", user_msg); + if (user_msg) + smtp_user_msg(US"250", user_msg); + else + smtp_printf("250 Accepted\r\n"); rcpt_fail_count++; discarded = TRUE; log_write(0, LOG_MAIN|LOG_REJECT, "%s F=<%s> RCPT %s: " @@ -4797,9 +4801,7 @@ while (done <= 0) } if (chunking_state > CHUNKING_OFFERED) - { /* No predata ACL or go-ahead output for BDAT */ - rc = OK; - } + rc = OK; /* No predata ACL or go-ahead output for BDAT */ else { /* If there is an ACL, re-check the synchronization afterwards, since the -- 2.25.1