9.3 Creating and Sending a Mail RDFR ("DISTRIBUTE") Job
The instructions below are for sending plain-text messages to a one-time list via LISTSERV. If you wish to send MIME-encoded mail messages (for instance, to send encoded binaries or HTML mail), you must create and add the appropriate MIME headers along with the file (in the case of an encoded binary) to be sent.
A very basic RFDR job is shown below. This job would be sent to LISTSERV@NODE, where NODE is the NODE= site configuration setting for your local LISTSERV server.
//WIDGET1 JOB DISTRIBUTE MAIL PW=XXXXXXXX //To DD * janecustomer@abc.com BSMTP email-address1@domain.com BSMTP email-address2@domain2.com BSMTP /* //Data DD *,EOF Date: Tue, 13 Jan 1998 12:25:00 -0400 From: joe.techie@xyz.com Subject: Release of XYZ's WIDGET Model 2 Reply-to: joe.techie@xyz.com To: Widget Customers <customers@widget.com> Your text here |
Below is a detailed description of each element of the job.
//WIDGET1 JOB |
The JOB "card" is the required first line of any RFDR job. It signifies to LISTSERV that everything that follows in this particular message is part of the same job. In this case we have called the job WIDGET1. Each RFDR job should have a name, but if for some reason you don't want it to, you simply format the JOB card with a space between "//" and "JOB".
DISTRIBUTE MAIL PW=XXXXXXXX |
This is the actual DISTRIBUTE command that tells LISTSERV that this is an RFDR job, and that specifically you want LISTSERV to distribute a piece of mail. PW=XXXXXXXX is part of the security mechanism described in Section 9.1. You replace XXXXXXXX with your personal LISTSERV password that you've previously set with LISTSERV's PW ADD command.
//To DD * janecustomer@abc.com BSMTP email-address1@domain.com BSMTP email-address2@domain2.com BSMTP /* |
This part of the job tells LISTSERV to whom you want the mail distributed. There are a few options for the addresses themselves as you've probably noticed. The basic syntax for an address in the "To DD" is as follows:
userid@host.domain [Personal Name] [BSMTP | PROBE]
for instance, any of the following are correct:
janecustomer@abc.com Jane Customer
janecustomer@abc.com BSMTP
janecustomer@abc.com PROBE
janecustomer@abc.com Jane Customer PROBE
The only part of this syntax that is required is the first token (userid@host.domain). You can follow it with the user's personal name, if available. Then you can add the token "BSMTP", which tells LISTSERV to use "Batch SMTP" processing for this address, or the token "PROBE", which tells LISTSERV to send the message to the specified address as a passive PROBE. Please note carefully that the BSMTP and PROBE options cannot be used together for the same address.
If you use the BSMTP option, it isn't necessary to specify a "personal name" as LISTSERV won't use it for anything. BSMTP jobs are sent out in the same manner as regular LISTSERV list mail for users who have the FULLBSMTP user option set; that is, the To: line of the mail contains the address you have specified on the To: line in the data (message text) portion of the RFDR job. This is the most efficient way to send mail via DISTRIBUTE as it "bundles" recipients into a few large outgoing jobs rather than creating a separate outgoing job for each recipient. If you need to "personalize" each message then you do not want to use the BSMTP option. However, most large RFDR jobs will probably be sent using BSMTP since it is more efficient.
If you do not use either BSMTP or PROBE and use just the e-mail address, e.g., janecustomer@abc.com or janecustomer@abc.com Jane Customer, the recipient's e-mail address will be specified in the To: field, regardless of what you define in the To: field header further down in the job. As noted above, this is an attractive way to do the mailings but uses FAR more resources since you are creating a separate outgoing copy of the message for each subscriber. The marketing benefits of personalized mail are obvious but not using BSMTP is something that you should test to see if the return is worth the cost. Utilizing BSMTP allows your job to be processed as if it were a traditional LISTSERV list and should be used when greatest efficiency is desired.
The "/*" at the end of the "To DD" is required and may not be omitted. It tells LISTSERV where the DD ends. It must be on a line by itself. If it does not exist in the job stream, the job will fail.
//Data DD *,EOF |
This card tells LISTSERV where the actual message begins. There is no end card for the "Data DD" as it ends at the end of the message you send the job in. This is important to note as it means that you must disable any signature file that normally is sent with your mail--otherwise it will appear as part of the RFDR job and be sent out!
Date: Tue, 13 Jan 1998 12:25:00 -0400 From: joe.techie@xyz.com Subject: Release of XYZ's WIDGET Model 2 Reply-to: joe.techie@xyz.com To: Widget Customers <customers@widget.com> |
Following the "Data DD" job card are the RFC822 message headers for your message. The only required headers here are Date:, From:, and To:. However, while you do not technically need to provide a Subject: or a Reply-To: field, you will probably want to do so for completeness' sake. There is no specified order for these header fields so you may arrange them as suits you best.
If you do not specify a value for the Date: line, but rather simply insert a "Date:" header without a following value, LISTSERV will insert its local time and date as of when it received the job for execution. In the following example:
Date: From: joe.techie@xyz.com Subject: Release of XYZ's WIDGET Model 2 Reply-to: joe.techie@xyz.com To: Widget Customers <customers@widget.com> |
LISTSERV will fill the Date: header in by itself. Otherwise LISTSERV will accept any Date: field you provide without comment. If on the other hand you do not at least specify a "Date:" header line, no date will be inserted at all.
If you do not specify a From: line, LISTSERV will insert a From: line containing the address of the command invoker (you!) unless you have specified a FROM= option in the DISTRIBUTE command (see either below or in the preceding technical section for specific DISTRIBUTE options), in which case the value of the DISTRIBUTE FROM= option will be inserted. It is probably wise in most cases to ensure that there is a From: line in the "Data DD" as otherwise the result may not be as you planned.
If you do not specify a To: line, LISTSERV will insert a To: line as follows:
To: Multiple recipients <LISTSERV@NODE>
where "NODE" is the NODE= value for your LISTSERV server. As with the From: line, this is probably not what you want people to see, so you have a couple of options. For jobs which contain only BSMTP recipients, you should specify a To: value, which should point back to a real address in case someone decides to write back to it. For instance, in our example above,
To: Widget Customers <customers@widget.com> |
and we'll assume that "customers@widget.com" is a customer-service address where people can write, or even an existing LISTSERV list out of which you've pulled a subset of addresses for this particular RFDR job.
If you have all non-BSMTP and non-PROBE recipients, you can simply leave the To: field blank (as with Date:, above) and LISTSERV will fill the field in with the data you've provided in the "To DD". For instance, in the following example,
Date: From: joe.techie@xyz.com Subject: Release of XYZ's WIDGET Model 2 Reply-to: joe.techie@xyz.com To: |
both the Date: and To: fields will be filled in by LISTSERV for you.
Please note that the blank line at the end of the RFC822 headers is not a misprint. According to RFC822 you MUST provide a blank line between the last header and the beginning of the message body, and LISTSERV expects it to be there. If it is not there, the job will fail with an RFC822 parser error:
> DISTRIBUTE MAIL
Invalid RFC822 field found in mail header: "Your text here--forgot blank line". Mail not delivered.
Finally, we get to the final element: the message body.
Your text here |
This element is fairly self-explanatory; you simply add the actual body of the message you are sending out. Again, make sure that there is a blank line between the body of the message and the last RFC822 header as mentioned previously.
9.3.1 RFDR Job Options
There are three options that might be of use in the JOB card (the first line of the RFDR job as noted above). These options are:
- ECHO=NO
This option suppresses the resource usage summary you would otherwise get upon completion of your delivery. Omitting it returns a mail message containing a summary like the following example to the e-mail address from which the RFDR job was sent.
Job "WIDGET1" started on 10 Feb 1998 13:33:34 Job "WIDGET1" ended on 10 Feb 1998 13:33:36 Summary of resource utilization CPU time: 0.000 sec Overhead CPU: 0.030 sec CPU model: 100MHz Pentium (64M) Job origin: joe.techie@XYZ.COM |
To use this option and suppress the summary from being sent, simply type ECHO=NO at the end of the JOB card, e.g.,
//WIDGET1 JOB ECHO=NO |
- PRIME=prime-time-specification
This option controls the time period(s) during which LISTSERV should not process the job.
Note: To all intents and purposes, this option is obsolete. It was originally designed for mainframe environments in which job scheduling was critically important, so that LISTSERV could process large jobs during non-"prime" time and not be a load on the processor during "prime" time. Therefore, and perhaps counter-intuitively to some, it defines the time period during which LISTSERV SHOULD NOT process the job. In modern versions of LISTSERV, the AFTER= RFDR job card option exists to help with scheduling jobs that should be held until a particular time and then released. Therefore the use of PRIME= is deprecated for that type of job. |
This function of this option is identical to the function of the "Prime=" keyword setting for LISTSERV mailing lists, where "Prime=" defines (on a list by list basis) times during which LISTSERV should not process mail for the list. By default this option is set to "PRIME=Yes", meaning that the job can be processed at any time. If you set this option to "PRIME=No", it uses the value set globally by LISTSERV's PRIMETIME= site configuration variable, which by default is set to have no prime time (in other words, by default, mail can still be processed at any time even with "PRIME=No"). The PRIME= option for RFDR jobs can be set to an explicit time definition if necessary. For instance, you might have a very large RFDR job (e.g., a newsletter) that should not be processed until after midnight (when network traffic is low and more machine resources are generally available).
RFDR jobs sent to LISTSERV during prime time are automatically held until non-prime time and then distributed normally, without requiring further intervention by anyone. For instance you could set the "PRIME=" option to
PRIME="MON-FRI: 00:00-23:59"
This means that you could send the job anytime during the regular work week--Monday morning through Friday afternoon--and know that it won't be distributed until Friday at midnight or shortly thereafter.
As another example, if you want the job only to be processed between midnight and 6 AM on weekends, you might set it to
PRIME="MON-FRI: 00:00-23:59; SAT-SUN: 06:00-23:59"
Note: The specifications for PRIME= must be enclosed in quotes and the format (spaces) should be identical to the examples. |
Important: You should always leave yourself at the very least an hour processing window, and even more so for large jobs, since PRIME checks are done once each hour, on the hour, and very large jobs may require extended processing time. However, you should also be aware that all jobs are checked for PRIME= time when they are received, and if they are within the allowed time window, they are executed immediately. |
General Notes: The default value for seconds in a PRIME time specification is zero. Therefore, specifying "00:00-23:59" is equivalent to specifying "00:00:00-23:59:00", not "00:00:00-23:59:59", and, in this example, there is actually a one-minute "window" each night between 23:59 and 00:00 in which an arriving job could be processed. You may code the seconds in the time specification if it is vitally important that no mail be processed during that one-minute "window".
Also note that if running in Network mode, even more time is required since jobs passed across the LISTSERV network for other servers to deliver also contain the PRIME setting, and depending on which time zone it is passed to, it may miss the "window" altogether. For example,
PRIME="MON-FRI: 00:00-23:59; SAT-SUN: 06:00-23:59"
leaves six hours of processing for your DISTRIBUTE job on Saturday and Sunday, i.e., 12 hours total processing time over the two days. So if the job does not get to, say, a server in Japan before the PRIME deadline on Saturday, it will be processed the next day during non-prime time. In actuality it is probably not necessary to use such small windows on the weekend, so
PRIME="MON-FRI: 00:00-23:59"
is probably all you would need for a job to be delivered over the weekend.
To use the PRIME option, simply type it following the JOB operand. If you need to specify ECHO=, note that it must follow PRIME= or a syntax error will result. For example:
//WIDGET1 JOB PRIME="MON-SUN: 09:00-23:59" ECHO=NO |
or
//WIDGET1 JOB PRIME="MON-SUN: 09:00-23:59" |
Make sure that you test the PRIME= option setting with test jobs first to make sure that the proper syntax is being used before sending mission critical jobs to be processed during off-prime hours.
- AFTER=time-spec
The preferred method of delaying a message's distribution is to use the AFTER= JOB card option. As noted in Section 2.3 The JOB Control Card, you can specify
- a time, e.g. 01:00 (the release date is assumed to be "today")
- a date, e.g. 2001-12-26 (the release time is assumed to be 00:00:00)
- a date and time together, in double quotes, e.g., "2001-12-26 01:00"
until which LISTSERV will hold the job.
Using AFTER= instead of PRIME= has the added advantage of not specifying a "window" of time during which the job can be processed which is propagated along with the job to other servers (which can delay distribution if the window is too small). Once the scheduled time arrives, the job will be processed without any consideration to how long it may take to run.
Examples:
//WIDGET1 JOB AFTER=01:00 ECHO=NO |
//WIDGET1 JOB AFTER=2001-12-26 ECHO=NO |
//WIDGET1 JOB AFTER="2001-12-26 01:00" ECHO=NO |
As with PRIME=, if ECHO= is specified, it should be the last token on the line.
9.3.2 DISTRIBUTE Command Options
There are six options that might be of use in the DISTRIBUTE command (the second line of the RFDR job as noted above). These options are:
- ACK=MAIL
This option tells LISTSERV to confirm deliveries with an acknowledgement sent by mail (the default is not to send delivery confirmations, but rather to simply acknowledge receipt and processing of the job), as in the following example (note that ECHO=YES in the JOB card for this particular example):
Job "WIDGET1" started on 10 Feb 1998 13:33:34 > DISTRIBUTE MAIL Mail delivered to janecustomer@abc.com Job "WIDGET1" ended on 10 Feb 1998 13:33:36 Summary of resource utilization ------------------------------- CPU time: 0.000 sec Overhead CPU: 0.030 sec CPU model: 100MHz Pentium (64M) Job origin: joe.techie@XYZ.COM |
Use of this option in the DISTRIBUTE command line is as follows:
DISTRIBUTE MAIL ACK=MAIL PW=XXXXXXXX |
Other than the default ACK=NONE, the only other setting for this option is "MSG", which is obsolete except for NJE servers.
- DEBUG=YES
This option produces a report showing how the various recipients will be routed over the LISTSERV backbone, but WITHOUT actually delivering the message. Before sending out your actual posting, you may want to send the RFDR job with this option enabled to see how the mail will be routed.
Examples of the use of this option in the DISTRIBUTE command line:
DISTRIBUTE MAIL ACK=MAIL DEBUG=YES PW=XXXXXXXX |
DISTRIBUTE MAIL DEBUG=YES PW=XXXXXXXX |
- TRACE=YES
This option produces a report showing how the various recipients will be routed over the LISTSERV backbone, and actually delivers the message (similar to DEBUG=YES but the message is actually delivered).
Examples of the use of this option in the DISTRIBUTE command line:
DISTRIBUTE MAIL ACK=MAIL TRACE=YES PW=XXXXXXXX |
DISTRIBUTE MAIL TRACE=YES PW=XXXXXXXX |
- FROM=netaddress
This option can point to a particular address that will receive the bounced mail, notifications of delivery problems, etc. Specifically this option sets the RFC821 MAIL FROM: address to which all compliant mailers will bounce non-deliverable mail. The single parameter netaddress is an Internet address in the standard format (userid@host.domain).
Examples of the use of this option in the DISTRIBUTE command line:
DISTRIBUTE MAIL ACK=MAIL TRACE=YES FROM=john@example.com PW=XXXXXXXX |
DISTRIBUTE MAIL FROM=john@example.com PW=XXXXXXXX |
DISTRIBUTE MAIL ACK=MAIL FROM=john@example.com PW=XXXXXXXX |
DISTRIBUTE MAIL TRACE=YES FROM=john@example.com PW=XXXXXXXX |
- AV=YES|NO
Requires LISTSERV Classic/Classic HPO, with LISTSERV's anti-virus feature enabled.
By specifying "AV=YES", you direct LISTSERV to check the message for viruses and terminate distribution if ANY errors occur. This includes internal virus scanner errors that do not necessarily indicate the presence of a virus, out of memory errors, invalid base64 data errors, you name it.
While very safe, there is obviously the drawback that critical messages may be suppressed due to problems within the virus scanner. It should be up to the customer to decide what to do in such cases. "AV=YES,FORCE" tells LISTSERV to stop ONLY if a virus has been found. The drawback is that viruses may be let through if there was a problem with the virus checker (this includes expired maintenance), insufficient memory, or any other problem that would otherwise have caused LISTSERV to terminate the distribution. For obvious reasons, therefore, L-Soft does not recommend the indiscriminate use of the FORCE option.
"AV=NO" is also available, but does not need to be explicitly coded. This is the default and the only valid option for DISTRIBUTE of an NJE FILE (z/VM only) and DISTRIBUTE RFC822 (although it is doubtful that this DISTRIBUTE type is used by anyone anymore).
This option is not forwarded. It is compatible with the backbone, but checking occurs only at the originating site.
IMPORTANT for mail-merge: For performance reasons, virus checking is done only once, not for each recipient after substitution. It is theoretically possible for a virus to escape undetected if it is constructed from a combination of message text and substitution data, especially if the substitution comes from a database. In addition, certain types of sophisticated mail-merge jobs may incorrectly raise the invalid MIME data error. This could happen if the base64 data were fetched from a database, or if it were included in a .BB/.EB block. Again, all you need to remember is that LISTSERV scans the message template rather than the X million individual substituted messages, so viruses that do not exist in the template will not be detected. The expected usage for correct scanning is something like this: .BB whatever --blah boundary WDVPIVAlQEFQWzRcUFpYNTQoUF4pN0NDKTd9JEVJQ0FSLVNUQU5EQVJELUFO |
- DKIM=NO|YES
Requires LISTSERV Classic/Classic HPO with LISTSERV's DomainKeys Identified Mail (DKIM) signing engine enabled (see Section 12 Using DomainKeys Identified Mail (DKIM with LISTSERV for implementation details).
This option controls whether or not LISTSERV will sign outbound messages with DKIM. The default is DKIM=NO.
If enabled, DKIM signing will fail in two cases:
- If running a LISTSERV version without DKIM support; or
- If running a LISTSERV version with DKIM support, but with the DKIM engine disabled.
Otherwise DKIM signing always succeeds. Messages originating from domains for which LISTSERV has been configured to sign will be signed, while those originating from other domains won't be.