Skip to content

Commit a377fb9

Browse files
committed
exmdb_local: avoid moving partially-completed delivered mails to cache/ directory
When a file is put in /var/lib/gromox/queue/cache, re-delivery will be attempted. In case of partial_completion, that is a bad decision though. Return a different error code from the innards of exmdb_local so the file ends up in /var/lib/gromox/queue/save instead. References: DESK-1353
1 parent d399cc2 commit a377fb9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

data/local_bounce/ascii/BOUNCE_OPERATION_ERROR

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Content-Type: text/plain; charset=utf-8
22
Subject: Delivery failure, mail system error!
33

44
Hi,
5-
I am sorry to tell you that some error occurs in our mail system,
5+
I am sorry to tell you that some error occurred in our mail system,
66
your message to "%(rcpt)" cannot be delivered, please contact our mail
77
system administrator to settle this problem.
88

mda/exmdb_local/exmdb_local.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,7 @@ int exmdb_local_deliverquota(MESSAGE_CONTEXT *pcontext, const char *address) try
390390
return DELIVERY_OPERATION_ERROR;
391391

392392
auto dm_status = static_cast<deliver_message_result>(r32);
393-
if (dm_status == deliver_message_result::result_ok /*||
394-
dm_status == deliver_message_result::partial_completion */) {
393+
if (dm_status == deliver_message_result::result_ok) {
395394
/* XXX: still need to make partial_ok behavior configurable */
396395
auto num = pmsg->proplist.get<const uint32_t>(PR_AUTO_RESPONSE_SUPPRESS);
397396
if (num != nullptr)
@@ -415,6 +414,10 @@ int exmdb_local_deliverquota(MESSAGE_CONTEXT *pcontext, const char *address) try
415414
!(suppress_mask & AUTO_RESPONSE_SUPPRESS_OOF))
416415
auto_response_reply(home_dir, address, pcontext->ctrl.from);
417416
break;
417+
case deliver_message_result::partial_completion:
418+
exmdb_local_log_info(pcontext->ctrl, address, LV_ERR,
419+
"server could not store message in full to %s", home_dir);
420+
return DELIVERY_OPERATION_ERROR;
418421
case deliver_message_result::result_error:
419422
exmdb_local_log_info(pcontext->ctrl, address, LV_ERR,
420423
"error result returned when delivering "

0 commit comments

Comments
 (0)