Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: renee on April 24, 2006, 03:46:05 PM
-
Hi,
The situation is as follows:
Domains:
abc.com
xyz.com
User:
alex
ben
chris
david
I would like to get alle the mail delevered to xyz.com to be redirected to ben. So even alex@xyz.com will be delivered to ben.
What file do I need to alter to get this done?
And what do I need to put in the file?
/Renee
-
renee
see the pseudonyms panel
-
I hate to disappoint you but that is not the solution.
I even tried to ad *@xyz to the pseudonyms list buts even that is not working. Any change someone knows what file to edit?
-
renee
Mail sent to invalid addresses will be rejected by the server, so a *@xyz.com wil not catch everything addressed to that domain anyway.
Therefore just add the users one by one
alex@xyz.com > ben
chris@zyx.com > ben
david@xyz.com > ben
etc etc for any other valid users/addresses.
I don't know if the method detailed in the HOWTO for sme6 is still applicable in sme7, but you could have a look and try it out.
http://mirror.contribs.org/smeserver//contribs/rmitchell/smeserver/howto/virtual%20domain%20email%20aliases%20HOWTO%20for%20sme%20server.htm
-
renee
>...I hate to disappoint you but that is not the solution.
>... I even tried to ad *@xyz to the pseudonyms list buts even that is not working.
It does work !
I just tried it om sme7RC1.
I can add a pseudonym for
*@domain1.com forwarded to user5
If I send a local email to a valid user account eg
user1@domain1.com
it gets received by user5 OK.
Check your setup and configure your virtual domains correctly and only use valid email adresses ie a user or group or pseudonym must exist on your server.
-
I think the howto gives me the solution:
If you want all domain mail going into one account, except for defined users, enter your virtual aliases in the form shown below. In the example below domain1.com:fred sends all @domain1.com mail to user fred except for jim and bob who get their mail directly..
domain1.com:fred
jim@domain1.com:jim
bob@domain1.com:bob
I cannot acces the SME server at this moment so I'll try this tonight. I realy hope the /etc/e-smith/templates-custom/var/qmail/control/virtualdomains/90aliases file is there by default.
-
renee
>..I think the howto gives me the solution...
You don't need to use the howto, see my second post above.
What you want does appear to work OK using the pseudonyms panel, but you must also add appropriate virtual domains and valid addresses (either as user accounts, groups or pseudonyms).
-
I'll try the wildcard first thing tonight
The Pseudonyms solution is not the solution I'm looking for.
My first post is not the complete repesentation of the real thing:
1. dfjkdsjfksdj.nl
2. ldfhsdkfj.nl
3. dsfasdfasd.com
4. urisjfasdjfk.nl
1. is my full name
2. is my wives full name
3. is the domain of a friend
4. our company domain
We all may have an acoount for ebay and for some other things:
example:
ebay(a)dfjkdsjfksdj.nl
ebay(a)ldfhsdkfj.nl
ebay(a)dsfasdfasd.com
I cannot put all the possible pseudonyms in the list.
I want:
All mail for 1 to user a
All mail for 2 to user b
All mail for 3 to user c, except strangename(a)dsfasdfasd.com which must go to stangename
All mail for 4 to user admin exept a list of emplyees names to their account
Maybe I should edit this file /var/qmail/alias/.qmail-localdelivery-default
-
Just got my wife to create and edit the /etc/e-smith/templates-custom/var/qmail/control/virtualdomains/90aliases file.
This works fine after you use signal-event email-update (forgot to do that first)
I'll still try the * thing tonight, if it's not working I'll go with the 90aliases file.
-
renee
> My first post is not the complete repesentation of the real thing:
It's usually better if you post your real problem, saves us wasting time and forum posts.
Keep in mind that the pseudonyms panel has been enhanced in sme7 to provide the functionality that the old virtual email aliases howto did for sme6.
******************************
>...I'll try the wildcard first thing tonight
I thought you said you already tried it and it didn't work ?
>...The Pseudonyms solution is not the solution I'm looking for.
It doesn't sound like you have even tried it, so how do you know it is not the solution ?
>... I cannot put all the possible pseudonyms in the list.
Why not, that is what the pseudonyms panel is for, it would be no different to entering the same information into a 90aliases file (or whatever file).
>... All mail for 1 to user renee
add this pseudonym
*@reneekloosterziel.nl > renee
>... All mail for 2 to user linda
add this pseudonym
*@lindadenijs.nl > linda
> ... All mail for 3 to user erik
add this pseudonym
*@sheilaenerik.com > erik
>... except sheila(a)sheilaenerik.com which must go to sheila
That will go to sheila anyway without needing to add a pseudonym
ie messages sent to
sheila@any_domain_on_server
will go to
sheila@maindomain
unless otherwise directed in the pseudonyms panel.
You cannot add
sheila@sheilaenerik.com > sheila
as a pseudonym anyway, as the panel will not allow forwarding to the same user account, (error = A pseudonym cannot point to the same account), so you would need to do somethimg like:
add this pseudonym
sheila@sheilaenerik.com > sheila2
>... All mail for 4 to user admin
add this pseudonym
*@nicecreations.nl > admin
>... exept a list of emplyees names to their account
same issue as above with sheila, the messages will go to the user accounts anyway, or you could do
employee1@nicecreations.nl > employee1a
employee2@nicecreations.nl > employee2a
employee3@nicecreations.nl > employee3a
How hard is any of that that to do, especially when I have given you all the answers ?
-
I tought I covered the complete story in my first post. Sorry for that.
I did try the * solution but it didn't work. If this does work at your place I must be overlooking something. Let me try it again.
Editing the 90aliasses custom template gives me the option to use wildcards for sure.
-
renee
> I did try the * solution but it didn't work.
Instead of saying it didn't work, tell us
what did you do
what did you expect
what didn't happen
what did happen
> If this does work at your place I must be overlooking something.
It works as I have explained, I tried it on a test system
> Editing the 90aliasses custom template gives me the option to use wildcards for sure
As I said previously the pseudonym panel enhancements replace the howto, they are effectively the same thing.
-
I added a pseudonym
*@domain1.com -> erik
Sent an email to renee@domain1.com
I expected this to get delivered to erik but it did get delivered to renee.
After I removed the pseudonym I have edited the 90aliasses in the custom-templates folder and added this line:
domain1.com:erik
Sent an email to renee@domain1.com
I expected this to get delivered to erik and it did.
-
Just tried the solution with pseudonyms.
1. Pseudonym "*@domain1.com" -> "User2"
Result: Mail for User1@domain1.com gets delivered to User1
2. Pseudonym "@domain1.com" -> "User2"
Result: Mail for User1@domain1.com gets delivered to User1
3. Pseudonym "domain1.com" -> "User2"
Result: Mail for User1@domain1.com gets delivered to User1
Edited the 90aliasses file, added this line:
domain1:User2
Result: Mail for User1@domain1.com gets delivered to User2
I'll stick to the 90aliasses file. Thanks RayMitchell for your help! 8-)
-
renee
What version of sme7 ar eyou using, sme7RC1 ?
The pseudonyms panel should work the same as the aliases file does.
If you are having problems, which you do seem to be having, please report them to the bug tracker.
-
2. Pseudonym "@domain1.com" -> "User2"
Result: Mail for User1@domain1.com gets delivered to User1
Here's my solution to the problem ... to enhance the functionality of the aliases/pseudonyms to properly decide what to place into the virtualdomains file.
Now if you specify the pseudonym "@domain.com" -> "User2" in the control panel, it will modify the delivery from "alias-localdelivery" to instead be the user in question. Any other pseudonym which has even a single character in front of the "@domain.com" i.e. "x@domain.com" will still properly get expanded to the virtual domain pseudonym only (as before).
This would make virtualization of domains to a specific user simple, and work as expected.
in /etc/e-smith/templates-custom/var/qmail/control/virtualdomains
80localdomains
{
$OUT = '';
use esmith::DomainsDB;
use esmith::AccountsDB;
my $domainsdb = esmith::DomainsDB->open_ro();
my $accountsdb = esmith::AccountsDB->open_ro;
for my $domain ($domainsdb->domains)
{
my $local_handler = "alias-localdelivery";
my $mail_server = $domain->prop('MailServer')
|| $DelegateMailServer
|| 'localhost';
next if ( $mail_server ne 'localhost' );
$domain = $domain->key;
for my $pseudo ($accountsdb->pseudonyms)
{
next unless ($pseudo->key eq "@".$domain);
$local_handler = $pseudo->prop("Account");
last;
}
$OUT .= "$domain:$local_handler\n";
}
}
90pseudonyms
{
my $dms = $DelegateMailServer;
return "# DelegateMailServer is set" if ($dms && ($dms !~ /^\s*$/));
$OUT = "";
use esmith::AccountsDB;
my $adb = esmith::AccountsDB->open_ro or die "Couldn't open AccountsDB";
for my $pseudo ($adb->pseudonyms)
{
next unless ($pseudo->key =~ /^.+@/);
my $account = $pseudo->prop("Account");
$OUT .= $pseudo->key . ":$account\n";
}
}
Hope this helps out others ...
Robert.
-
Here's my solution to the problem ... to enhance the functionality of the aliases/pseudonyms to properly decide what to place into the virtualdomains file.
Great stuff - please raise a New Feature Request in SME Server Future and attach the modified files. Thanks.