aboutsummaryrefslogtreecommitdiffstats
path: root/src/smtp_proto.c
diff options
context:
space:
mode:
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);