18.6 Local Mail Delivery Tricks

Even though qmail's local mail delivery design is pretty simple, it still has the flexibility to handle all sorts of situations.

18.6.1 Using a Subaddress Separator Character Other than Hyphen

Some people prefer to use a plus sign rather than a hyphen in subaddresses, so they like carol+prunes rather than carol-prunes. If you can't persuade them that their life will be easier if they use a hyphen like everyone else, it's not hard to arrange if you use users for local mail delivery. Create /var/qmail/users/assign if it doesn't exist yet, and then in the user's wildcard entry, change the first hyphen to a plus:

+carol-:carol:108:108:/home/carol:-:: +carol+:carol:108:108:/home/carol:-::

Then run qmail-newu to rebuild the users database. That's all it takes. The plus sign only affects the separator between the name and extension, not the name of .qmail files, which will still be .qmail-prunes in this case, nor the character that separates subextensions.

In the usual case that the users file changes from time to time as the password file is updated, put the user's name in exclude and put the two lines for that user (the modified line that starts with a plus and the unmodified line that starts with an equals sign) in append so they'll be included automatically each time qmail-pw2u runs.

18.6.2 Customized Bounce Messages for Virtual Domains

Often a virtual domain belongs (logically at least) to a different organization than the main domain on the mail server. When mail to a bad address at the virtual domain bounces, it is nice to give an error specific to that domain. Say the domain myvirt.com is routed to the myvirt user. If addresses in that domain are handled by individual .qmail files, anything that lands in .qmail-default is a bad address, easily handled by bouncesaying:

| bouncesaying "Not a valid user at myvirt.com.  Call 617-637-VIRT for information."

If addresses are handled by an alias file created by setforward, set -p to tell fastforward not to fail on an unknown address so you can handle it yourself. Put these two lines in .qmail-default:

| fastforward -p myvirt.cdb | bouncesaying "Not a valid user at myvirt.com.  Call 617-637-VIRT for information."


qmail
qmail
ISBN: 1565926285
EAN: 2147483647
Year: 2006
Pages: 152

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net