In article <[EMAIL PROTECTED]> you wrote:
> Doh, that was a complete misunderstanding of what you were saying on my
> part. Sorry!
>
> Allright, so let's say I want to pass the local part of the address to the
> .qmail file from virtualdomains, i.e.:
>
> control/virtualdomains:
> mail.aaa.com:alias-mail.aaa.com-$LOCAL
> ~alias/.qmail-mail:aaa:com-default:
> # could use $DEFAULT which refers to the $LOCAL of virtualdomains.
>
> Would $LOCAL in virtualdomains be the variable to use?
You wouldn't use it in the virtualdomains file, but in the .qmail file.
I tend not to use ~alias, but users/assign - but it is the same anyway...
e.g. Say I receive mail for foobar.co.uk and want to map every username
to the equivalent foobar.com address for delivery, e.g. [EMAIL PROTECTED]
-> [EMAIL PROTECTED], [EMAIL PROTECTED] -> [EMAIL PROTECTED], etc
cd /var/qmail
echo "foobar.co.uk:foobar-co-uk" >> control/virtualdomains
echo "foobar.co.uk" >> control/rcpthosts
Put:
+foobar-co-uk:popuser:888:888:/var/qmail/popboxes/foobar-co-uk:::
into users/assign (remember this file should have a "." on the last line
and you have to run qmail-newu to create the cdb)
Then in /var/qmail/popboxes/foobar-co-uk, create .qmail-default with:
Each of these does the same thing:
| if U=`echo "$LOCAL"@foobar.com | sed 's/foobar-co-uk-//'`; then forward "$U"; fi
(this should all be on one line)
Here $LOCAL is "foobar-co-uk-user1", so we need sed to get rid of the
"virtual user". If you use alias, you'll probably have to remove something
else.
Or
| forward "$EXT2"@foobar.com
Or
| if U=`echo "$EXT2"@foobar.com`; then forward "$U"; fi
Hope this helps,
Paul Gregg.