Greetings -
I'm "experiencing" vpopmail and it seemed like a good idea to organize my
thoughts on how vpopmail delivery is controlled. So I constructed the
following, sort of a mini-FAQ. I haven't tested these (yet), just cribbed
them from various web resources. Any critique of this would be useful to me
(and others, I hope).
---------------------------------------------------------
Controlling virtual domain delivery with qmail + vpopmail
---------------------------------------------------------
You can use .qmail files to control incoming email delivery at various
degrees of fineness. To become familiar with the five types of delivery
instructions that can appear in a .qmail file, see man dot-qmail (available
online at http://www.qmail.org/man/man9/dot-qmail.html).
There are two places to put the .qmail files (using the fictitious domain
"yourdomain.com" and user "someuser"). The .qmail files can be placed at
the per-domain level
/home/vpopmail/domains/yourdomain.com/.qmail-extension
or at the per-user level
/home/vpopmail/domains/yourdomain.com/someuser/.qmail
Here's a look at the various types of delivery that you may want to use...
SENDMAIL-like ALIAS
-------------------
You want to accept and forward mail for a user ("otheruser") who does not
have a mailbox on your local system. Put:
&[EMAIL PROTECTED]
in a .qmail file at the domain level with a -extension of the name given to
the user who does not have the mailbox:
/home/vpopmail/domains/yourdomain.com/.qmail-otheruser
SIMPLE FORWARDING of a REAL USER
--------------------------------
A real user could be forwarded in the same fashion as the SENDMAIL-like
ALIAS above, but you can wind up with serious pollution of the domain-level
directory with all those .qmail-someone files. A more manageable solution
might be to put:
&[EMAIL PROTECTED]
in a .qmail file at the user level. This file has no -extension since the
user is unambiguously identified by the directory.
/home/vpopmail/domains/yourdomain.com/someuser/.qmail
FORWARDING ALL MAIL for ONE DOMAIN to a DIFFERENT DOMAIN
--------------------------------------------------------
Let's first assume that you have no users in the current domain (why else
would you be forwarding all their mail elsewhere?). Put:
| /home/vpopmail/bin/vdelivermail '' $[EMAIL PROTECTED]
in the .qmail-default file at the domain level:
/home/vpopmail/domains/yourdomain.com/.qmail-default
This will forward all non-matching emails to <user>@newdomain.com
DELIVERING a MESSAGE to TWO (or MORE) USERS
-------------------------------------------
Say that you want to deliver incoming messages for "someuser" to that user
and also to "someotheruser". Construct a file that contains
./someuser/Maildir/
./someotheruser/Maildir/
or
./someuser/Maildir/
&[EMAIL PROTECTED]
and place them in a .qmail file at the domain level
/home/vpopmail/domains/yourdomain.com/.qmail-someuser
DELIVERING a MESSAGE to TWO (or MORE) USERS, PART DEUX
------------------------------------------------------
Say that you want to deliver incoming messages for a user, "someuser", who
may or may not exist on the local system, to two existing users neither
one of whom is someuser. Construct a file that contains
./realuser1/Maildir/
./realuser2/Maildir/
or
./realuser1/Maildir/
&[EMAIL PROTECTED]
or
&[EMAIL PROTECTED]
&[EMAIL PROTECTED]
and place them in a .qmail file at the domain level
/home/vpopmail/domains/yourdomain.com/.qmail-someuser
The originally addressee never receives the mail because there is no
delivery instruction for "someuser" and, therefore, doesn't have to exist.
DELIVERING a MESSAGE to TWO (or MORE) USERS, PART TROIS
-------------------------------------------------------
Another way to deliver incoming messages for "someuser" to that user and
also to "someotheruser" but preventing pollution of the domain-level
directory... Put:
./Maildir/
&[EMAIL PROTECTED]
in a .qmail file at the user level
/home/vpopmail/domains/yourdomain.com/someuser/.qmail
This makes most sense when someotheruser is not in the local domain. But it
should work even if someotheruser is local. Of course, the original
addressee must have a mailbox on the local system.
HANDLING MAIL THAT DOESN'T MATCH ANY USER or .QMAIL FILE
--------------------------------------------------------
Mail that doesn't match any user or .qmail file is handled according to the
contents of the .qmail-default file on a per domain basis. Find this file at:
/home/vpopmail/domains/yourdomain.com/.qmail-default
If you want to bounce undeliverable mail, that file should contain:
| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox
If you want to send undeliverable mail to a given user, make it say:
| /home/vpopmail/bin/vdelivermail '' [EMAIL PROTECTED]
--
Dennis Nichols
[EMAIL PROTECTED]