Home | History | Annotate | Line # | Download | only in scripts
      1  1.1  christos # -*- perl -*-
      2  1.1  christos ##############################################################################
      3  1.1  christos #									     #
      4  1.1  christos #			CONFIGURABLE VALUES				     #
      5  1.1  christos #									     #
      6  1.1  christos ##############################################################################
      7  1.1  christos 
      8  1.1  christos $MAILGRUNT="postmaster";	# To whom to send log mail if mail is prefered.
      9  1.1  christos 
     10  1.1  christos $TMPDIR="/tmp/";		# Place lostmail can do its dirty work.
     11  1.1  christos 
     12  1.1  christos $LOCAL_LOCK_EXT=".lock";	# Name of file local mailer uses to lock
     13  1.1  christos 				# spool file.  This the correct setting for
     14  1.1  christos 				# /bin/mail
     15  1.1  christos 
     16  1.1  christos $SYSTEM_FROM_ADDRESS="Mailer-Daemon";
     17  1.1  christos 
     18  1.1  christos $MAILDIR="/var/alt_mail";	# What directory should I run out of.
     19  1.1  christos $MAILER='/usr/lib/sendmail -t'; # Which mailer should I use.
     20  1.1  christos 
     21  1.1  christos $LOCALMAILJUNK='.*~|\#.*|core';	# Files name patterns that might appear in 
     22  1.1  christos 				# alt_mail and should be ignored. This REGEXP
     23  1.1  christos 				# gets or'ed with $MAILJUNK below.
     24  1.1  christos 
     25  1.1  christos $SMTPHOST='localhost';		# The name of a local host which speaks SMTP
     26  1.1  christos 				# and knows *all* your aliases. You probably
     27  1.1  christos 				# don't want to change this.  If the machine
     28  1.1  christos 				# running lost_alt mail doesn't run an SMTP,
     29  1.1  christos 				# daemon then something is either wrong or you
     30  1.1  christos 				# should be setting `noverify' to prevent
     31  1.1  christos 				# SMTP verification.
     32  1.1  christos 
     33  1.1  christos $HOSTNAME='localhost';		# Hostname to use for SMTP HELO 
     34  1.1  christos 
     35  1.1  christos # Subject of lost log mail message. Must define $MAILGRUNT.
     36  1.1  christos # I overwrite this variable in the subroutine Clean_up. Please make sure I
     37  1.1  christos # haven't noodle-headdly forgotten to remove that hack in the distribution!
     38  1.1  christos # No newline here please. The script will insert it for you.
     39  1.1  christos $LOG_SUBJECT="Log of lostmail resends";
     40  1.1  christos 
     41  1.1  christos ##############################################################################
     42  1.1  christos #									     #
     43  1.1  christos #			DEFAULTED CONFIGURATIONS			     #
     44  1.1  christos #									     #
     45  1.1  christos ##############################################################################
     46  1.1  christos 
     47  1.1  christos $LOGFILE="$TMPDIR" . "lostlog";
     48  1.1  christos 
     49  1.1  christos 
     50  1.1  christos # MAILJUNK is a pattern of ignorable alt_mail files which are either common
     51  1.1  christos # to most platforms or actually produced by this script.  You should customize
     52  1.1  christos # this REGEXP by hacking at $LOCALMAILJUNK above.
     53  1.1  christos $MAILJUNK='[a-z]\.[0-9]*|\.\.?|lost\+found';
     54  1.1  christos 
     55  1.1  christos $LOCKEXT=".lostlock";		# our lock file extension. Should not need to
     56  1.1  christos 				# modify
     57  1.1  christos 
     58  1.1  christos $MESSAGE_DELIM="^From[^:]";	# /bin/mail message delimiter. Your milage
     59  1.1  christos 				# may differ
     60  1.1  christos 
     61  1.1  christos $HEADER_BODY_DELIM="\n";	# RFC 822 header-body delimiter.
     62  1.1  christos 
     63  1.1  christos $RESENT_TO="Resent-To: ";	# 
     64  1.1  christos $RESENT_FROM="Resent-From: ";	# Resent headers (RFC 822).
     65  1.1  christos $RESENT_DATE="Resent-Date: ";	#  You probably don't want to muck with these.
     66  1.1  christos $RESENT_INFO="X-Resent-Info: ";	# (special one to alert folks about mail).
     67  1.1  christos 
     68  1.1  christos 
     69  1.1  christos ##############################################################################
     70  1.1  christos #									     #
     71  1.1  christos #			LOSTMAIL DEFINITIONS (DON'T TOUCH)		     #
     72  1.1  christos #									     #
     73  1.1  christos ##############################################################################
     74  1.1  christos 
     75  1.1  christos $FALSE=0;
     76  1.1  christos $TRUE=(! $FALSE);
     77  1.1  christos 
     78  1.1  christos $OK=$TRUE;
     79  1.1  christos $ABORT_RESEND=2;
     80  1.1  christos $LOCK_RETRIES=10;	# The number of seconds/retries lost mail
     81  1.1  christos 				#  should wait before requeing or aborting a
     82  1.1  christos 				# resend.
     83  1.1  christos 
     84  1.1  christos TRUE;				# Ansures true return from include file.
     85