Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Setting up e-mail

Posted on 2002-06-22
1
Medium Priority
?
275 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 40

Accepted Solution

by:
jlevie earned 2000 total points
ID: 7101159
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

610 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