Solved

Setting up e-mail

Posted on 2002-06-22
1
223 Views
Last Modified: 2010-04-21
Hi!

I have three domains on a dedicated server running FreeBSD. Now I want to setup an e-mail server for these three domains and be able to setup accounts for each of them. I want to access it by POP3.

I'm not an expert, so I need the easiest server availible. It is very important that it is easy to configure.

Any suggestions?

/David
0
Comment
Question by:svanlund
1 Comment
 
LVL 40

Accepted Solution

by:
jlevie earned 500 total points
Comment Utility
With the provision that the email user names must be unique across the server (the email addresses for the virtual domains don't have to be unique), you've probably got everything that you need  readily avaliable. I don't know if you installed the Univ of Washington IMAP server when FREBSD was installed, but you can easily add it from the ports collection. That will handle IMAP or POP access to the inboxes and FreeBSD already has sendmail installed.

With an IMAP/POP server installed the next thing you need to do is to create a FreeBSD account for each email user. Those users don't need shell access to you system (and probably shouldn't have that). Setting the user shell to /bin/false will prevent them from actually logging into the system.

You need to be sure that the DNS records for each of your domains contains an MX record that points to your server. Assuming that its hostname was myserver.somedom.tld the MX record for each virtual domain that you host would look something like

       IN MX 10  myserver.somedom.tld

Next you'll need to configure sendmail to handle mail for each of your virtual domains. For the purpose of illustration I'll assume that those domains are virt1.tld, virt2.tld, virt3.tld. Sendmail needs to be told that it handles email for those domains by editing /etc/mail/local-host-names to contain:

virt1.tld
virt2.tld
virt3.tld

Each time the local-host-names file is changed sendmail must be restarted, typically something like:

killall sendmail
/usr/sbin/sendmail -bd -q1h

The incoming mail will be distributed to user's inboxes by the contents of /etc/mail/virtusertable, which might contain something like:

postmaster@virt1.tld    root
webmaster@virt1.tld     webguru
sales@virt1.tld         billy-mac
info@virt1.tld          billie-sue
@virt1.tld              virt1-owner
postmaster@virt2.tld    root
webmaster@virt2.tld     webguru
sales@virt2.tld         suzie
info@virt2.tld          william
@virt2.tld              virt2-owner
postmaster@virt3.tld    root
webmaster@virt3.tld     webguru
sales@virt3.tld         tony
info@virt3.tld          meridith
@virt3.tld              virt3-owner

Each of those virtual domains contains a catchall entry (@virt?.tld) the redirects mail not matched by another rule to the virt?-owner. The virtusertable needs to be turned into a map file each time it is changed with:

makemap hash /etc/mail/virtusertable </etc/mail/virtusertable

There are several other things you can do with virtusertable and you can read about them and virtual hosting in general at http://www.sendmail.org/virtual-hosting.html

With all of that set up the users (billy-mac, billie-sue, etc) should be able to use POP (or IMAP) to connect to your server (myserver.somedom.tld in this example) and retrieve mail.

The bigger problem is in letting your email users send mail back through your mail server. There's no problem  if the mail is to an address on your server, but if the address is some Internet host you'll run afoul of the anti-spam provisions (which will prevent relaying). How to solve that problem depends on whether the email users have fixed IP's or random, changeable, IP's. In the former case you can use statements like:

1.2.3.4    RELAY
2.3.4.5    RELAY

in /etc/mail/access (and make a new access map) to allow those users to relay through your server. In the later case the best solution is to build Cyrus-SASL and a new copy of sendmail that includes SASL support. Then the users can authenticate to the SMTP server which will allow those user to relay mail. There's a good discussion of this at http://www.sendmail.org/~ca/email/auth.html




0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now