Fetchmail retrieve and keep mails N days on the server (POP)

Abon

New Member
Jul 3, 2019
1
0
1
58
Hello

I've setup fetchmail to retrieve mail using pop3 for a 15 accounts and only I can do is to keep messages on server or download and remove from server.

I want to keep mail on the server for 10 days or more : so other clients using same mail connecting directly to the server will be able to see the mails during a trip...

Many thanks for your help.
 
Last edited:
basically fetchmail is not really able to delete based on the time since it first saw a mail - that would be quite cumbersome to implement and would need some kind of statefile to remember when a mail was first seen... (see `man fetchmailrc` for what fetchmail can do)

You could try to switch from pop3 to IMAP (most ISPs do have support for IMAP) and not delete the mails.
If you have a sizelimit on the boxes you could keep the mails on the server and delete them once in a while with a cronjob

I think it would be even nicer, if you just let the users access their mails after they've passed through you mail-filter - just setup a webmail on the downstream server (e.g. roundcube)

I hope this helps!