aboutsummaryrefslogtreecommitdiff
path: root/mockmta.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2021-06-17 09:59:46 +0300
committerSergey Poznyakoff <gray@gnu.org>2021-06-17 10:01:01 +0300
commitc3a3d811d674b7fac0355253a5bd4c481e687a83 (patch)
tree5cbb53c8606e898d28933cd5f34759d3fe9d9109 /mockmta.c
parentec3c578709f1a25af5fc1b3e9ee50583e1fc4b05 (diff)
downloadmockmta-c3a3d811d674b7fac0355253a5bd4c481e687a83.tar.gz
mockmta-c3a3d811d674b7fac0355253a5bd4c481e687a83.tar.bz2
Bugfixesv1.1
* mockmta.c (smtp_data): Fix uninitialized variable. Fix informational messages (success vs. failure) * configure.ac: Version 1.1
Diffstat (limited to 'mockmta.c')
-rw-r--r--mockmta.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/mockmta.c b/mockmta.c
index 342f3dc..51a3250 100644
--- a/mockmta.c
+++ b/mockmta.c
@@ -1367,7 +1367,7 @@ smtp_data (struct smtp *smtp)
FILE *fp;
ssize_t n;
time_t t;
- int res;
+ int res = 0;
int in_body = 0;
fd = mkstemp (template);
@@ -1460,18 +1460,27 @@ smtp_data (struct smtp *smtp)
pthread_cleanup_pop (1);
- if (smtp->nrcpt > 1)
- logger (LOG_INFO, "%s => %s (%d recipients) delivered",
- smtp->sender, smtp->rcpt[0], smtp->nrcpt);
- else
- logger (LOG_INFO, "%s => %s delivered",
- smtp->sender, smtp->rcpt[0]);
-
if (res)
- smtp_io_send (smtp, 451, "Local filesystem error");
+ {
+ if (smtp->nrcpt > 1)
+ logger (LOG_INFO, "%s => %s (%d recipients) failed",
+ smtp->sender, smtp->rcpt[0], smtp->nrcpt);
+ else
+ logger (LOG_INFO, "%s => %s failed",
+ smtp->sender, smtp->rcpt[0]);
+ smtp_io_send (smtp, 451, "Local filesystem error");
+ }
else
- smtp_io_send (smtp, 250, "%s Message accepted for delivery", smtp->sid);
- smtp->delivered++;
+ {
+ if (smtp->nrcpt > 1)
+ logger (LOG_INFO, "%s => %s (%d recipients) delivered",
+ smtp->sender, smtp->rcpt[0], smtp->nrcpt);
+ else
+ logger (LOG_INFO, "%s => %s delivered",
+ smtp->sender, smtp->rcpt[0]);
+ smtp_io_send (smtp, 250, "%s Message accepted for delivery", smtp->sid);
+ smtp->delivered++;
+ }
return res;
}

Return to:

Send suggestions and report system problems to the System administrator.