Opened 8 years ago

Closed 8 years ago

#7509 closed bug (fixed)

Outgoing mail ignores path setting

Reported by: humdinger Owned by: axeld
Priority: normal Milestone: R1
Component: Kits/Mail Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

This is hrev41406.

I just noticed that all outgoing mail is saved to ~/mail/out instead of the folder specified in the E-Mail prefs. Incoming mail does respect the setting, however. This is using pop3/smtp.

Since the mails apparently started to land in that folder since March 12th, it should be around this timeline, I guess.

Change History (11)

comment:1 by czeidler, 8 years ago

just tried with a fresh build in a virtual machine and it worked as expected... Any more details? exact dir... smtp should be the same for pop3 and imap.

comment:2 by humdinger, 8 years ago

Sorry for taking so long... I just installed a fresh a3-rc-hrev41789 image onto a test partition. Created a pop3/smtp account (googlemail) and set the folders to my usual data partition, i.e.
inbox: /HiQ-Data/mail/googlemail/in/
outbox: /HiQ-Data/mail/googlemail/out/

Same problem as with my working installation (hrev41406): outgoing mails are still saved in ~/mail/out/ of the boot partition. pop3-fetched mail is sorted correctly in the other partition's folder. Any more info I could provide?

comment:3 by taos, 8 years ago

I've never actually changed the default path of my outgoing mails so they're first stored in ~/mail/out and then - as soon as they're sent and their MAIL:status is changed to "sent" - moved to ~/mail/sent.

For testing, I changed my outgoing folder temporarily to ~/mail/sent2. Outgoing mails are now saved to ~/mail/out and then moved to ~/mail/sent2. So, this seems to work fine. Maybe, there is only a problem with destination folders on another partition?

If the path for outgoing mails is changed to another partition, are the mail files also moved to ~/mail/sent or do they just stay in ~/mail/out when their MAIL:status attribute is changed?

in reply to:  3 comment:4 by taos, 8 years ago

Replying to taos:

Maybe, there is only a problem with destination folders on another partition?

Seems I've just answered my own question: I tested again with outgoing folder set to /SVN/mail/sent2 (my SD card formatted with BFS is mounted at /SVN). The directory is created, the MAIL:status attribute is changed from pending to sent, but the mail file is not moved. Strange.

comment:5 by axeld, 8 years ago

Not strange, just a bug in the implementation; moving files does not work across multiple devices unless you handle this specifically, which Clemens obviously missed.

The question is just: why go through the hassle as all? What's the point in storing the mail in one place at first, only to move it to somewhere else afterwards? The outgoing mail is found by a query anyway. If that's some special implementation for IMAP, I would think it should be solved for IMAP, without clobbering POP3 at all.

comment:6 by taos, 8 years ago

That explains why this problem was introduced with the restructuring of mail_daemon: with the old implementation, the mails were stored in ~/mail/out and stayed there, so no moving involved. BTW, would copy and delete instead of move work across multiple partitions?

comment:7 by czeidler, 8 years ago

SMTP is independent from IMAP. Mail stores the mail first in the out folder and after it is sent MDR could move it anywhere.

Why BEntry's MoveTo does not take care to move it to another device? I don't want to to that! *bitching* ;) Is there any helper class? Any tricks? How to do it?

comment:8 by axeld, 8 years ago

BEntry::MoveTo() should not take care about that case, as it's too complex (and might take a long time) for that kind of low level API. A helper function would be nice, of course, though, but AFAIK there is no such thing, at least not in a private shared API yet. It's not that hard to write, though, but surely quite annoying (as you'll have to copy the attributes as well). You could have a look at the copyattr implementation, though.

Also, why moving it at all? I don't see any reason to have two different folders for that, anyway. Putting the mail right in the final folder seems to make much more sense, and would completely work around the issue.

comment:9 by axeld, 8 years ago

Owner: changed from czeidler to axeld
Status: newin-progress

Due to lack of feedback, I'm just going to remove the distinction between the "out" and the "sent" folder again -- it just doesn't make any sense to have an extra directory for pending mails, and we even find those mails via a query. And if there is a single directory, it doesn't make sense to call it "sent" either, as it will also contain the pending mails.

comment:10 by czeidler, 8 years ago

Cool thanks, the main reason for two directories was to actually see if mails have been successfully sent. User might not look at the status flag and then wondering if the mail is still pending or sent. Maybe this can be done using icons, one icon for pending and one for sent mails...

comment:11 by axeld, 8 years ago

Component: Preferences/MailKits/Mail Kit
Resolution: fixed
Status: in-progressclosed

Fixed in hrev42260.

While I wouldn't mind a special icon, why not simply use a query to show the pending mails if you want to?

Note: See TracTickets for help on using tickets.