• Antelope Release 5.5 Mac OS X 10.8.5 2015-04-21

 

NAME

mail_parser_wrapper- script run by sendmail to launch mail_parser

SYNOPSIS

mail_parser_wrapper

SUPPORT


Contributed code: NO BRTT support.
THIS PIECE OF SOFTWARE WAS CONTRIBUTED BY THE ANTELOPE USER COMMUNITY. BRTT DISCLAIMS ALL OWNERSHIP, LIABILITY, AND SUPPORT FOR THIS PIECE OF SOFTWARE.

FOR HELP WITH THIS PIECE OF SOFTWARE, PLEASE CONTACT THE CONTRIBUTING AUTHOR.

DESCRIPTION

This script is used to set the environment properly so that mail_parser(1) will run, when mail_parser(1) is used to handle an automatic email account. It may be necessary to edit this script slightly to account for local differences in sendmail(1) setup. Installing mail_parser(1) to handle mail for a given email account may be as simple as opening a .forward file in the home-directory of the account, containing the path to the mail_parser(1) command: for example
% cat /home/aeicauto/.forward
kent@giseis.alaska.edu, "|/home/aeicauto/mail_parser_wrapper || exit 75"
Note that this assumes a copy of mail_parser_wrapper has been placed in the relevant home directory. Making a local copy is useful if any edits are necessary, for example to environment variables. Usually it is necessary to remove group and world write permission from the mail_parser_wrapper executable and from the .forward file. The mail_parser_wrapper may also be launched via procmail(1), approximately as follows. First, forward recipients mail to procmail:
% cat ~/.forward
"|IFS=' ' && exec /usr/local/bin/procmail -f- || exit 75 #user"
Second, run the mail_parser_wrapper from within a procmail rule:
% cat /home/rt/.procmailrc
:0:
* ^X-Spam-Flag: Spam YES
Imapmail/Spam

:0w
|/home/rt/mail_parser_wrapper
Of course, one might want to put procmail filter rules into this to send only certain emails to the mail_parser. This should probably be considered a pre-filtering operation since the mail_parser(1) itself does some subsetting of mails based on subject and sender. Note that to deliver a carbon copy of the email to the user, in addition to sending the mail off to mail_parser, one should use the procmail 'c' flag:
:0cw
|/home/rt/mail_parser_wrapper

SEE ALSO

mail_parser(1), autodrm(1), autodrm_wrapper(1)

BUGS AND CAVEATS

In practice, setting up automatic mail handling may require other cooperation from your system administrator depending on which sendmail(1) security features are activated. Make sure that the permissions are set appropriately on .forward, .procmailrc, and mail_parser_wrapper to allow them to be invoked by system mail utilities (oftentimes a .forward file is ignored if the permissions are not set to the satisfaction of the mail delivery agent).

AUTHOR

Kent Lindquist
Lindquist Consulting
This script is modeled on the Antelope autodrm_wrapper script by Dan Quinlan.
Antelope User Group Contributed Software
Printer icon