tinitial tree - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 4db31855e7fde9a087fb59e761743420aaa3743b
 (DIR) parent eadb18a3357b9b735b2f7da478854a39fb0c73c6
 (HTM) Author: rsc <devnull@localhost>
       Date:   Sun, 12 Feb 2006 19:45:56 +0000
       
       initial tree
       
       Diffstat:
         A mail/lib/ignore                     |      16 ++++++++++++++++
         A mail/lib/namefiles                  |       3 +++
         A mail/lib/names.local                |       5 +++++
         A mail/lib/qmail                      |       6 ++++++
         A mail/lib/remotemail                 |      14 ++++++++++++++
         A mail/lib/rewrite                    |      29 +++++++++++++++++++++++++++++
       
       6 files changed, 73 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/mail/lib/ignore b/mail/lib/ignore
       t@@ -0,0 +1,16 @@
       +Mime-Version:
       +Content-
       +Message-Id:
       +Received:
       +Mailer:
       +References:
       +Precedence:
       +X-
       +X400-
       +O-
       +List-
       +Organization:
       +User-Agent:
       +In-Reply-To:
       +Delivered-To:
       +DomainKey-Signature:
 (DIR) diff --git a/mail/lib/namefiles b/mail/lib/namefiles
       t@@ -0,0 +1,3 @@
       +# files listed here will be consulted for aliases
       +
       +names.local
 (DIR) diff --git a/mail/lib/names.local b/mail/lib/names.local
       t@@ -0,0 +1,5 @@
       +# alias file, listed in /mail/lib/namefiles
       +
       +# postmaster goes to glenda
       +postmaster        glenda
       +
 (DIR) diff --git a/mail/lib/qmail b/mail/lib/qmail
       t@@ -0,0 +1,6 @@
       +#!/usr/local/plan9/bin/rc
       +# qmail sender machine user...
       +rfork s
       +upas/vf | upas/qer $PLAN9/mail/queue smtp $* || exit 'qer failed'
       +upas/runq -n 10 $PLAN9/mail/queue $PLAN9/mail/lib/remotemail </dev/null >/dev/null >[2=1] &
       +exit ''
 (DIR) diff --git a/mail/lib/remotemail b/mail/lib/remotemail
       t@@ -0,0 +1,14 @@
       +#!/usr/local/plan9/bin/rc
       +shift
       +sender=$1
       +shift
       +addr=$1
       +shift
       +fd=`{upas/aliasmail -f $sender}
       +switch($fd){
       +case *.*
       +        ;
       +case *
       +        fd=YOURDOMAIN.DOM
       +}
       +exec upas/smtp -h $fd $addr $sender $* 
 (DIR) diff --git a/mail/lib/rewrite b/mail/lib/rewrite
       t@@ -0,0 +1,29 @@
       +#
       +#        sample rewrite file for systems that send mail to a mail server or gateway
       +#        for delivery.  we assume the mail server handles incoming messages.
       +#
       +#        by default the return address points to this system; set $site
       +#        to the name of the mail server that receives your mail.
       +#
       +#        replace YOURDOMAIN.DOM with the name of your domain.
       +#
       +#        in the last rule, $smtp is the name of the mail server.  set it
       +#        in the DNS database in $PLAN9/lib/ndb (see ndb(7)).
       +
       +# translate local aliases from /mail/lib/namefiles
       +[^!@.]+                        translate        "$PLAN9/bin/upas/aliasmail '&'"
       +
       +# append the local domain to addresses without a domain
       +local!(.*)                alias                \1@swtch.com
       +
       +# convert source domain address to a chain a@b@c@d...
       +@([^@!,]*):([^!@]*)@([^!]*)                alias        \2@\3@\1
       +@([^@!]*),@([^!@,]*):([^!@]*)@([^!]*)        alias        @\1:\3@\4@\2
       +
       +# convert a chain a@b@c@d... to ...d!c!b!a
       +([^@]+)@([^@]+)@(.+)        alias                \2!\1@\3
       +([^@]+)@([^@]+)                alias                \2!\1
       +
       +# send all mail to the gateway or mail server, $smtp,  for delivery
       +([^!]*)!(.*)                 |                 "$PLAN9/mail/lib/qmail '\s' 'tcp!holo.morphisms.net!5356'" "'\2@\1'"
       +