mailAddress

Suppose as an instructor of two courses this semester I would like to keep the mail for them in separate mailboxes.

The following method is an easy way of doing this, provided the senders use the proper address.

Lets have mail send to doug-usa2004@mscs.mu.edu be saved in the "mailbox" file Mailbox-usa2004 in my home directory, and mail sent to doug-ent2004 be saved in the "mailbox" file Mailbox-ent2004 in my home directory.

Merely create the empty file Mailbox-usa2004 in my home directory and then create the file .qmail-usa2004 which gives instructions to deliver to that mailbox.

If I would prefer "maildir" type delivery the .qmail-usa2004 could have the line ./Maildir/ instead. The first email received at that address will create the proper directory and its contents.

zipped source code

Code links

.qmail-usa2004
Mailbox-usa2004

Listings

.qmail-usa2004
./Mailbox-usa2004

Mailbox-usa2004
From doug@mscs.mu.edu Tue Oct 12 06:09:55 2004
Return-Path: <doug@mscs.mu.edu>
Delivered-To: doug-usa2004@studsys.mscs.mu.edu
Received: (qmail 7575 invoked by uid 199); 12 Oct 2004 06:09:55 -0000
Date: Tue, 12 Oct 2004 01:09:55 -0500
From: John Douglas Harris <doug@studsys.mscs.mu.edu>
To: doug-usa2004@studsys.mscs.mu.edu
Message-ID: <20041012010955.A7572@studsys.mscs.mu.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i

root::0:root
other::1:
bin::2:root,bin,daemon
sys::3:root,bin,sys,adm
...
dba::5500:
oinstall::5501:oracle
cvsdev::5502:mscsacct

From doug@cpe-69-76-74-214.wi.rr.com Tue Oct 12 06:17:45 2004
Return-Path: <doug@cpe-69-76-74-214.wi.rr.com>
Delivered-To: doug-usa2004@mscs.mu.edu
Received: (qmail 7685 invoked from network); 12 Oct 2004 06:17:45 -0000
Received: from cpe-69-76-74-214.wi.rr.com (69.76.74.214)
  by mailhost.mscs.mu.edu with SMTP; 12 Oct 2004 06:17:45 -0000
Received: (qmail 2701 invoked by uid 500); 12 Oct 2004 06:17:09 -0000
Date: Tue, 12 Oct 2004 01:17:09 -0500
From: Douglas Harris <doug@dougharris.net>
To: doug-usa2004@mscs.mu.edu
Message-ID: <20041012061709.GA2695@dougharris.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.4i

root:x:0:root
bin:x:1:root,bin,daemon
daemon:x:2:root,bin,daemon
...
doug:x:500:
radvd:x:75:
nofiles:x:501:
qmail:x:502: