# Guide to imap + pop3 + smtp ?

## CMitchell

Is there a guide on getting a smtp server, pop3 server and an imap server set up on Gentoo? It would need to receive mail for a domain and serve it up either over imap or pop3.

either imap or pop3 is optional if both is a problem.

Thanks!

----------

## klieber

Not that I'm aware of.  However, it shouldn't be much different than setting up the required programs on any other distro.  You'll want to make sure you have the appropriate USE variables defined.  I don't think there's one for POP3 or SMTP, but there are ones for IMAP and MBOX||MAILDIR.

Additionally, there have been some discussions on getting mail-related programs set up in the forum archives.  You might check there to see what other folks have already tried/done.

Finally, if you do go ahead with setting all this up, I'm sure the rest of us would appreciate if you could put together some instructions for the Documentation forum.

--kurt

----------

## pintnight

I think that would be great!  I want to setup my own POP3 and IMAP server for home.  I already have a SMTP server running.  Just don't have to time to really sit down for several hours trying to put everything together.

----------

## CMitchell

 *pintnight wrote:*   

> I think that would be great!  I want to setup my own POP3 and IMAP server for home.  I already have a SMTP server running.  Just don't have to time to really sit down for several hours trying to put everything together.

 

hehe how did I come here asking for help and all of sudden get tasked with doing it myself and writing a guide?  :Smile: 

----------

## klieber

 *CMitchell wrote:*   

> hehe how did I come here asking for help and all of sudden get tasked with doing it myself and writing a guide? 

 

Most of the information is out there already -- it just needs to be "Gentoo-ized" and packaged nicely into an easy to read HOWTO guide. 

--kurt

----------

## CMitchell

 *klieber wrote:*   

>  *CMitchell wrote:*   hehe how did I come here asking for help and all of sudden get tasked with doing it myself and writing a guide?  
> 
> Most of the information is out there already -- it just needs to be "Gentoo-ized" and packaged nicely into an easy to read HOWTO guide. 
> 
> --kurt

 

obviously  :Smile: 

i was just hoping somebody else did it.

ok how bout this: 

what applications would be recommended to do this with? QMail? Courier? Exim?

----------

## Hellfire

Once the ebuild was repaired qmail setup -very- easily. It's a bit kludgy, but it's very functional and I've bent it to my will with reasonable success.

Emerge qmail and qmail-pop3d and you'll have a fully functional mail system with pop support out of the box. Haven't looked into the imap piping yet but I'm sure it would work similarly.

Mailman on the other hand is something I could *really* use a guide for :)

-h

----------

## Guest

 *CMitchell wrote:*   

> 
> 
> obviously 
> 
> i was just hoping somebody else did it.
> ...

 

I'm currently using Exim as my SMTP.  I have looked at QMail, but not all that familiar with it.

----------

## klieber

 *CMitchell wrote:*   

> what applications would be recommended to do this with? QMail? Courier? Exim?

 

A lot will depend on what people are already familiar with and whether you want to use mbox or maildir format.  For instance, most folks coming from a Debian world (like me) will tell you Exim, because that's what Debian uses by default.  Personally, I really like Exim -- it's powerful, yet still easy to set up.  I've heard horror stories about qmail being very difficult to set up, but it's also one of the most secure mail programs out there.  Plenty of other folks like Postfix.  Sendmail doesn't seem to have too many fans, though it has a huge installed base...

For IMAP, courier and UW appear to be the two most widely-used IMAP servers, with courier taking the slight edge in popularity.  However, courier is designed for maildir format -- not mbox.  (not sure if it can be configured to work with mbox, though)

For POP3, qpopper tends to be the most popular, but there doesn't appear to be an ebuild for it.  qmail-pop3d might be a good choice if you're using qmail. Otherwise, check out teapop, which seems to be the only other pop3 server currently in gentoo.

--kurt

----------

## arkane

 *Hellfire wrote:*   

> Once the ebuild was repaired qmail setup -very- easily. It's a bit kludgy, but it's very functional and I've bent it to my will with reasonable success.
> 
> Emerge qmail and qmail-pop3d and you'll have a fully functional mail system with pop support out of the box. Haven't looked into the imap piping yet but I'm sure it would work similarly.
> 
> Mailman on the other hand is something I could *really* use a guide for 
> ...

 

I personally like postfix, and a generic and quite usable pop3 server is included in uw-imap along with an imap server.

----------

## alec

http://gentoo.org/doc/en/desktop.xml#doc_chap7 has a somewhat out of date postfix + courier-imap + squirrelmail.

Postfix is sooooo easy to install... not much configging to do.

----------

## Hellfire

I'm by no means sold on qmail, my requirements for the project were simply "does it run" and "it's not sendmail"...

In my application I want to be able to store/route mail for a few domains to internal hosts and support pop3/imap access out for a different set of hosts. Qmail's done that very easily, however the only remaining "feature" of a mailing system I want is easy to use list-serving. From what I've seen/used Mailman's becoming the defacto package, but qmail+mailman != fun.

Any brief suggestions without hijacking this thread too much?

-h

----------

## leaf

 *Hellfire wrote:*   

> I'm by no means sold on qmail, my requirements for the project were simply "does it run" and "it's not sendmail"...
> 
> In my application I want to be able to store/route mail for a few domains to internal hosts and support pop3/imap access out for a different set of hosts. Qmail's done that very easily, however the only remaining "feature" of a mailing system I want is easy to use list-serving. From what I've seen/used Mailman's becoming the defacto package, but qmail+mailman != fun.
> 
> Any brief suggestions without hijacking this thread too much?
> ...

 

Have you considered ezmlm, it works well with qmail.

I would also just like to add that installing qmail on gentoo was very easy (considering I'd never set up a mail server on linux before) the ebuild author is to be congratulated. If you do install it make sure you read any messages from the ebuild as there are useful hints and extra steps that are mentioned.

----------

## rottie

i would gladly make a tutorial for this setup if i could get qpopper working...

lol

----------

## meyerm

Well, if you need list support look at ezmlm-idx. You can find it at www.ezmlm.org. It is designed for qmail and as powerful as qmail itself. As IMAP we are using Courier.

qmail is, well, different. But it's very powerful and secure. We are using an old sparc 10 as mailserver for the students representation at our university and believe me, there _are_ maaany mails.  OK, to be honest, we _really_ need to switch to another computer (already bought, Duron 700), but it's quite impressive how much work such an old computer can still manage with the right software  :Very Happy: 

It's very easy to configure and even more to mantain. I can only recommend it. But it's just my own opinion. 

Bye

 Marcel

----------

## Ferdy

Now I'm using : Postfix + Courier-IMAP + Courier-POP3 + Maildir and it works so fine !!

Here are the steps:

First, emerge the packages:

```

[bash]# emerge postfix courier-imap

```

Then edit the postfix main.cf which is in /home/postfix/main.cf and add the line:

```

home_mailbox = Maildir/

```

Check de / (slash) because it's _very_ important

Now configure the authdaemon and the IMAP and POP3 daemons:

First edit the file /etc/courier-imap/authdaemonrc, and set the variable version to authdaemond.plain. Like this:

```

version="authdaemond.plain"

```

Now you have to edit the files /etc/courier-imap-imapd and /etc/courier-imap/pop3d and spedify this daemons to get the mail from the Maildir/:

```

MAILDIR=Maildir/

```

In both files, and

```

POP3DSTART=YES

```

In te pop3d and

```

IMAPDSTART=YES

```

In the other file.

Now add the daemons to runlevel default, and bring them up:

```

[bash]# rc-update add postfix default

[bash]# rc-update add authdaemond default

[bash]# rc-update add courier-imapd default

[bash]# rc-update add courier-pop3d default

[bash]# /etc/init.d/postfix start

[bash]# /etc/init.d/authdaemond start

[bash]# /etc/init.d/courier-imapd start

[bash]# /etc/init.d/courier-pop3d start

```

Well, it's not very good guide, but HTH.

IMHO now the best thing you can do is installing Apache, mod_ssl and PHP to get Squirrelmail working and allow your users to use their mail throught IMAP, POP3 or Web

----------

## bidz

great guide, thanks - but one question - can this system handle polling mail from lets say 3-5 different pop3 accounts and put it in the proper maildir's/etc, so that the mail is stored locally till i actually launch a email client to read my mail ?

----------

## Ferdy

Well, i did'nt understand your question very well, but if which i understood is  right, you now need fetchmail to retrieve the mail from this accounts and store it in the Maildir's ot the server so you will be able to read with your email client.

HTH

----------

## glawe

ive been following both the desktopguide gentoo is providing for setting up squirellmail with imap and the ones in here, now i have postfix, courier-imapd and squirrelmail installed, but when i try to login into squirell im getting this error:

Please contact your system administrator and report the following error:

Fatal error: .maildir: No such file or directory 

im pretty sure i have set all the config files to point at .maildir .. but i seem to have missed something, any idea anyone ??

/Glawe

----------

## fifthcent

Did you test the postfix configurations using mutt, like it explains in the guide? When you do, it should see that you don't have a .maildir, and ask you prompt you if you want mutt to create it for you.

----------

## Ferdy

Uhm..... the Maildir/ directory is created only when the first mail arrives to the account (for the first time), try to send an email, and then check it.

HTH

----------

