Commit 909d29b0 909d29b0ebf9fd083c26082232729f04e1e3f86f by Sergey Poznyakoff

Use util_getenv(). Honour outfolder variable, when set.

1 parent d45791ef
...@@ -45,24 +45,20 @@ mail_copy0 (int argc, char **argv, int mark) ...@@ -45,24 +45,20 @@ mail_copy0 (int argc, char **argv, int mark)
45 else 45 else
46 filename = strdup ("mbox"); 46 filename = strdup ("mbox");
47 47
48 if (!filename)
49 return 1;
50
51 if (msgset_parse (argc, argv, &msglist)) 48 if (msgset_parse (argc, argv, &msglist))
52 { 49 {
53 if (filename) 50 if (filename)
54 free (filename); 51 free (filename);
55 return 1; 52 return 1;
56 } 53 }
57 54
58 if (sender) 55 if (sender)
56 filename = util_outfolder_name (util_get_sender (msglist->msg_part[0], 1));
57
58 if (!filename)
59 { 59 {
60 filename = util_get_sender(msglist->msg_part[0], 1); 60 msgset_free (msglist);
61 if (!filename) 61 return 1;
62 {
63 msgset_free (msglist);
64 return 1;
65 }
66 } 62 }
67 63
68 if (mailbox_create_default (&mbx, filename) 64 if (mailbox_create_default (&mbx, filename)
......