Hal Fulton <hal9000@hypermetrics.com> writes:
But the problemn is: How do you then manage all of those email
accounts?
If I have to check each email address one by one, I won't be using
this schema as well; it's simply too time-consuming. Instead, I have
it so my mail server puts emails to various mailboxes depending on the
local part of the recipient. So, from end-user experience, it'd be
very similar to how that end-user manage multiple mailboxes so far.
work@foobar would be accessed at mailbox 'work', ruby-talk@foobar is
in mailbox 'ruby-talk', and so on.
My mail server is qmail, and I have it use the script below to route
all emails for @foobar to their proper mailboxes. And I have not
changed this script in any meaningful way since 4 years ago, even as I
was churning out email addresses. One routing rule for forever (ok,
that's stretching it, but one rule is for a long time).
When you look for something that someone mailed you, how
do you ever find it? Hal
Since these are just ordinary mailboxes, you can use your email client
to search through these mailboxes just like what you are doing
now. There are also email clients that would notify you of new emails
in any mailboxes.
At least, the email client included with mozilla allows you to search
through mailboxes, but I'm not sure if it would also notify you of new
emails in any mailboxes.
Ideally, your email client would also support multiple identities. I
have my email clients, Gnus, configured so that the From addresses in
emails I'm composing are computed from the current open mailbox. If I
compose an email while in the ruby-talk mailbox, the computed From
address would be similar to the address I used to subscribe to
ruby-talk ML.
YS.
(abbreviated script)
#!/bin/sh
MAILDIR=~/Maildir
# Put an email in this mailbox if can't find out which mailbox it should
# belong to.
CATCHALL_FOLDER_NAME="" # "" indicates the IMAP's INBOX mailbox
# qmail put the local part after the first '-' in $EXT
FOLDER_NAME=""
if [[ -n "$EXT" ]]; then
# pr@domain ---by qmail--> ysantoso-pr@domain ---by this script --> pr
FOLDER_NAME=`echo ${EXT} | tr -cd [:alnum:] | tr [:upper:] [:lower:]`
fi
FOLDER_DIR=${MAILDIR}/.${FOLDER_NAME}
if [[ ! -d ${FOLDER_DIR} ]]; then
# Used to autocreate non-existent mailboxes. But no more since spams
# passing by spam filter could cause various folders to be created.
# maildirmake.maildrop -f $FOLDER_NAME $MAILDIR > /dev/null || true
FOLDER_DIR=${MAILDIR}/.${CATCHALL_FOLDER_NAME}
fi
# safecat is a program to write to maildir mailbox in an atomic way
safecat $FOLDER_DIR/tmp $FOLDER_DIR/new
echo "Delivered to ${FOLDER_DIR}"