Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

rdeliver(1) [debian man page]

rdeliver(1)						      General Commands Manual						       rdeliver(1)

NAME
rdeliver - Ruby mail filter script SYNOPSYS
rdeliver <options> [script] DESCRIPTION
This script serves as an example of how you can use the RFilter::DeliveryAgent class to perform mail delivery. You can also use this script as a fully functioning mail filter. This script is a basic mail local delivery agent (DeliveryAgent) that can be used in place of procmail, maildrop, etc. in a user's .forward or .qmail file. The user supplies a delivery script that is written in Ruby, which avoids the limitations of the crippled mini-languages so often used in other DeliveryAgent programs. USAGE
rdeliver is invoked from the command line using: % rdeliver <options> [script] The script argument is optional. If omitted the script will look for a file called .rdeliver in the home directory. Options are: --load-path directory Prepend the given directory to ruby's load path. --log filename Log to the given filename. If no log is specified, no logging occurs. --home directory Specify the home directory. rdeliver will change to this directory before reading and writing any files. The home directory defaults to the value of the HOME or LOGDIR environment variable. DELIVERY SCRIPT
The delivery script runs in the context of a class called Deliver (in contrast, most ruby scripts run in the context of the Object class). So any methods added with def will be added to the Deliver class. A minimal delivery script would be: def main agent.save('inbox') end This code defines a Deliver#main method that saves the mail into an mbox style mailbox. The only API the Deliver script has is the #agent method. This retrieves the RFilter::DeliveryAgent object associated with the current message. Using the API of the RFilter::DeliveryAgent object, you can access and modify the message body and headers, defer or reject the message delivery, and deliver into various mailbox formats. See also RFilter::DeliveryAgent and Deliver. INSTALLATION
Assuming you have the RubyMail mail classes installed, you typically have to put something like this in your .forward file: |"/usr/bin/rdeliver --log /home/you/.rlog" This will call rdeliver for each new message you get, and log to /home/you/.rlog. CATASTROPHIC ERRORS
The rdeliver script is very careful with errors. If there is any problem, it logs the error to the log file you specify. But if you do not specify a log file, or the error occurs before the log file is opened, a record of the error is placed in a file called CATASTROPH- IC_DELIVERY_FAILURE in the home directory. If that fails, the error information is printed to the standard output in the hopes that it will be part of a bounce message. In all cases, the exit code 75 is returned, which tells the MTA to re-try the delivery again. AUTHOR
rdeliver and RFilter support classes were written by Matt Armstrong <matt@lickey.com>. This document was originally an RD format document of rdeliver script. This manual page was converted from it for Debian GNU/Linux system. September 2003 rdeliver(1)

Check Out this Related Man Page

TMAIL(1)						      General Commands Manual							  TMAIL(1)

NAME
tmail - Mail Delivery Module SYNOPSIS
tmail [-b format] [-D] [-f from_name] [-I inbox_specifier] user[+folder] ... DESCRIPTION
tmail delivers mail to a user's INBOX or a designated folder. tmail may be configured as a drop-in replacement for binmail(1), mail.local(1) or any program intended for use for mail delivery by a mail delivery program such as sendmail(8). tmail is intended to be used for direct delivery by the mailer daemon; dmail(1) is the preferred tool for user applications, e.g. a mail delivery filter such as procmail(1). If tmail is used for a user application, then the calling program must be aware of the restrictions noted below. When tmail exits, it returns exit status values to enable the mail delivery program to determine whether a message was delivered successfully or had a temporary (requeue for later delivery) or permanent (return to sender) failure. If the +folder extension is included in the user argument, tmail will attempt to deliver to the designated folder. If the folder does not exist or the extension is not included, the message is delivered to the user's INBOX. If delivery is to INBOX and no INBOX currently exists, tmail will create a new INBOX, using the -I or -b flag if specified. tmail recognizes the format of an existing INBOX or folder, and appends the new message in that format. The -b flag specifies a format to create INBOX if INBOX does not already exist. This flag requires privileges, and can not be used with -I. The argument is a format name such as mix, mbx, etc. The -D flag specifies debugging; this enables additional message telemetry. The -f or -r flag is used by the mail delivery program to specify a Return-Path. The header Return-Path: <from_name> is prepended to the message before delivery. The -I flag is used by the mail delivery program to specify an alternative INBOX name. This flag requires privileges, and can not be used with -b. This affects the location and format of INBOX. If specified, it should be in one of three forms: The first form of argument to -I is the string "INBOX", which means to write to the system default inbox using the system default mailbox format. These system defaults are defined when the c-client library is built. The second form of argument to -I is a delivery specification, consisting of "#driver.", a c-client mailbox format driver name, "/", and a file name. This will write to the specified file in the specified format. For example, #driver.mbx/INBOX will write to file "INBOX" in the home directory in mbx format; and #driver.unix/mail/incoming will write to file "incoming" in the user's "mail" subdirectory in unix (default UNIX) format. The third form of argument to -I is any other name. Normally, this will write to the specified file on the user's home directory in the specified format. However, certain names are special. These are: value equivalant to ----- ------------- INBOX.MTX #driver.mtx/INBOX.MTX mbox #driver.unix/mbox mail.txt #driver.tenex/mail.txt If -I is not specified, the default action is -I INBOX. If multiple recipients are specified on the command line, tmail spawns one child process per recipient to perform actual delivery. This way of calling tmail is not recommended; see below under RESTRICTIONS. INSTALLATION
If tmail is to be used for mail delivery from the mail delivery program, it must be installed setuid root. If sendmail is the mail delivery program, tmail is invoked from sendmail.cf. Look for the "Mlocal" line, and substitute the path name for the tmail binary in place of /bin/mail, /usr/lib/mail.local, etc. You should also add the flag to invoke tmail with CRLF style newlines; this is usually done with E= in the Mlocal line. Here is an example of an Mlocal line in sendmail version 8: Mlocal, P=/usr/local/etc/tmail, F=lsDFMAw5:/|@qPrn+, S=10/30, R=20/40, E= , T=DNS/RFC822/X-Unix, A=tmail $u If tmail is to be called with the -I flag, it must be invoked with both real and effective UID root. Many sendmail configurations invoke the local mailer as the sending user when that user is local, which will prevent -b or -I from working. SECURITY CONSIDERATIONS
If tmail is invoked by an ordinary user, the Received: header line will indicate the name or UID of the user that invoked it. Ordinary users are not permitted to use the -b or -I flag since otherwise a user could create any file on another user's directory. tmail can deliver mail to home directories. In addition, tmail can be used to deliver mail to other mail folders in a home directory or an inferior directory of a home directory. RESTRICTIONS
The calling program should invoke tmail with CRLF newlines, otherwise tmail will complain in syslog. Absolute pathnames and ~user specifications are not permitted in +folder extensions. Ordinary users are not permitted to use the -I flag. IMAP4 namespace names are not yet supported in +folder extensions. It is not possible to use tmail to deliver to mh(1) format mailboxes. If delivery to multiple users is specified and delivery to any single user fails, the entire delivery will be reported as having failed, even though delivery to other users may have succeeded. If tmail is used for mail delivery from sendmail(8), a separate tmail invocation should be done for each user. Otherwise a delivery failure for a single user in a message going to multiple users will cause multiple deliveries to all the other users every time sendmail(8), retries. AUTHOR
Mark Crispin, MRC@CAC.Washington.EDU SEE ALSO
binmail(1) sendmail(8) September 27, 2007 TMAIL(1)
Man Page