# Fetch mail from provider and local IMAP server



## honk (Mar 19, 2010)

Hi guys,

I've a couple of freemail accounts for different purposes. I looking for a solution where all my mails will be stored and archived on one of my servers. I'm thinking about a setup where my server fetches (fetchmail?) the mail from the different provider with pop3 or imap periodically and store them on my server. Then I want to have the possibility to have my own imap-server (dovecot) where I could connect my mail client to. Maybe I also want to have a webfrontend later to connect to my mailboxes from everywhere (squirrelmail?). I also want to have the possibility to define automatic rules on the server (not in the MUA) to move mails to particular folders or to filter out spam.

Guys, what should I use? All deamons should run in jails. The storage for the mails should be on a nfs-share or a database (postgres). I don't like the idea to have the mails stored in ascii files like /var/mail/username.

Suggestions?

cheers,
honk


----------



## graudeejs (Mar 19, 2010)

postfix, dovecot, sieve, probably fetchmail, squirellmail or roundcube + nginx (easy to setup)
I think it's best to use pop to fetch mail from remote servers (if you want to access mail only on your server)

Why don't you want to store mails as files What's wrong with that?


----------



## honk (Mar 19, 2010)

killasmurf86 said:
			
		

> Why don't you want to store mails as files What's wrong with that?



I've to admit that I don't really know, how the mail stuff is implemented on FreeBSD. I just see the flat ascii-files in /var/mail for each user. I don't expect good performance if the mail file grows to gigabytes. Think about searching through the archive to find a particular mail. I also have currently no idea how these files would look like if I want to organize my mails with my mail program into different folders. How are attachments handled? It seems that I have to learn a lot of new things. That's why I'm asking for other users experiences.


----------



## jb_fvwm2 (Mar 20, 2010)

You could make a Maildir

```
mkdir -p /usr/home/[your_name]/Mail/default/new
.........................................../cur
.........................................../tmp
```
a fetchmailrc, or some such,
fetchmail, (the port /fetchmail/
ripmime, (the port /ripmime)
maildir (from the port safecat),
then use fetchmail and maildir to put new mails in 
the /new folder, read them in ascii, and
extract attachments (if any) with ripmime.
More time to setup maybe, mutt doing something similar,
emacs or a gui in /usr/ports/mail/* ...


----------

