Solaris Resources at Kempston
Configuring sendmail on Solaris 7 and Solaris 8 to accept incoming email
| www.kempston.net/solaris/ | www.kempston.org/solaris/ |
This page covers the configuration of sendmail on Solaris 7 and Solaris 8 to accept incoming mail from an ISP using SMTP. Very few ISPs offer an SMTP mail delivery service and most ISPs require you to collect incoming mail using POP3. If your ISP supports POP3 incoming mail only, ignore this page and refer to the notes on the compilation, installation and configuration of fetchmail to collect incoming mail from an ISP's POP3 server.
This page is aimed specifically at users of Demon Internet in the UK which does offer an SMTP mail delivery service but the general principles apply to other ISPs who provide incoming SMTP email.
Before following the instructions on this page, it's important that you have already configured sendmail for outgoing mail.
Introduction
If your ISP delivers email using SMTP, it's important to configure sendmail correctly so as to avoid bouncing mail. If sendmail doesn't know about a user name, it will reject the mail with the error message "550 User unknown" and the mail will be returned to the sender. Bouncing wanted mail can be very embarrassing, especially when it's from a mailing list, and doing so is a common mistake when connecting a unix system to the Net for the first time.
There are three techniques which ensure that all correctly addressed incoming mail is accepted by sendmail:
1. By ensuring that all user names to which mail may be addressed are defined as unix users
This method is ideal if there are several real people who use your Solaris system. It ensures that Jim's mail appears in his mailbox when he's logged in and that Sally's mail appears in her mailbox when she's logged in. If one user wishes to make use of several email user names, this technique can be combined with aliasing.
2. By ensuring that all user names used on email are defined as aliases to real unix users
This technique is useful when one person is the sole user of your Solaris system or when one of your users wishes to make use of several email user names.
3. By arranging that all email addressed to unknown user names is redirected to a defined unix user
This is a good "catch all" solution if you're unsure what email user names may be specified on incoming mail and you want to ensure that no email is bounced. This technique can be combined with the other two.
Defining unix users on Solaris
Sendmail accepts incoming email addressed to all users who have been defined as real users on the Solaris system. If there are several real people using your system or you want to keep different types of email separate from each other, it's convenient to define several real unix users.
To define a unix user, start Admintool:
# admintool &
This program provides a simple graphical interface for administering users and should display a list of defined users when it starts. If it displays some other category of resources, such as hosts or modems, just point at the Browse menu and select Users.
To define a new user, simply point at the Edit menu, select Add and fill in the following boxes in the form which is displayed:
User Name: enter the name of the new user, such as mike or sally. Spaces are not allowed in a user name.
UserID: enter a number starting at 1001 and incrementing by 1 for each new user.
Comment: enter the full name of the new user, such as John S. Doe.
Home Directory Path: enter /export/home followed by the user name. For example: /export/home/mike.
Finally, click on OK and the user has been defined. Sendmail will now accept email addressed to your new user name.
Defining email aliases on Solaris
Sendmail will accept incoming email addressed to names which are aliases for real unix users. Aliases are defined in the file /etc/aliases and the format of this file is best described by means of an example. Consider an aliases file which contains:
webmaster: mike ietf-list: jim,sally,bill
In this example, Mike, Jim, Sally and Bill are real unix users on the system. They can receive email addressed to their own user names but, in addition, sendmail will accept mail addressed to webmaster and ietf-list.
Mail addressed to webmaster will be delivered to Mike and mail addressed to ietf-list will be delivered to Jim, Sally and Bill.
Adding new users is simply a matter of editing the file /etc/aliases and adding new lines to the end of this file. Note that the aliases file supplied with Solaris 7 already aliases postmaster to root; this can be left as it is or changed so that postmaster mail is delivered to another user. When you've finished editing the file, issue the command:
# newaliases
which tells sendmail to re-read the aliases file.
Accepting email for unknown users
By default, sendmail will reject, or bounce, incoming email addressed to users who don't exist as real users or as aliases. If your ISP account allows unlimited email user names, you may wish to arrange for sendmail to accept all incoming email and redirect mail for unknown users to a particular user such as postmaster.
To do this, a few changes are needed to sendmail's configuration file. Edit /etc/mail/sendmail.cf.isp.online and look for the lines near the start of the file which read:
# "Smart" relay host (may be null) DSyour ISP's smart mail host
After this section, insert the following lines:
# place to which unknown users should be forwarded Kuser user -m -a<> # deliver mail for unknown users to postmaster locally DLlocal:postmaster
If you want to deliver mail for unknown users to some user other than postmaster, replace postmaster with the name of the user who should receive such mail. Note that the username specified here must exist as a real Solaris user or must be listed as an alias in the /etc/aliases file. By default, postmaster is an alias for the real user root.
Then look for the section headed:
########################################################################### ### Ruleset 5 -- special rewriting after aliases have been expanded ### ###########################################################################
and, a few lines further on:
# prepend an empty "forward host" on the front R$+ $: <> $1
Immediately after these two lines, insert the following:
# send unrecognized local users to a relay host R< > $+ $: < $L . > $(user $1 $) look up user R< $* > $+ <> $* $: < > $2 $3 found; strip $L R< $* . > $+ $: < $1 > $2 strip extra dot
Save the file and sendmail will now accept mail messages addressed to unknown users while online and deliver them to postmaster or to whichever username you have specified.
Has this guide been useful?
I hope these instructions prove useful. If you have any comments or suggestions for improvement, or have found any technical errors, please email me at mike@kempston.net
This page is copyright © mike@kempston.net 2000. Reproduction is forbidden without the author's permission. You are welcome to link to these pages if you wish but please point to the pages at www.kempston.net: Solaris Resources at Kempston
| Home | Free Solaris | Connecting to an ISP |
| Configuring mail | Configuring modem dialup | Configuring a PPP server |
| Installing Software | Solaris FAQs and Software | Site Index |
This page is maintained by the
Kempston Webmaster
Last updated 1 February 2000