getmail's "delete_after" does not delete msgs from Yahoo server
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
getmail (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Getmail is expected to delete messages older than 90 days under this configuration:
---8<--
[options]
verbose = 0
message_log = ~/logs/getmail.log
message_log_verbose = true
delete_after = 90
max_messages_
[retriever]
type=SimplePOP3
server=
port=995
<email address hidden>
password=yadayada
[destination]
type = Mboxrd
path = ~/mail/yahoo.mbox
---8<--
It fetched the first ten msgs from a box containing 10s of thousands of msgs, dating back 7 years ago. The resulting mbox file contained 9 messages dated 2013-2014, and 1 message with no "Date:" field. Then getmail was called again. The same 10 messages were fetched again and were also delivered to ~/mail/yahoo.mbox, so the mbox file contained 10 duplicates. The log file also indicates that the same 10 messages were fetched and the msg id's each appeared twice.
I don't know if getmail supports UIDL and whether it attempts to avoid fetching dupes, but certainly at least 9 of the messages should have been deleted from the server on the 1st session, and thus should not have even been available from the server thereafter.
Some badly acting POP3 servers will ignore delete requests because they want users to see ads on their web UI. So in order to rule out that possibility fetchmail was run with this config:
---8<--
skip yahoo via pop.mail.yahoo.com
protocol pop3
port 995
uidl
username <email address hidden>
password yadayada
fetchlimit 10
fetchall
ssl
---8<--
Fetchmail has no "delete_after" capability, but its default behavior is to delete every msg fetched from the server. And it did. Fetchmail grabbed the same 10 msgs that getmail fetched since they were still on the server after 2 getmail retrievals, then fetchmail deleted them from the server unconditionally. Then getmail was run for a 3rd time, and this time it fetched a different 10 messages, thus proving that fetchmail was able to delete the messages.
I hope it doesn't bother anyone that this is reported here despite the bug not being tested on Ubuntu. There is no upstream bug tracker and since it's not a security bug I prefer having the bug tracked and open to public feedback.
I tried the same test with:
delete_dup_msgids = true POP3SSLRetrieve r delete= ~/mail/ yahoo_deleted. mbox
type=BrokenUIDL
move_on_
and then with IMAP:
type=SimpleIMAP SSLRetriever
and it made no difference. In both cases it still failed to send a DELE command to the server. It fetches the same msgs every time, without deleting them, and also creates copies in the destation mbox. I realize that POP + UIDL, POP w/out UIDL, and IMAP will each result in different IDs for the same message. But I ran the IMAP retrieval twice, thus ensuring that getmail would have a chance to match the ID of msgs already retrieved. Dupes were still created, and the move_on_delete folder remains empty.