====                                                DISview [740]
smtp
====


The 'smtp' commands are used for controlling mail forwarding
using the Simple Mail Transfer Protocol (SMTP).

_________________________________________________________________
smtp batch [on|off]                                  Default: off
_________________________________________________________________
Display or set the smtp batch flag.

When set to 'on', multiple messages for a single SMTP server are
sent as a batch, whereby many of the SMTP commands are sent in 
one fell swoop before waiting for responses.  

>> Example:  smtp batch on

Unfortunately this breaks some brain-damaged SMTP servers. If you
receive a message complaining that mail to a particular recipient
has been bounced because of a missing RCPT or similar, turn 
batching off (with the command 'smtp batch off') and try to send 
the mail again.


_________________________________________________________________
smtp beep [on|off]                                   Default: off
_________________________________________________________________
Display or set the SMTP mail arrival flag. When set to 'on', you
will hear a beep for each new mail message received.

>> Example:  smtp beep on


_________________________________________________________________
smtp delay [<seconds>]
_________________________________________________________________
Display or set the time delay between attempts to deliver a
message currently in the "delay" queue. An incoming message is
placed in the delay queue (locked with the extension .DLY) if a
mailbox file is busy (typically when it is being accessed by
another SMTP session).

>> Example:  smtp delay 2


_________________________________________________________________
smtp gateway [<host>]
_________________________________________________________________
Display or set the host to be used as a "smart" mail relay
station. 'None' removes the hostname.

The gateway is used when you are attempting to send mail to any
host that is uncontactable (e.g. because there is no route to
it, or it is switched off, or its address is not obtainable via
DNS).

>>  Example:  smtp gateway 158.152.1.72


_________________________________________________________________
smtp kick [<mail_destination>]
_________________________________________________________________
The 'smtp kick' command reviews the outgoing mail queue in
directory ~/spool/mqueue, and attempts to deliver any pending
mail.

<mail_destination> is the destination MX host as seen in the 
first line of a .WRK file or the Host column from 'smtp list'.

Normally the queue is reviewed automatically at regular intervals
(specified by the 'smtp timer' command), but occasionally you may
want to "kick" your SMTP client manually to force it to send the
mail.

>> Example:  smtp kick


N.B. Sometimes nothing happens after an 'smtp kick', and the
'sockets' report indicates that there are fewer smtp_send 
processes running than the 'L' lines in your 'smtp list'. This 
can happen if memory is low, which it often will be at the start
of a session due to incoming news and mail. This explains why it
sometimes starts outgoing mail and sometimes delays it with an 
smtp_tick.

_________________________________________________________________
smtp kill <job_number>
_________________________________________________________________
Every outgoing message is allocated a job number (which you can
discover from the 'smtp list' command; see below).  You can then
kill a particular job with the 'smtp kill' command.

>> Example:  smtp kill 6


_________________________________________________________________
smtp list
_________________________________________________________________
List the messages in the outgoing mail queue.

An 'L' entry in the 'S' status column indicates that the message
entry is locked by SMTP; in other words, SMTP is attempting to
send the message.

A 'D' entry indicates that the message is in the delay queue.

_________________________________________________________________
smtp maxclients [<count>]                             Default: 10
_________________________________________________________________
Display or set the maximum number of simultaneous outgoing SMTP
sessions that will be allowed.  Reduce the number if throughput
becomes a problem.

>> Example:  smtp maxclients 7


_________________________________________________________________
smtp mode [queue|route]                            Default: route
_________________________________________________________________
By default, the SMTP mode is 'route', which means that incoming
mail is directed to the mail queue ~/spool/mail, ready for 
reading by a mailer such as PCElm or by the built-in KA9Q BBS.

If the mode is set to 'queue', incoming mail is directed instead
to the special mail forwarding queue ~/spool/rqueue. A special 
forwarding program (not supplied with NET) is then required to 
send the mail in ~/spool/rqueue onwards to its destination. This
mechanism provides added flexibility to YAN for handling mail in
different ways.

>> Example:  smtp mode route

_________________________________________________________________
smtp separator [<separator_string>]                 Default: NULL
_________________________________________________________________
Display or set the separator string which will be written between
each mail message in ~/spool/mail/<mailbox>.txt files.

This allows the use of mailers which expect an explicit separator
between messages.

>> Example:  smtp separator ^A^A^A^A


_________________________________________________________________
smtp server [<commit>] [<receipt>] [<relay>] [on|off] 		   
_________________________________________________________________
Set/display server toggles to control options.

    - commit					     Default: off

      When on, attempts to flush a SmartDrive[tm] v4.x compatible
      write back disk cache (if detected) before acknowledging
      successful receipt of each mail message.

    - receipt					     Default: off

      Controls the reaction to the Return-Receipt-To: header.
      When on a receipt is returned.

    - relay					      Default: on

      Controls the ability of the SMTP server to accept non-local
      mail.  With mail forwarding, it's advisable to use VRFY and
      EXPN to check that it still behaves correctly before going
      online.

>> Examples: smtp server relay
             smtp server receipt on
_________________________________________________________________
smtp timer [<seconds>]                                 Default: 0
_________________________________________________________________
Display or set the interval between automatic scans of the
outbound mail queue ~/spool/mqueue.

Setting a value of zero disables queue scanning altogether.

>>  Example:  smtp timer 180


_________________________________________________________________
smtp trace [<value>]                                   Default: 0
_________________________________________________________________
Display or set the trace flag in the SMTP client, allowing you to
watch SMTP's conversations as it delivers mail.

Setting the flag to any non-zero value enables tracing.  A value
of 9 gives a full trace.


>> Example of an 'smtp trace 7' output when sending a message:
.................................................................
smtp daemon entered, target = 0.0.0.0
queue job 225
        From:ian@dowrmain.demon.co.uk To:president@whitehouse.gov
Trying Connection to 198.137.241.30
SMTP client Trying...
Connected
smtp daemon entered, target = 0.0.0.0
smtp recv: 220 WhiteHouse.Gov SMTP/smap Ready.
smtp sent: HELO dowrmain.demon.co.uk
smtp recv: 250 (dowrmain.demon.co.uk) pleased to meet you.
smtp sent: MAIL FROM:<ian@dowrmain.demon.co.uk>
smtp recv: 250 <ian@dowrmain.demon.co.uk>... Sender Ok
smtp sent: RCPT TO:<president@whitehouse.gov>
smtp recv: 250 <president@whitehouse.gov> OK
smtp sent: DATA
smtp recv: 354 Enter mail, end with "." on a line by itself
smtp sent: .
smtp recv: 250 Mail accepted
smtp sent: QUIT
.................................................................


_________________________________________________________________
smtp verbose [on|off]
_________________________________________________________________
Display or set the SMTP verbose flag. When set to 'on', the 
progress of outgoing messages is displayed.

>> Example:  smtp verbose on


_________________________________________________________________
smtp wait [<seconds>]
_________________________________________________________________
If we can't deliver the mail to its destination within <seconds>,
send the mail to the SMTP gateway host instead. This also sets 
the socket connection timeout for NNTP and NTP time set.

>> Example:  smtp wait 20


_________________________________________________________________
telnet <nodename> 25
_________________________________________________________________
When using the 'telnet' command with well-known port 25, you can
communicate direct with the SMTP server.  This is useful if you
want to interrogate the alias file on a remote host, to find out
aliases and mail distribution lists. 

If the remote host is running KA9Q NET, the 'telnet' command 
interrogates the _incoming_ mail alias file (~/alias) on that 
host. It is not possible remotely to interrogate the _outgoing_ 
mail alias file (~/spool/mail/alias) used by PCElm and SNEWS on
a KA9Q host.


For example, if the incoming mail alias file (~/alias) at 
dowrmain.demon.co.uk looks like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~/alias

default    deliver
postmaster ian

ian.wade   ian
ian-wade   ian
root       ian
inquiry    enquiry
fred       forward fred@anyhost.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


then you can interrogate this file remotely with the command
'telnet dowrmain.demon.co.uk 25'. Once connected, you can give 
the SMTP 'EXPN' to expand alias entries.

When you are done, give the 'QUIT' command.


>> Example of 'telnet dowrmain.demon.co.uk 25' output (including
   your keyboard input of the 'HELP', 'EXPN' and 'QUIT' 
   commands):
.................................................................
Resolving dowrmain.demon.co.uk... Trying 158.152.123.251:25...
Telnet session 3 connected to dowrmain.demon.co.uk
220 dowrmain.demon.co.uk 
           Demon Internet (2.16) Mar 23 1994 15:00:26 SMTP ready
HELP
214-Commands
214-HELO NOOP MAIL QUIT RCPT HELP DATA RSET EXPN
214 End
EXPN fred
250-fred@anyhost.com
250-forward
QUIT
221 Closing
.................................................................

