Optional features

By now you will have a fully functional email server. There are further features that you may want to use. Pick what you need.

Fetching and filtering using fetchmail and sieve

Mathias Geat wrote an article on integrating fetchmail and sieve that fits this setup.

Removing old deleted mails

With IMAP you can mark emails as deleted and some email clients will not even show them any more. But the emails are still there and occupy space. Usually there is an option to purge all marked emails but many users do not care. So Michael Weisgerber suggests to run this command frequently via crontab to remove such emails:

$> find /var/vmail -type f -ctime +7 -name '*,ST' -print0 | xargs -r -0 rm -f

Dovecot renames all deleted emails so that they get a ,ST added at the end of the filename. Adjust the parameter to -ctime as you like. In this example deleted mails older than 7 days are purged.

Comments

I find a easy way to use

I find a easy way to use fetchmail. But i dont know how to work with variables, so i "hardcoded" my idea :-). Just install fetchmail and create /var/vmail/.fetchmailrc You have to grant vmail own and 710 rights for .fetchmailrc put these lines into: #fetchmail.rc server mail.example.com proto pop3 user username pass password keep mda "/usr/lib/dovecot/deliver -d username@example.net" For me its easier to understand. I am a linux newbie ;-)

Some more info on a fitting fetchmail setup

It would be nice to have some more up-to-date info, on what's the best way to implement fetchmail into this mailserver setup. Looks like the info from the article of Mathias Geat is not suitable for the actual Lenny setup any more.

is it possible to use getmail ?

I would like to use getmail instead of fetchmail (in my opinion its better) - can anyone tell me how i can manage this ? Is it possible with only one user (vmail).

And is it possible to add a field to the mysql DB where you can chose for every email, if it has an antispam or an antivir protection ?

Removing old deleted mails

I prefer to use the following:

find /home/vmail -type f -ctime +7 -name *,ST -print0 | xargs -0 rm -f

this will work even if user has IMAP folders containing spaces (eg. "Junk E-mail")

Thanks

You are right. print0 is pretty important. Fixed it. Thank you.