The Tellsmtp Command Line Utility

The Tellsmtp executable provides a simple universal command line utility for controlling and monitoring the DSMTP system. Of special note is the 'reload' command, which makes DSMTP reload it's configuration file. It is often used after manually editing the config file, so that you do not have to restart DSMTP for the changes made to take effect.  

It is invoked with the command line:    

tellsmtp [-n ip] [-p port] [-i conf] <command> [parameters...]
The ip parameter following the -n switch tells Tellsmtp which IP number to use when connecting to DMail. The default is simply to connect to the machine which Tellsmtp is executed from.    

The port parameter following the -p switch tells Tellsmtp which port to use when connecting to DMail. The default is 25.    

The -i switch tells Tellsmtp to look for appropriate settings in the DMail config file specified by the conf parameter (including full pathname).    

The <command> parameter can take the following forms, as outlined below.    

Tellsmtp Command Summary:

clear_cache_all - tells DSMTP to clear it's cache of user lookups (and the forward rules etc. that they returned).
config <setting> - shows what DSMTP currently has set for that 'setting'
filters - shows all active mail_filter, or filter_file commands
help             Displays a brief summary of Tellsmtp commands
log_level       sets the amount of information logged
monitors        shows the IP numbers DSMTP is currently remote logging to
profile        - shows a profile of code statistics.
quiet           toggles 'quiet' status, i.e. does/does not print minimal operating information to stdout
reload          tells DSMTP to reload its config file
register        instigates registration function, creates register.txt
resume          tells DSMTP to resume processing outgoing mail
scriptfile.msc  sends the script file named
sendlog         tells DSMTP to send live log info
showchans        shows a list of current TCPIP channels and their status
showsend        shows a list of current outgoing TCPIP channels.
shutdown        starts exit of DSMTP in a reasonably civilized fashion
smtp            what follows this command is passed directly to DMail
status          causes status of DSMTP to be echoed to screen
suspend         stops DSMTP from attempting to process outgoing mail
tryall          requeues all outgoing messages to be processed immediately

Detailed List of Tellsmtp Commands:


tells DSMTP to clear it's cache of user lookups (and the forward rules etc. that they returned). See authent_cache.


Displays a brief summary of Tellsmtp commands.  


When given the register command, Tellsmtp will execute the DMail registration function. This asks questions which will allow DMail to be registered. A register.txt file is created for emailing to NetWin. Payment details are encrypted for safe transfer to NetWin Ltd. No parameters are required.  


If the <command> parameter ends in .msc, Tellsmtp assumes that a Tellsmtp scriptfile has been specified. It will then load the scriptfile, and pass the lines in it directly to DMail. Each line will be sent to DMail exactly as it is found in the textfile. The only exception to this is when the line starts with '#'. In this case, Tellsmtp will not wait for a response before sending the next line. This is mostly for use when sending the DATA lines of a message. Because of this flexibility, a scriptfile may be written to test any aspect of DMail's operation. A simple scriptfile to deliver a message locally would read as follows:  

helo test.domain  
mail from:<test@any.machine>  
rcpt to:<recipient@local.machine>  
#Subject: This is a test  
#Please ignore  

The hash symbol must be present at the beginning of all lines between a DATA command and the '.' following it, or Tellsmtp will wait (forever) for a reply, and DMail will wait (forever) for more data. Assuming that the above script is saved as 'test.msc', the command  

tellsmtp test.msc  

  will send the scriptfile to DMail (or whoever is listening to the port Tellsmtp is talking to). No parameters are required.  


The smtp command talks directly to DMail, with Tellsmtp pretending to be an SMTP client. Any arguments following the smtp command will be concatenated (separated by a space) and sent to DMail, followed by a quit command. DMail's responses will be echoed by Tellsmtp. This command is of little use, as it will only work with a very small number of SMTP commands.   


tellsmtp smtp helo test.domain  


This command will cause Tellsmtp to echo status information sent to it by DMail. Depending on what DMail has been up to, several screens of information may be displayed. It is a good idea to redirect Tellsmtp's output to a file when using this command, e.g.
tellsmtp status > a.a
outputs the status to the file, a.a.

If DMail is behaving oddly, but not crashing, the output from a Tellsmtp status command may help us to find the problem.

Here are some details of the information that it prints out. Don't worry if you can't understand some of it.

 DSMTP v2.7l status as at Tue Nov 09 12:35:05 1999
 Uptime: 0 days, 16 hours, 48 minutes

 Message Statistics
Messages     received: (number of messages received by DSMTP during the uptime
Messages local/remote: (number of msgs with both local + remote rcpt lines)
Messages    delivered: (number of queued files delivered locally)
Messages      sent on: (number of queued files delivered with rcpt lines that
						were all for remote addresses)
Messages      gave up: (number trashed for some reason (unkown rcpt etc))
Messages      pending: (number still sitting in the message queue)
Messages   to unknown: (other people talking to this server gave this many bad recipient lines)
Messages   incomplete: (messages where DSMTP could not get the entire message)
Messages     rejected: (number of messages rejected for whatever reason)

Total in:  (the total number of messages that arrived at dsmtp's door)

Total out: (a ballpark figure of the total number of messages that DSMTP dealt with)

 File Rty Time Left Busy Domain
(This is a list of queued files which are currently in
the memory queue as set by the setting max_queue)

15236  000 -942172505    1
15215  000 -942172505    1
15188  001 000007140    0

(using the last one as an example,

15188: is the queue files number, i.e. you will find
q_15188.itm and .idx files in the work_path

001:  rcpt lines in this queue file have been tried once

000007140: time in seconds until this is next tried.  If a
large negative number this message will be tried as soon as
DSMTP can get to it - e.g. if you do a tellsmtp tryall command
all messages will be set like this.

0:  Is the queue file currently being looked at, 0 is NO, 1 is Yes. the domain of the first rcpt line in the queue file, to
give you an indication of who it is addressed to.
 TCP channel history
(The column on the left is a counter of the number of times
each close/open of a TCPIP channel occurred for the detailed reason,
some reason relate directly to a setting in dmail.conf as noted below.)
19717 Command failed: RCPT Unknown user

77598 Connection opened:(in)

68534 Connection closed:(in) it was told to  (other end gave QUIT command)

53729 Connection refused: banned IP number  (connecting ip address matched a ban_ip setting)

12144 Connection closed:(out) DSMTP told it to (dsmtp does this when finished with a normal connection)

2936 Connection closed:(in) by remote end (other end closed the connection on DSMTP)

7692 Connection closed:(in) timeout (dsmtp waited tcp_timeout seconds for a response and then closed connection)

3461 Connection closed:(out) unexpected isclosing() (connection was aborted, other end crashed, line broke ...)

15604 Connection opened:(out) processing qfile (dsmtp opens connection as q file was to non-local domains)

1436 Command rejected: remote domain, no relaying (got a non-local rcpt line from a remote domain and DSMTP coudl not allow it to relay)

014 Command rejected: weird RCPT (bad syntax in rcpt to line)

013 Command rejected: untimely RCPT (order fo SMTP protocol was not followed by sending device)

8054 Command rejected: too many RCPTs (number of rcpt lines greater than setting, max_rcpt)

287 Connection refused: accept() failed (remote end opened channel, DSMTP responded but could not connect to other end)

294 Command rejected: wierd FROM (bad syntax of from line given)

060 Command rejected: DATA no valid rcpt fields (rejected connection at data stage because no valid destination addresses were given)

1150 Command rejected: DATA fromip_max limit hit (sending ip address had sent more than allowed messages this hour, as set by fromip_max)

006 Command rejected: premature FROM (sender got SMTP protocol around the wrong way)

003 Command rejected: DATA no valid from field (we did not get a valid FROM field but the sender still tried to send)

001 Command rejected: Found possible MX loop  (message had a lot of rcpt lines to a domain that resolved to this box but we did not have a host_domain or vdomain setting for it)

004 Command rejected: unsupported AUTH (sender tried to use an AUTH type that DSMTP does not support)



+OK finished


This diagnostic command will make DSMTP respond with a list of TCPIP channels that have been used since startup. List entries show the channel's current state and how long the channel has been in that sate. Channels which will not timeout (e.g. those sending live log updates, see sendlog) are marked as such. 

The basic layout is:

chan[v] used=w, state=x, socket=y, ip=a.b.c.d, last active z seconds ago

The used and state columns are not of use to sysadmins so simply ignore them.

Here are three lines from an example output with explanation:

chan[0] used=2, state=1, socket=132, ip=, last active 8 seconds ago (receiving loglines)
chan[1] used=2, state=6, socket=133, ip=, last active 1 seconds ago
chan[150] used=0, state=0, socket closed, ip=, dead for 8652 seconds

The first line shows that something is connected from the IP address,, on DSMTP's first channel using the operating system's TCPIP socket 132. At the end of the line the words '(receiving loglines)' indicate that it is a connection from something that has asked DSMTP to copy any lines that it logs out to it on this . In this example it is the DMAdmin windows GUI admin tool that is connected. The line also shows that something (DSMTP or DMAdmin) talked on that port 8 seconds ago.

The second line is an active TCPIP connection from an email client or SMTP server at IP address

The last line shows that a maximum of 150 channels have been opened at some point. Because it is marked as 'socket closed', you know that that connection is no longer open, and dstmp has not had to use that channel again since something connected from the IP address 8652 seconds ago.

Inactive connections will timeout after the time specified by the setting, tcp_timeout.


This command will cause DSMTP to exit in a reasonably civilized fashion, but will cause it to do so without any further confirmation from anyone (i.e. immediately)  


This command will cause DSMTP to crash. Used mainly for testing how well it recovers from...ermm...a crash. Use at your own risk. Actually, try not to use at all :-)  


This command will make DSMTP reload its config file. This is very useful for making changes to DSMTP on the fly, without having to shut it down and restart it. Alterations to significant commands such as drop_path can be made, so take care when using this command. The only setting which will have no effect if reloaded is smtp_port.    

NOTE : If you have modified a dmail.conf setting which is relevant to both DPOP and DSMTP, it is necessary to reload both servers individually with their reload configuration file commands, e.g. tellsmtp reload and tellpop reload. DMAdmin will do this automatically, but note that you can send the reload command from the command list in DMAdmin whenever you wish. 

If you have an exceptionally large dmail.conf file this process of reloading could take 30 seconds. So larger sites should probably schedule reloads for every x hours and then let customers know that their changes won't take effect until after the next scheduled reload.


This command will change DSMTP's log level during runtime. It will not cause DSMTP's config file to be re-written, so next time DSMTP is run, it will use the log level setting found there. This command is useful for closely observing a particular transaction DSMTP may be about to make.    

The available log levels are: 
error: the only information written will be errors, warnings, socket read and write information and minimal progress information.
info: as well as the error information, this setting gives much more progress information, as well as file open and close calls.
debug: as well as the info information, this setting gives a whole lot of internal status information, function calls...all sorts of stuff. However, it may slow down operation slightly and can produce large log files, so use sparingly.
If DSMTP is behaving unusually, run it with the verbose option first. This should give enough information to reveal whether or not it is a problem with the config file. If all else fails, run it with the debug option. If DSMTP is crashing or doing very peculiar things, the most useful things to NetWin support are the config file and the log file. 

Info is the default setting, and the usual setting for operating in. For more information see the Logging of information and error messages section. 


This command toggles DSMTP's "quiet" status, i.e. whether or not it prints anything aside from minimal operating information to stdout. On some systems (Windows NT in particular) this will result in significant performance gains. If DSMTP is running quietly, critical messages such as disk full warnings will still be displayed.    

showq <num>  

This command tells DSMTP to send the q_<num>.idx and q_<num>.itm files back to tellsmtp.    

killq <num>  

This command tells DSMTP to kill the q_<num>.* files and remove them from its internal queue. Use this in conjunction with showq to remove troublesome or unwanted messages.    


This command will print a list of the message filters you currently have in DMail.

Example: tellsmtp filters This will print a list of all filters that are currently being used, on some versions you may have to use a * instead of no argument.
tellsmtp filters 5 This will print the 5th rule.  


This command will stop DSMTP from processing outgoing mail. DSMTP will stay in this mode until told otherwise, so use with caution, as incoming mail will still be accepted, so a backlog of q files will build up.  


This command will tell DSMTP to resume outgoing message processing. It undoes what suspend does.  


This command will cause DSMTP to send a copy of all its logfile output across the TCP connection opened by the sender of the sendlog command.  


This command tells DSMTP to requeue and immediately retry all pending outgoing messages. Useful mainly if there has been a network outage of some form.  


This command will list all current sendlog TCPIP connections, e.g. connections from remote admin tools such as DMAdmin.

Back to Top of Command Summary List