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


New Member
Jul 3, 2019

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!


The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!