# Help making the right choices and setting up a mailserver

## tdm

I've the following dilema, I've to create a mailserver for a small company (about 25 people, max 50) and it should be easy managable.

It needs to be able to do the following:

- easy managable

- support auto-respons messages (per user) and/or vacation messages (also per user)

- support forwarding to other emailadresses (per user, if possible multiple forwards per user)

- most important: it needs to get it's mail from one (1) POP3 account and split it up to the different users belonging to the different emailaddresses in IMAP format.

- then, all the users should be able to login their own little webmail and check/send their mail all over the world (I prefer SquirrelMail).

- And it would be most awsome if they could all create their own little address book, and at the same time have one address book with all the bussiness relations of the company (so, two address books)

I'm also busy setting up a Samba PDC for the domain, so it would be great if there's any change of getting Samba and the mailserver using the same accounts (so managing of it all get a bit nice and simple).

Anyone has any experience with this?

Which software combination should I use?

How can I set this up the RIGHT way?

Thanks!

----------

## bmichaelsen

 *Quote:*   

> - easy managable

 

postfix is well documented in gentoo-land.

 *Quote:*   

> - support auto-respons messages (per user) and/or vacation messages (also per user) 

 

Here an example for vacation massages with procmail

 *Quote:*   

> - support forwarding to other emailadresses (per user, if possible multiple forwards per user) 

 

again procmail is your friend

 *Quote:*   

> - most important: it needs to get it's mail from one (1) POP3 account and split it up to the different users belonging to the different emailaddresses in IMAP format. 

 

There is no "IMAP format" - IMAP is a network protocol. Use fetchmail to get the mail (so called multidrop mode), and courier-imap to provide IMAP.

 *Quote:*   

> - then, all the users should be able to login their own little webmail and check/send their mail all over the world (I prefer SquirrelMail). 

 

you answered that yourself - squirrelmail uses IMAP on the localhost.

 *Quote:*   

> - And it would be most awsome if they could all create their own little address book, and at the same time have one address book with all the bussiness relations of the company (so, two address books) 

 

This would be a job for openldap. Squirrelmail supports it, but i never used it ...

 *Quote:*   

> I'm also busy setting up a Samba PDC for the domain, so it would be great if there's any change of getting Samba and the mailserver using the same accounts (so managing of it all get a bit nice and simple). 

 

All these mail services use standard linux accouts for authentification by default. And there it is possible somehow to keep samba and linux passwords in sync (you gotta google on this one ...)

Take this HOWTO: Email System for the Home Network for a start, Part 2 also covers Squirrelmail and Spamassassin setup ...

----------

## bmichaelsen

also take a look at the horde project as a replacement for squirrelmail ...

----------

## bemis

also take a look at postfixadmin ( http://www.high5.net/postfixadmin/ ) -- it's not in portage i don't think, but it's not a terribly large venture outside of the well documented beaten on tried and true gentoo-forums-postfix-mysql-courier-vhosts-bells-and-whistles-here (tm) mail server.

(I have a handful of servers running variants of that, with postfixadmin, amavisd-new, spamassassin and clamav added and i've never been happier with a mail server.)

bemis

----------

## tdm

 *bemis wrote:*   

> also take a look at postfixadmin ( http://www.high5.net/postfixadmin/ ) -- it's not in portage i don't think, but it's not a terribly large venture outside of the well documented beaten on tried and true gentoo-forums-postfix-mysql-courier-vhosts-bells-and-whistles-here (tm) mail server.
> 
> (I have a handful of servers running variants of that, with postfixadmin, amavisd-new, spamassassin and clamav added and i've never been happier with a mail server.)
> 
> bemis

 

Thanks, I'll check it out. Sounds great thought  :Very Happy: 

----------

## tdm

 *bemis wrote:*   

> (I have a handful of servers running variants of that, with postfixadmin, amavisd-new, spamassassin and clamav added and i've never been happier with a mail server.)
> 
> bemis

 

bemis, I just checked-out the postfixadmin site, and I see it needs a mysql backand so I think this will not really work well with my need of using the same accounts for mail as for samba.

Or is there any change of getting postfix work for linux account and virtual account?

Or that I can connect a virtual user to a real linux account?

Any ideas on this?

Thanks

----------

## bemis

Well, there are a few ways you could go about doing that -- I'm no Samba expert -- but I doubt it'd be a huge task to (as a part of your nightly crontab) do a mysql script (select user, password, name from postfix.mailbox -- do your SQL or shell munging to give you accounts instead of e-mail addresses (which the virtual setup requires) and then parse that out through samba-useradd (or however you manage your samba users) ...  Also, Samba-3 has MySQL authentication support (nss-mysql module?) -- so if you were creative with your scripting there, you could probably make it automatic.

another option is to use something like pam_smb or pam_nt -- where the only account database you need to maintain is your samba one - the rest is all done via PAM.

another option might be to go with an LDAP backend that is independant of your MTA and samba and the system .. then you can just plug it however you want for your uses -- postfixadmin doesn't support this (to my knowlege) but the cool-factor of "single-signon", coupled with the plethora of excellent LDAP managers (check out egroupware) should more than compensate for that.

Given your needs/wants I personally would heavilly research both options, as well as the various "mail-toaster" packages out there these days.  Unfortunately my know-how is completely gone outside of sendmail and postfix - but there are several other very capable MTAs out there (courier, exim, qmail just to name a few) and they all have differing strengths and weaknesses -- I'm sorry I can't give a more complete answer.

One last thought -- while I hate to recommend webmin to people (for various personal reasons -- no substantial technical reason behind it), it might be an appropriate road for you to take.

Personally, (if only because of my comfort zone) I'd go for something like this:

http://high5.net/howto/

or

https://forums.gentoo.org/viewtopic.php?t=163861

or

http://www.gentoo.org/doc/en/virt-mail-howto.xml

and work samba in later.

bemis

----------

## tdm

bemis, thanks!

I didn't know samba supported a mysql backend, I'll check it out and I'll also take a look at the other options you gave me.

Thanks!

----------

