Alternative Delivery Programs

Users may want incoming mail passed to a program instead of to their mailbox. For example, users may want their incoming mail sent to a mail sorting program like Personal Postmaster and procmail, or to a auto-reply agent like Vacation Notice. Alternative delivery programs can be added to the user interface using the
imta program command (see "To Make Delivery Programs Available to Users" on page 102 and "To Use Alternative Delivery Programs" on page 281). Alternative delivery programs must, however, conform to the following exit code and command line argument restrictions:

Exit codes: If the subprocess exits with exit code of 0 (EX_OK), the message is presumed to have been delivered successfully and is removed from IMTA's queues. If it exits with an exit code of 71, 74, 75, or 79 (EX_OSERR, EX_IOERR, EX_TEMPFAIL, or EX_DB), a temporary error is presumed to have occurred and delivery of the message is deferred. If any other exit code is returned, then the message will be returned to its originator as undeliverable. These exit codes are defined in the system header file sysexits.h.

Command Line Arguments: Delivery programs can have any number of fixed arguments as well as the variable argument, %s, representing user name for programs executed by the user or username+programlabel (programlabel is a string that refers to the particular program) for programs executed by the postmaster, "inetmail." For example, the following command line delivers a recipient's mail using the program procmail:

/usr/lib/procmail -d %s


 

To Make Delivery Programs Available to Users

These procedures add a delivery program to the User Profile described in "To Use Alternative Delivery Programs" on page 281.

  1. Obtain delivery program executable.
  Program must conform to the format specified in "Alternative Delivery Programs" on page 102.
  2. Create a symbolic link from the actual executable to
/opt/SUNWmail/imta/programs
  Make sure the actual executable has execute permissions for "others."
  3. Use the imta program -a command to add a new delivery program option.
  Run imta program as root or inetmail (see SIMS Reference Manual for details). The format is as follows:
  imta program -a -m method_name -p program_name [ -g argument_list ] [ -e execute_permission ]
  a. Examples:
  Add a delivery program called procmail1, which executes the program procmail in the programs directory. Use the argument -d username, and make this program execute as the user. Use the -e user argument so that this option is available only to mail users with UNIX accounts:
  % imta program -a -m procmail1 -p procmail -g "-d %s" -e user
  Add a delivery program print_hickory, which executes the program lp with the arguments -d hickory. Make this program option available to all mail users.
  % imta program -a -m print_hickory -p lp -g "-d hickory"
  4. Optional: Add a description of the delivery program.
  Write a description of the delivery program--what it does, what it's used for, how to use it, and so forth. Put the information in a help file called method_name.html in
/opt/SUNWmail/imta/programs/locale/{en} (change locale as necessary). The file need only be a "partial" html file (example below). The contents will be added to the Delivery Programs Options page. In addition to a text description of the program, you can also add a hypertext link to another help file.
  a. Example 1:
  This file, procmail1.html, provides a description of procmail and hypertext link to the procmail man page.

 
< p ALIGN="right" > 
 
< a href="http://tools/man/procmail"> help < /a > 
 
< p ALIGN="left" > 
 
procmail1 is an email sorting program which is available for UNIX 
users only.
 
< /p > 
 

  b. Example 2:
  This file, print_hickory.html, provides a description of print_hickory.

 
< p > 
print_hickory sends your mail to the printer, hickory
< /P >
 

  5. Do a full directory synchronization to add the newly created delivery programs to the database and make them available to users.
  # imta dirsync -F

Refer to Chapter 10, "User Administration" for details on how users can choose these delivery programs.




Copyright © 1999 Sun Microsystems, Inc. All Rights Reserved.