NTMAIL - Reference

This reference section relates to version 2.08 of NTMAIL. Previous versions are available.

Command parameters/switches

1.1 SMTP, POP and POST Services

Each of the services supports the following switches or parameters: Do not run any of the programs with no switches. They will (apparently) hang. If you do this accidently, simply use CTRL-C to kill the program.

1.2 MAIL utility

This program will perform lots of different actions all to help with the running of NTMAIL. There are several diagnositic options, a mail-to option, an option to get the services to re-read the registry and lastly some routines for helping with dialup connections. Here we will go through each of the options with an example.

The MAIL utility will accept a sequence of commands and work though them one after another.

-afilename

This command tells MAIL to append the POP entries in the given file to those that are already in the registry. MAIL assumes that you will only set up one user per mailbox and therefore assumes that all mailboxes are unique. If it finds any mailboxes with the same names, the old ones will be overwritten. Any completely new entries will be added and any entries the same will be ignored. There are more details below under "-l".

For example:

C:\mail>type test.txt mb0001 mike -hroot postmaster mb0002 david - david mb0003 test test mark when run might produce the following output if the user mike and david already exist. C:\mail>mail -atest.txt -u Reading current setup from registry... Reading details from file... User mike has a new password About to update registry with new values... Update completed... New users: 1 Changed: 1 Unchanged: 0 Removed: 0 SMTP update completed on Thu, 11 May 95 16:13:22 POP update completed on Thu, 11 May 95 16:13:22 POST update completed on Thu, 11 May 95 16:13:23

-chostname

Looks up the CNAME for the specified host. (If you are not sure what a CNAME is, please see our
DNS Primer). For example: C:\mail>mail -cnet-shopper.co.uk No records for "net-shopper.co.uk" were found. C:\mail>mail -cmail.net-shopper.co.uk Official name: mail.net-shopper.co.uk (194.70.57.66)

-h$

This is the help utility. Entering "MAIL -h" will display all the commands that MAIL will accept. If you want more details about a command, enter the letter for that command after the h, for example: C:\mail>mail -hp Command: -pfilename,to[,hostname[,subject[,from]]] This command allows you to post a file to a mail server. You must define the filename and to fields. If hostname is missing, the local machine will be used. If subject is missing, "Message from MAIL" will be used. If no from is included, the FROM: clause will be NULL (so the mail will be deleted if undelivered). If you would like to have spaces in the subject, you must enclose the WHOLE option in quotes, for example: MAIL "-pfile.txt,david,post.company.com,The time of day"

-k

This command will cause the POST service to be Kicked! This means that POST will start sending mail if there is any currently waiting. For example: C:\mail>mail -k Kicked POST at Thu, 11 May 95 16:29:55 and if POST does not reside on your machine, you would get: C:\mail>mail -k Failed to kick POST at Thu, 11 May 95 16:29:36

-lfile

Load the contents of the POP script file into the registry, overwriting any entries already there. In fact, it only over-writes those entries that have changed - this means that if a user has changed his password, then running MAIL -l will not alter the password again (unless specifically requested). Take a look at the following POP script file: C:\mail>type test.txt mb0001 mike -hroot postmaster mb0002 david - david mb0003 test test mark help It has been written to create three mail boxes, mb0001, mb0002 and mb0003. The users mike, david and test will be allowed access to these mail boxes. However, the password definition is different for each person. In the case of mike, any password he already had will be replaced by the password "hroot" - the leading hypen indicates that the old password MUST be replaced. The user david will use the same password as is in the NT User Database (it will not be possible to change his password using Eudora). The user test has a password of test, however if he has changed it (using Eudora), his new password will not be overwritten.

The last parameters define the aliases for each of the users. Any mail to postmaster will be sent to mike's mail box. Any mail for david to david's mailbox and any mail to mark or halp will go into test's mailbox. Note that mail to "mike" and "test" will be rejected - if these aliases are to be used, they must be added (i.e. extra aliases can be listed in the script).

Note, if a user has a holiday account, it will not be upset by the loading process, it will remain a holiday account and be updated (if required).

That covers all the options for defining a POP script! To load the script, it is a matter of entering:

C:\mail>mail -ltest.txt -u Reading current setup from registry... Reading details from file... User mike has a new password About to update registry with new values... Update completed... New users: 0 Changed: 1 Unchanged: 0 Removed: 0 SMTP update completed on Thu, 11 May 95 16:43:12 POP update completed on Thu, 11 May 95 16:43:12 POST update completed on Thu, 11 May 95 16:43:13 Note that the "-u" option was also used, this causes the changes to happen immediately. You do not have to stop and start the services again.

-mhostname

This command will instruct the MAIL utility to attempt to find the MX records for a given host. For example: C:\mail>mail -mnet-shopper.co.uk Number of entries 5 194.70.57.66 mailgate.net-shopper.co.uk 20 158.152.1.73 punt.demon.co.uk 40 158.152.1.72 post.demon.co.uk 40 158.152.1.65 gate.demon.co.uk 50 146.169.43.5 frigate.doc.ic.ac.uk 80 More details of how MX records are used can be seen on our
DNS Primer page.

-p

This command allows you to Post a file to a given destination using a given mail server. The syntax of the command is: MAIL -pfilename,to[,hostname[,subject[,from]]] The minimum to send a file would be: MAIL -pfile.txt,david@company.co.uk while a fully specified send operation, would be (note the use of the quotes): MAIL "-pfile.txt,david,post.company.com,The time of day,brian@net-shopper.co.uk"

-qhost,password

The -q option is for Querying a NTMAIL server to see how it is doing! If NTMAIL is running on this host and no password has been defined in
SmtpData then "MAIL -q" will display a set of statistics about the progress of messages. You can query other NTMAIL servers if you know their hostname - and if they require a password you will need to enter that too. For example: C:\mail>mail -qmailgate.net-shopper.co.uk,password NTMAIL SMTP Service ===================== NTMAIL Setup characteristics: Started Thu, 11 May 95 13:59:04 GMT+0000 Current time Thu, 11 May 95 16:44:24 GMT+0000 Version 2.10 Local maildrops 155 Local Machine name mail.net-shopper.co.uk Default Domain name net-shopper.co.uk Users licensed unlimited Licensed full with List Server SMTP statistics: Messages processed 265 Messages in progress 2 of 10 (2 waiting) Up time 3 hours Summary: Sum all SMTP message bytes 1884 Kbytes in 526 messages in 8 hours SMTP average 3669 bytes/message Sum all POST message bytes 1248 Kbytes in 245 messages in 6 hours POST average 5218 bytes/message

-sn

Wait for n seconds! It is usually used before another option on the same command line. For example, to wait 30 seconds and then kick the POST service you would use the command line: C:\mail>mail -s30 -wPOST

-tn

Sets the maximum wait time for any option that waits for an action to complete. A wait time of 0 is taken as INFINITY (ie don't ever complete until finished).

It is usually used before another option on the same command line. For example, to wait a maximum of 600 seconds for POST to complete, you would use the command line:

C:\mail>mail -t600 -wPOST

-u

Tell all or one of the Services to read their values from the registry. To tell all the services to reload, simply don't state any otherwise give the name of the service (e.g. SMTP, POP or POST). The services will all stop mail activity and wait for any actions in progress to complete before carrying out the update. As soon as the update is complete the services will start accepting mail requests again. For example, to tell all services to reload, use the command: C:\mail>mail -u SMTP update completed on Thu, 11 May 95 16:13:22 POP update completed on Thu, 11 May 95 16:13:22 POST update completed on Thu, 11 May 95 16:13:23 MAIL will wait for all the services to report that they have updated - the default is to wait for a maximum of 10 minutes before giving up (this does not mean that the services will never reload).

-v

Tells MAIL to output the time each operation starts at. This is useful for checking a batch file is operating correctly.

-w

The command causes MAIL to wait until one of four actions are complete: POST, SMTP, BOTH or MAIL. This allows the program to wait on either mail server (POST or SMTP) or both (SMTP and POST) OR to wait for mail to appear in the mail directory. By default MAIL will only wait for 10 minutes, so if you want a script to continue when mail becomes available for sending, you would need to use the command: C:\mail>mail -t0 -wMAIL

1.3 PULLMAIL

PULLMAIL is a simple command line utility to pull email from a pop account and send it to an SMTP server. It looks for a To: or Apparently-To: field in the header of each email and uses this in the RCPT-TO command to the SMTP server. The command line is: pullmail where: (PULLMAIL was written by Frontier Technology and Mark Woollard of 7th Wave Software Ltd. If you find their utility useful, please let them know by emailing Mark at
mark@swsoft.co.uk).

2. Registry entries

This section lists all the registry entries in great detail. All these entries can be found by using
REGEDT32 and the key will be H_KEY_LOCAL_MACHINE/Software/InternetShopper. Unless otherwise stated, all these entries are of REG_SZ. Remember that you will need to tell the services to reload when you have completed your changes: enter "MAIL -u"... In most cases it is safe to edit the registry entries and then stop and start the affected services. The one case where this is not true is when you are changing the parameters in a list ("L") entry. You must stop SMTP while the list is being edited to prevent SMTP from adding and removing people behind your back!

2.1 Mail\ConCurrent

This entry defines the number of threads that are allowed for each of the three servers. In order the parameters are:

2.2 Mail\Key

This is a twelve character string which allows the software to work. You are advised not to change it directly but to use the "-k" option on any of the services. This way the key will be checked before the registry is changed. If you suspect a problem with the key, type "SMTP -S" and SMTP will tell you the current status of the key you have installed.

2.3 Mail\Log

Four numbers followed by the directory for log files. The numbers are binary options for different logging levels. In order the entries are: The "numbers" for the log details are not consistent since other bits are used for other log information, for example DEBUG log which can quickly fill a 1Gb hard disk.

2.4 mail\M0....Mx

The definitions of mail drops on the system - either set up manually or by the LOADMAIL script. Each mail box has its own line in the registry, the line has the format: LETTERaliases parameters
Note that the POP server will only provide access for those entries marked as a POP account or holiday account.

2.5 Mail\MailDir

This is the directory that will store all the mail boxes and out bound mail. Note the directory MUST exist and must be terminated by a back-slash. For example C:\mail is invalid, C:\mail\ will work.

2.6 Mail\PostData

The following parameters are defined:

2.7 Mail\SmtpData

This value should have the following entries seperate by a white space:

2.8 Mail\Version

Two digits for the version number and the maximum number of mailboxes that have ever been defined. The version number is used by the configuration software when updating the registry from old version of the software.

2.9 Mail\MailNumber

This is the number of the last message sent out bound by SMTP. It will increment as the mail is sent and will tell you exactly how many messages have been sent by NTMAIL.

2.10 Mail\SmtpResolveHostname

If this REG_DWORD entry is present and set to 1, the SMTP server will not attempt to resolve the name of any client sending mail. This is especially useful when NTMAIL is used in a network where there is no DNS server until a dial-up connection is made to the internet.

2.11 Mail\MaxMessageSize

If this REG_DWORD entry is present and has a value other than zero, the maximum text of a message will be limited to the given number of bytes. This may be used to prevent people sending excessively large messages around the system.

2.12 Mail\PasswordServer

If this REG_DWORD entry is present and equal to 1, the POP service will run a password server that will allow Eudora users to log in and change their password. If a user changes his password, the encrypted version will be written back into the registry. Remeber it is not possible for a Eudora user to change the NT Database password, he can only change the one he has in the registry.

2.13 Mail\FingerServer

If this REG_DWORD entry is present and equal to 1, the POP service will run a finger server that will allow Eudora users or other people to finger NTMAIL to find out how much mail is waiting for a particular user.

2.14 Mail\SmtpStat

This is a registry entry that will automatically be created by NTMAIL. It contains the number of bytes in messages, number of messages and the total number of hours the SMTP server has been running on this machine. These details are displayed if you use the "MAIL -q" command (and have the statistics enabled).

2.15 Mail\PostStat

This is a registry entry that will automatically be created by NTMAIL. It contains the number of bytes in messages, number of messages and the total number of hours the POST server has been running on this machine. These details are displayed if you use the "MAIL -q" command (and have the statistics enabled).

3. Mail files

These are files that can be mailed to someone by NTMAIL - for example, the holiday file, information file or help file for the list server. All these files allow the header as well as the body of the message to be changed. The header may be changed by starting a line in the mail file with a hyphen followed by the name of the entry and a colon. The list of entries to change is terminated by the first line not starting with a hyphen.

For example the following file

-Subject: New subject This is an interesting file. ------------------------------------------------- From Internet Shopper Ltd ------------------------------------------------- will change the subject part of the header of a mail message from the default subject to "New subject". Since the signature is in the body of the message it is ignored.

This is potentially very powerful and may cause other people problems if you (for example) re-define the "From:" field to be something illegal.

4. List Manager Commands

The list manager will interpret four commands which must appear in the first line of text of a mail message. When the list server replies to a message, it will attempt to use the "From:" clause, "X-Replyto" clause and finally the address the mail claims to have come from.

4.1 JOIN or SUBSCRIBE

This command takes one parameter, the name of the list to join. If the sender is not already in the list, his address will be appended to the registry entry for this list and the Join Mail file will be sent. If the list does not exist, the list manager will send its help file instead.

4.2 LEAVE or UNSUBSCRIBE

If a user needs to leave a list, he will a leave command followed by the name of the list he wishes to leave. The list manager will check to see if the sender appears in that list and remove him if he does. Then the leave mail file will be sent. If the list is unknown or the name does not appear in the list, it will send its help file instead.

4.3 LIST

The command will return a message to the sender containing a list of all the members of a given list. This list is in "join" order and may be requested in alphabetical order by placing the work "ALPHA" after the list name.

4.4 HELP

Send the text file that gives help for this particular list manager. If the name of a list is specified, send the help file for that pacticular list.
webmaster@net-shopper.co.uk (12th May 1995)