Re: Smail config for a ppp box
Kenneth Johansson <email@example.com> writes:
> I also have problems understanding smail. My guess is that the debian
> package dont contain all documentation.
Or that documentation for what you need doesn't exist.
> I have the almost the same problem as didier belot wrote about.
> I call my home network localnet an my prvider is canit.se.
> I can send mail to everyone but them on canit.se.so it's a very similar
You could see my reply to his problem - I believe that it was article
<m0xpMs0-0003cBC@cush> - it does what you ask for below (sending mail
over smtp to whatever machine is appropriate for canit.se when it
can't deliver the mail locally)
> When I tried to configure smail I directly run in to problem. To start
> what is a driver? and what drivers ar valid ?? from the already
> installed configuration files I gues that tcpsmtp is a valid driver but
> I made a grep on al smail doc I have on my system and that gave no hit.
> This makes me think that I miss some type of doc.
The documentation for smail that I've found most useful in setting it
up is the section 5 man page for smail and the other smail* pages it
refers to - this isn't what you get when you just do a "man smail" -
you have to do a "man 5 smail".
It is, like most man pages, a bit unclear unless you already know
mostly what's going on. Here's a bit of information to get you
started and help you understand what's going on, somewhat:
Smail has several different configuration files; the format of each
file is somewhat similar - the smail(5) manpage describes, among other
things, the format of the config. files that is common to all of
smail's config files. The most important configuration files for the
moment are the config, directors, routers, and transports files.
The config file should be pretty easy to understand by looking at it
and by reading the smailconf man page. Basically, it just sets
overall configuration values, that can be used elsewhere.
The directors file describes what should be done with mail that is
determined to be local. (this is done by checking the part after the
@ sign in an address with the "hostnames" config setting) A director
(the directors file describes several directors) turns a
username into another username(s) (in the case of mailing lists or
~/.forward files) and/or passes a message along to a transport.
(which is found in the transports file)
The routers file describes what should be done with non-local mail.
It is usually used to determine which way outgoing mail should go
(i.e. should it send all outgoing mail to one machine for processing,
or should it send mail destined for *.whatever.net through a different
machine, etc. - it's also used to determine if outgoing mail should
use uucp or smtp).
The transports file describes how to deliver mail - both local and
outbound. It includes instructions for how to do smtp (for example,
you could be on an odd network that did smtp at a non-standard TCP
port), how to do uucp, how to deliver local mail (do you want to
append the message to a certain file, where's that file located,
etc.), etc. I use it to adjust certain header lines in outgoing smtp
mail, but that's just me.
I should clarify at this point that directors and routers either take
care of a message, or they do not. When determining what to do with a
local message, smail scans each director in the order that they are
found in the directors file until it finds one that can handle the
current message. (if it can't find such a director, the message is
bounced) Same for outbound mail - smail scans the routers file until
it finds a router capable of handling the message. This means that
the order of directors and routers within the directors and routers
files can be very important.
In each of the transports, directors, and routers files the "driver"
attribute defined with each transport, router, or director tells smail
which internal functions to use. For example, in my transports file,
the transport called "local" has the driver "appendfile" - this means
then that any director (or router) that calls on a transport named
"local" will cause smail to append the message to a certain file.
Valid drivers for transports are listed in the smailtrns man page; for
directors they're listed in the smaildrct man page; for routers
they're listed in the smailrtrs man page.
> What dose driver smartuser do and smarthost ?
smartuser is a director driver. smarthost is a router driver.
A director using the smartuser driver will handle any message, so it
should be put at the very bottom of the directors file. What it does
is cause smail to respool the message, but treat it this time as an
outbound message, instead of a local message. That is, smail will try
to send the message elsewhere. Optionally, you may change the
A router using the smarthost driver will handle any message, so should
be put at the bottom of the routers file. What this does is send the
message on to another host, in the idea that the other host can
deliver it. On my ppp box, the only router I have defined uses the
smarthost driver - I send all my outbound mail to my department's mail
server. Whether it sends the outgoing mail via smtp or uucp (or
something else) is determined by the transport specified. (It can
also be determined by the method specified, but that's only used when
some messages should be sent one way and other messages another way)
> all I really need is that when a local driver fail to deliver I send it
> over smtp to mail.canit.se.
Since I've already written such a long message, I might as well tell
you what I recommended to the original poster:
Put the following at the _end_ of your /etc/smail/directors file (it
must be at the end; otherwise you'll have other problems, like mail
intended for root at your machine going to root at your isp!)
This will tell smail that if it receives something for firstname.lastname@example.org,
and that doesn't match a valid local address, then it should not treat
the mail as local.
Note that I could have put anything in front of the colon in the first
line - for example, putting the following at the end works just as
And, of course, you would use "@canit.se" instead of "@avo.fr". Most
people name the director the same thing as the driver, though, because
it makes the logfiles easier to read when there's a problem.
> I was quite close to do this but the mail got stuck in the mailqueue
What do you mean by this, exactly? Specifically, what did your
/var/log/smail/* files have to say about it?
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
Trouble? e-mail to email@example.com .