$EXT value clarification, virtual domain question
Howdy Question 1) I'm not sure I understand the values of $EXT correctly. Will someone confirm/deny my assesment? There is a file ~alias/.qmail-mail:aaa:com-default. When in the file, the variables would be: $EXT: mail.aaa.com-default $EXT2: mail.aaa.com $EXT3: default Question 2) Let's say in control/virtualdomains I put: mail.aaa.com:alias-mail.aaa.com This will be delivered to the ~alias/.qmail-mail:aaa:com-default file (if it's the only matching file). But when I'm in that file, how do I know what username is being sent to? Could I put something like: mail.aaa.com:alias-mail.aaa.com-$USER in virtualdomains and thus catch it with $EXTs in the .qmail (and thus forward it to the right place)? Thank you all for your help, Ben
Re: $EXT value clarification, virtual domain question
On Mon, May 07, 2001 at 02:10:22PM -0600, Benjamin Collar wrote: > Let's say in control/virtualdomains I put: > > mail.aaa.com:alias-mail.aaa.com > > This will be delivered to the ~alias/.qmail-mail:aaa:com-default file (if > it's the only matching file). But when I'm in that file, how do I know > what username is being sent to? If by "username" you mean "local part of the address [EMAIL PROTECTED]," it's in $DEFAULT. Chris PGP signature
Re: $EXT value clarification, virtual domain question
On Mon, 7 May 2001, Chris Johnson wrote: > If by "username" you mean "local part of the address [EMAIL PROTECTED]," > it's in $DEFAULT. Do you mean $DEFAULT would equal "whatever" in "[EMAIL PROTECTED]"? And this variable is available in the .qmail- file? Sorry I'm not up on the terminology :) Thanks Ben > > Chris >
Re: $EXT value clarification, virtual domain question
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? Thanks again Ben On Mon, 7 May 2001, Benjamin Collar wrote: > On Mon, 7 May 2001, Chris Johnson wrote: > > > If by "username" you mean "local part of the address [EMAIL PROTECTED]," > > it's in $DEFAULT. > Do you mean $DEFAULT would equal "whatever" in > "[EMAIL PROTECTED]"? And this variable is available in the .qmail- > file? > > Sorry I'm not up on the terminology :) > > Thanks > Ben > > > > > > Chris > > > >
Re: $EXT value clarification, virtual domain question
On Mon, May 07, 2001 at 02:46:13PM -0600, Benjamin Collar wrote: > On Mon, 7 May 2001, Chris Johnson wrote: > > > If by "username" you mean "local part of the address > > [EMAIL PROTECTED]," it's in $DEFAULT. > > Do you mean $DEFAULT would equal "whatever" in "[EMAIL PROTECTED]"? And > this variable is available in the .qmail- file? Yep. From the qmail-command man page: > DEFAULT is the portion corresponding to the default part of the .qmail-... > file name; DEFAULT is not set if the file name does not end with default. Chris PGP signature
Re: $EXT value clarification, virtual domain question
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.