In roundcube I found the option to remove retrieved email messages. But nothing about removig it from server after x day, like email clients do. I know there is an option in dovecot to do this (Expunge), but i don't know how to use.
It seems that fetchmail doesn't support that feature, only keep or no keep:
http://www.fetchmail.info/fetchmail-FAQ.html#G5
G5. I want to make fetchmail remove kept mail after some days.
The second-most-requested feature for fetchmail, after content-based filtering, is the ability to have it remove messages from a maildrop after N days, typically to be used with the keep option. Several messaging programs with graphical user interface support this feature.
This feature is not yet implemented. It may be at a future date, spare time of developers permitting.
For the time being, the contrib/ directory contains some unsupported tools that may help, namely mold-remover.py and delete-later.
But I don't find any contrib dir on my synology nas (MailStation).