Skip to main content

3. Format of the DISTRIBUTE request

The body of the message delivered to LISTSERV defines the recipients of the distribution and the text (header + body) of the RFC822 message you want to have delivered. The request starts with a "job card", followed by a DISTRIBUTE command, a list of recipients, and finally the message header and body.

3.1. Syntax of the JOB card​

The purpose of the JOB card is to make sure that any spurious text inserted by mail gateways or the like is flushed and not erroneously interpreted as a command. It can optionally be used to associate a "job name" with the request, in case you want to use tools to assist you in processing the notifications you get from the DISTRIBUTE servers when running in test mode. The syntax is as follows:

   //jobname JOB ECHO=NO

"jobname" can be anything as long as it does not contain blanks, and can be omitted. LISTSERV generally ignores case when parsing commands, so you can use "job" or "Job" if you prefer. The ECHO=NO keyword is required for production use, to suppress the "resource usage summary" you would otherwise get upon completion of your delivery. You may want to omit it when testing.

3.2. Syntax of the DISTRIBUTE command​

Below the JOB card, you must supply the following line:

   DISTRIBUTE MAIL

For production mode, do not specify anything else on that line. When testing, you should add ACK=MAIL in order to get an acknowledgement confirming the delivery. There are two other useful options: DEBUG=YES, which instructs the server to produce a report showing how the various recipients will be routed, but without actually delivering the message; and TRACE=YES, which does the same but does deliver the message. Before making a "live" test with your actual recipients list, you should tack the DEBUG=YES option once to make sure you got all the parameters and syntax right, and get a rough idea of the efficiency of the distribution (see the section on performance).

3.3. Giving the list of recipients​

The list of recipients follows the DISTRIBUTE line and is specified as follows:

   //To DD *
user1@host1 BSMTP
user2@host2 BSMTP
/*

The two lines starting with a "/" have to be copied as-is. Each of the lines in between contains the address of one of the recipients, followed by a blank and by the word "BSMTP", which indicates that you do not want the header rewritten. There are four restrictions:

  • a. The address must be a plain "local-part@hostname" - no name string, no angle bracket, no source route, etc. Bear in mind that the DISTRIBUTE server is not in the same domain as you: all the addresses should be fully qualified.

  • b. If the local-part is quoted, it must be quoted from the first word on. Technically, RFC822 allows: Joe."Now@Home"[email protected], but for performance reasons this form is not supported. Just quote the first word to tell LISTSERV to run the address through the full parser: you would write "Joe"."Now@Home"[email protected] instead.

  • c. The local-part of the address may not start with an (unquoted) asterisk. You can bypass this restriction by quoting the local part and using a %-hack through the server's host: "JACK%jack-ws.xyz.edu"@server-host.

  • d. Blanks are not allowed anywhere in the address.

You can use the pseudo-domain ".BITNET" for BITNET recipients: it is always supported within DISTRIBUTE requests.

3.4. Specifying the message text​

After the last recipient and the closing "/*", add the following line,

   //Data DD *,EOF

followed by the RFC822 message (header + body) that you want delivered. The EOF option indicates that the message header and body will extend until the end of the message you are sending to the DISTRIBUTE server. If you are worried about extraneous data being appended by a gateway, remove the EOF option, add a closing "/" line after the end of the message, followed by a "// EOJ" card to flush any remaining text. This, however, will fail if the message itself contains a "/" line; you would have to insert a space before any such line.