These instructions assume you get my mail from an Internet Service Provider, by using POP to download mail, and SMTP to upload it.
The version of sendmail shipped with Debian Linux is meant to be configured using the the sendmail+IDA system, which lets you build sendmail.cf by means of simple (m4-based) macro files. The macro files you need for input are in various subdirectories of /usr/src/sendmail.cf.
FEATURE(nouucp)dnl MAILER(smtp)dnl define(`ALIAS_FILE', /usr/local/etc/aliases)dnlThe first line merely says not to process any uucp mail. The second line makes smtp available for managing outgoing mail. The third line specifies the location of the alias file.
Return to the /usr/src/sendmail/cf directory and make a deb-local.cf file from your deb-local.mc file. To do this, execute:
make deb-local.cfNote that even though the file you wrote is deb-local.mc, the argument you give to the make command is deb-local.cf. (That will be the output that you're making.) That places a file called deb-local.cf in the sub-directory `obj' of the current directory. It's ready for testing.
Test the .cf file you just made. To do this, try mailing a junk file to root. Let's imagine your current directory is /usr/src/sendmail.cf/cf. Then execute this to see if you can get mail as user root:
/usr/sbin/sendmail -v -Cobj/deb-local.cf root < deb-local.mcYou should get a message that says
SentYou can check that by using the command
mail -v person < filenameHere's a test of your configuration file's ability to do address resolution correctly:
/usr/sbin/sendmail -vt -Cobj/deb-local.cfYou will get the following message:
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enterfollowed by a prompt at which you should enter rule set numbers followed by an address you'd like to see resolved:Enter <ruleset> <address>
> 0 sgkThis returns:
rewrite: ruleset 0 input: sgk rewrite: ruleset 98 input: sgk rewrite: ruleset 98 returns: sgk rewrite: ruleset 0 returns: $# local $: sgkIf you'd like to see your From address being built up while sendmail is working, you can use this:
/usr/sbin/sendmail -v -d0.4 -Cobj/deb-local.cf someuser < somefileIf you'd like to see your macros expanded, use:
/usr/sbin/sendmail -v -d37.2 -Cobj/deb-local.cf someuser < somefile
Install your newly minted configuration file as the official sendmail configuration file:
cp /usr/src/sendmail/cf/obj/deb-local.cf /etc/sendmail.cf[What must the permissions and owner be?]
Create a file called aliases in whatever directory you specified in your deb-local.mc file. In my case (see above), it would be /usr/local/etc/aliases. This file should include all your 'system' aliases; it should have at least these two lines:
postmaster: mail mailer-daemon: postmaster
Sendmail uses a compact database form of the aliases file, rather than the ASCII file itself. To convert the ASCII file you've just made into database form, use:
/usr/sbin/sendmail -biThis uses the file specified as the ALIASES in your deb-local.mc file to *initialize* (note the -i flag) a new aliases database, i.e., put it in 'dbm' format.
If you retrieve mail via POP from your provider, you can use this command to download mail.
popclient -3 -k -u yourusername -p password FQDNwhere you should replace -- 'username' with the user name of your account at your ISP,
The -k tells popclient to keep the files at the server, i.e., don't erase them. This is a BIG help if your mail setup is less than perfect. If you don't use this, some of your mail could go to never-never land.
Some of the more popular mail user agents are the venerable 'mail' program, pine, elm, and MH. These instructions apply to MH. (To be expanded to included other MUA's later.)
localname: sgk.tiac.net clientname: sgk.tiac.net pophost: remote_fqdn servers: sgk.tiac.net remote_fqdnIn the above, replace local_fqdn with the name of your local host. Also, replace remote_fqdn with the fully-qualified domain name of the host that gets your mail. In my case, that's zork.tiac.net
machine 'remote_fqdn' login 'username' password 'password' machine sgk.tiac.net login 'username' password 'password'where the terms in quotes should be replaced by the appropriate values (without quotes).
chmod 600 ~joe/.netrc
inc: -noaudit -norpop -noapop showproc: more(The Debian compiled version of showproc incorrectly specifies '/usr/bin/more' rather than '/bin/more' as the showproc, and this is a fix to that.)
You can start the sendmail daemon from the command line by executing a command like:
/usr/sbin/sendmail -bd -q10m -i
So that you won't have to start the sendmail daemon by hand every time you boot the computer, edit your boot scripts to do the initiation for you. Either construct a file called /etc/rc.boot/sendmail with this line:
/usr/sbin/sendmail -bd -2mor construct a file called /etc/init.d/sendmail with the same line:
Back to: Tuning Linux: Table of Contents |
Go Home or to:
Computing *
Communications *
Government *
Physical Sciences *
Job$ and Inve$ting *
Leisure