aboutsummaryrefslogtreecommitdiffstats
path: root/src/smtp_proto.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-06-23 16:11:05 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-06-23 16:11:05 +0400
commite2b6242ef1c90231dccfd5b2bddb4e43dc6e5eed (patch)
treec8f089198822ce14441a2041333bb5e275dae321 /src/smtp_proto.c
parentc36bf0f6a94fc1319a0ff5279ded019e2f4b9c29 (diff)
downloadrspamd-e2b6242ef1c90231dccfd5b2bddb4e43dc6e5eed.tar.gz
rspamd-e2b6242ef1c90231dccfd5b2bddb4e43dc6e5eed.zip
* Add more information about why we drop smtp connection
* Fix mkstemp call
Diffstat (limited to 'src/smtp_proto.c')
-rw-r--r--src/smtp_proto.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/smtp_proto.c b/src/smtp_proto.c
index f499efd7a..ef0190163 100644
--- a/src/smtp_proto.c
+++ b/src/smtp_proto.c
@@ -551,9 +551,9 @@ smtp_upstream_read_socket (f_str_t * in, void *arg)
return FALSE;
}
else if (r == 1) {
- r = strlen (session->cfg->temp_dir) + sizeof ("/rspamd-XXXXXX.tmp");
+ r = strlen (session->cfg->temp_dir) + sizeof ("/rspamd-XXXXXX");
session->temp_name = memory_pool_alloc (session->pool, r);
- snprintf (session->temp_name, r, "%s%crspamd-XXXXXX.tmp", session->cfg->temp_dir, G_DIR_SEPARATOR);
+ snprintf (session->temp_name, r, "%s%crspamd-XXXXXX", session->cfg->temp_dir, G_DIR_SEPARATOR);
#ifdef HAVE_MKSTEMP
/* Umask is set before */
session->temp_fd = mkstemp (session->temp_name);
@@ -561,6 +561,7 @@ smtp_upstream_read_socket (f_str_t * in, void *arg)
session->temp_fd = g_mkstemp_full (session->temp_name, O_RDWR, S_IWUSR | S_IRUSR);
#endif
if (session->temp_fd == -1) {
+ msg_err ("mkstemp error: %s", strerror (errno));
session->error = SMTP_ERROR_FILE;
session->state = SMTP_STATE_CRITICAL_ERROR;
rspamd_dispatcher_restore (session->dispatcher);