procmail
[Top] [All Lists]

Suggestions on distribution list setup

2000-09-03 22:41:46

I have written a recipe that I would like the gurus on this list to
look over and make any suggestions.  This is my first post to the
list and recipe not pulled from the procmailrc so please don't hold
back. :)


BACKGROUND:

I have used an OpenVMS system with PMDF mail that allows users to
create their own distribution lists using the format of
<username+DIS_LIST(_at_)domain(_dot_)tld>.  The DIS_LIST is typically a personal
alias that includes the content of a file containing an email address
per line.  I am trying to duplicate this functionality with procmail
on a Solaris/sendmail/procmail machine.  I am trying to make this a
simple to the users as I can.  (please, don't laugh at my futile
attempts. :)  Procmail is the LDA and 99.9% of the users do not use a
.procmailrc file.

When we release this for the users, we would have a script they would
run that sets up the files in their accounts.


Below is the what I have done so far.  Please look over and offer any
suggestions for improvement.

The directory structure looks like this

user's home directory
  .procmailrc
  .procmail/
    pm/                 # Jari's procmail module library
      pm-jaaddr.rc      # These will probably be moved to a system
      pm-javar.rc       # directory when this is implemented system wide
    rc/
      distribution.rc   # my hack of a recipe (credit goes to tip 19.2
                        # of Jari's tips).  Again moved to a system dir
  lists/
    DIS_NAME.dis        # list of email addresses; one to a line
    DIS_NAME.txt        # list of headers used by formail



************
Start of a user's .procmailrc file
************
#
# Directory for storing procmail related files
PMDIR           = $HOME/.procmail
RCDIR           = $PMDIR/rc

#
# Put ## before LOGFILE if you want no logging (not recommended)
LOGFILE         = $PMDIR/log

SHELL           = /bin/sh
PATH            = /bin:/usr/bin
FORMAIL         = /usr/local/bin/formail

MAILDIR         = $HOME/mail
DEFAULT         = $HOME/.mail.mai

USERNAME        = `/usr/ucb/whoami`
DOMAIN          = `cat /usr/local/etc/domainname`
EMAIL           = $USERNAME(_at_)$DOMAIN

DATE            = `date '+%a, %d %h %Y %H:%M:%S %Z'`

# Procmail include files (recipes to include)
##INCLUDERC     = $RCDIR/testing.rc
INCLUDERC       = $RCDIR/distribution.rc        # allow "+" distribution lists


**********
End of .procmailrc file
**********

**********
Start of user's ~/procmail/rc/distribution.rc file
**********

MSRC   = $HOME/.procmail/pm
RC_ADDR = $PMSRC/pm-jaaddr.rc

# First test for existence of the ~/lists directory
# if not there, then they do not have any +lists to
# process
:0
* ? test -d $HOME/lists
*   ^TO()\/(_dot_)*(_at_)(_dot_)*
{
    INPUT = $MATCH

    # Turn off the logging while executing this part
    VERBOSE="off"
    INCLUDERC = $RC_ADDR
    VERBOSE="on"

    :0
    * ERROR ?? yes
    {
        # Hmm, no std email address found. Any other ideas?
    }

    # ACCOUNT2 is string after the + and before the @
    # null if non present
    DIS_NAME    = $ACCOUNT2

    # Test to see if message has a string after the +
    :0
    * ? test $ACCOUNT2
    {
        INCLUDERC       = $HOME/lists/$DIS_NAME.txt

        :0 fhw
        *$ !^X-List: $ADDRESS
        |  $FORMAIL                                \
            -A "X-List: $ADDRESS"                  \
            -i "Resent-Date: $DATE"                \
            -I "Errors-To: $DIS_ERR"               \
            -I "Resent-To: $DIS_ADDR"              \
            -A "Precedence: bulk"
    }

    :0 a
    ! -oi `cat $HOME/lists/$DIS_NAME.dis`

**********
End of user's ~/procmail/rc/distribution.rc file
**********


**********
Start of user's ~/lists/DIS_NAME.dis
**********

John Doe <john(_dot_)doe(_at_)whatever(_dot_)domain>
Jane Doe <Jane(_dot_)doe(_at_)someother(_dot_)domain>

**********
End of user's ~/lists/DIS_NAME.dis
**********


**********
Start of user's ~/lists/DIS_NAME.txt
**********

DIS_TITLE       = "Derek's distribution list test"
DIS_ADDR        = "$DIS_TITLE <$USERNAME+$DIS_NAME(_at_)$DOMAIN>"
DIS_ERR         = "$EMAIL"        # my admin address

**********
End of user's ~/lists/DIS_NAME.txt
**********



Am I doing something backwards?  Any areas of improvement?

Where would the best place be if I wanted to create a file that
contained a list of mailing address that were the only ones allowed to
send to the list?


TIA,
Derek


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Suggestions on distribution list setup, Derek Diget <=