commit e2b7ebaa1ae0019f513c6c0c3a0e515ed0fe747c
parent 34bfb629fcce5df9ad86994fff51f60ee7c0b5c7
Author: Colin Leroy <colin@colino.net>
Date: Thu, 11 Oct 2018 16:06:39 +0200
Make the "Saving sent message..." debug prints more interesting.
Diffstat:
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/src/procmsg.c b/src/procmsg.c
@@ -1132,13 +1132,19 @@ gint procmsg_save_to_outbox(FolderItem *outbox, const gchar *file,
gint num;
MsgInfo *msginfo, *tmp_msginfo;
MsgFlags flag = {0, 0};
+ gchar *outbox_path = NULL;
- debug_print("saving sent message...\n");
-
- if (!outbox)
+ if (!outbox) {
+ debug_print("using default outbox\n");
outbox = folder_get_default_outbox();
+ }
+
cm_return_val_if_fail(outbox != NULL, -1);
+ outbox_path = folder_item_get_path(outbox);
+ debug_print("saving sent message to %s...\n", outbox_path);
+ g_free(outbox_path);
+
/* remove queueing headers */
if (is_queued) {
gchar tmp[MAXPATHLEN + 1];
@@ -1740,13 +1746,21 @@ send_mail:
/* save message to outbox */
if (mailval == 0 && newsval == 0 && savecopyfolder) {
- debug_print("saving sent message...\n");
+ debug_print("saving sent message to %s...\n", savecopyfolder);
if (!encrypt || !mailac->save_encrypted_as_clear_text) {
outbox = folder_find_item_from_identifier(savecopyfolder);
- if (!outbox)
+ if (!outbox) {
+ gchar *id;
outbox = folder_get_default_outbox();
-
+ if (outbox != NULL) {
+ id = folder_item_get_identifier(outbox);
+ debug_print("%s not found, using %s\n", savecopyfolder, id);
+ g_free(id);
+ } else {
+ debug_print("could not find outbox\n");
+ }
+ }
/* Mail was not saved to outbox before encrypting, save it now. */
gboolean saved = FALSE;
*queued_removed = FALSE;