Koozali.org: home of the SME Server

Wildcards in pseudonyms

renee

Wildcards in pseudonyms
« on: April 20, 2006, 01:50:56 PM »
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.

I tried to create a pseudonym for *@xyz.com -> ben but that didn't work. :idea:

Any ideas?

Offline jester

  • *
  • 496
  • +1/-0
Wildcards in pseudonyms
« Reply #1 on: April 20, 2006, 02:44:09 PM »
Hello Renee,

This is not yet possible from the server-manager. It might be included in a future version. I think it is possible by changing the config files but I can't help you with that one.


Regards,

renee

Wildcards in pseudonyms
« Reply #2 on: April 20, 2006, 09:22:11 PM »
Thanks for the reply Jester.

Does anyone know which files needs to be altered?

/Renee

Offline mmccarn

  • *
  • 2,629
  • +10/-0
Wildcards in pseudonyms
« Reply #3 on: July 16, 2006, 05:28:24 PM »
Virtual Domain to Mailbox
You can deliver all email addressed to a given domain into a specified user's mailbox as follows:

# mkdir -p /etc/e-smith/templates-custom/var/qmail/control/virtualdomains

# pico /etc/e-smith/templates-custom/var/qmail/control/virtualdomains/95virtualdomains
add this to it:
xyz.com:ben
anotherdomain.com:ben-or-another-user
you-get-the-idea.org:bynow


then
# signal-event email-update

There is lots more cool stuff you could do in "virtualdomains" - check out http://www.flounder.net/qmail/qmail-howto.html

Offline Mace

  • **
  • 65
  • +0/-0
Wildcards in pseudonyms
« Reply #4 on: July 26, 2006, 02:48:17 AM »
Sorry to resurrect this thread but I'm stumped here.  :-?

I followed the above procedure and can now successfully send mail to anything@thevirtualdomain.com and it will deliver to the specified user's mailbox just fine. The problem is that it only works internally. It rejects everything trying to be delivered via the external interface. Here's an example message when trying to send from my yahoo account:

Quote
Hi. This is the qmail-send program at yahoo.com.
I'm afraid I wasn't able to deliver your message to the following
addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<anything@thevirtualdomain.com>:
xxx.xxx.xxx.xxx does not like recipient.
Remote host said: 550 invalid recipient anything@thevirtualdomain.com
Giving up on xxx.xxx.xxx.xxx.


xxx.xxx.xxx.xxx = my external interface.

I've searched to no avail. Any ideas on how I can enable the virtual domain "catch-all" behavior on the external interface?

Thanks,
Sterling

Offline raem

  • *
  • 3,972
  • +4/-0
Wildcards in pseudonyms
« Reply #5 on: July 26, 2006, 07:33:34 AM »
Mace68

> Remote host said: 550 invalid recipient anything@thevirtualdomain.com

I suspect that message is caused by sme7 refusing to accept email sent to invalid users/accounts. So the only way you will get a "catch all" to work, is for those usernames to be valid on the server ie they need to be either users, groups or pseudonyms.
...

Offline Mace

  • **
  • 65
  • +0/-0
Wildcards in pseudonyms
« Reply #6 on: July 26, 2006, 08:49:23 AM »
Thank you for your prompt reply. I realize that my previous post was clear as mud.  :oops:

Say, for example, I add smallpencils.com:steve to /var/qmail/control/virtualdomains via a custom template and verify that it expaned correctly.

smallpencils.com is a valid domain on my server.

steve is a valid user on my server.

bob is not a valid user, group, etc... bob is completely nonexistent on my server.

I send an email to bob@smallpencils.com (invalid user, valid domain) internally and the message gets dropped into steve's mailbox as expected.

I send another email to bob@smallpencils.com (invalid user, valid domain) from an external source and it's rejected by my server as an invalid recipient  even though I have smallpencils.com:steve in /var/qmail/control/virtualdomains.

Is there something else I need to change to get anything@smallpencils.com to go to steve if sent from external sources or is this not possible?

Thanks again.

Offline JonB

  • *
  • 351
  • +0/-0
Wildcards in pseudonyms
« Reply #7 on: July 26, 2006, 02:13:08 PM »
Quote
I send another email to bob@smallpencils.com (invalid user, valid domain) from an external source and it's rejected by my server as an invalid recipient even though I have smallpencils.com:steve in /var/qmail/control/virtualdomains.


That is correct. The goodrcptto plugin for qpsmtpd is Denying the invalid email address.

look at /var/service/qpsmtpd/config/goodrcptto

It contains a list of all the valid email address's that the server will accept.

Jon
...

Offline Mace

  • **
  • 65
  • +0/-0
Wildcards in pseudonyms
« Reply #8 on: July 26, 2006, 08:48:26 PM »
OK, I put @smallpencils.com in the /var/service/qpsmtpd/config/goodrcptto file and now the server is accepting the message but rejects it a few minutes later.

When I try to use DNS mail forwarding, *@smallpencils.com forwards to steve@smallpencils.com, instead of using an MX record I get a "Relay access denied" message.

When I set the DNS forward to *@smallpencils.com forwards to steve@server.ip.address I get a "Recipient Unknown" error.

Sorry to be a pest with this issue but is there any other way possible to setup a catch-all for a virtual domain on SME 7? My client needs it if at all possible.

Thanks for all your replies.

Offline torsten

  • 14
  • +0/-0
    • http://www.deep-sea.net
Wildcards in pseudonyms
« Reply #9 on: August 05, 2006, 01:40:13 PM »
I followed the instruction but only changed a minor detail to suit my needs:
Quote
# mkdir -p /etc/e-smith/templates-custom/var/qmail/control/virtualdomains

# pico /etc/e-smith/templates-custom/var/qmail/control/virtualdomains/95virtualdomains
add this to it:
sales@xyz.com:ben
info@anotherdomain.com:another-user


then
# signal-event email-update


I have the Pseudonyms of sales and info and that's it

Tested from an external source ie gmail/hotmail and works fine

 8-)

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Wildcards in pseudonyms
« Reply #10 on: August 05, 2006, 03:42:44 PM »
Quote from: "torsten"
I followed the instruction


You could have done that just by using the Pseudonyms panel.

Offline torsten

  • 14
  • +0/-0
    • http://www.deep-sea.net
Wildcards in pseudonyms
« Reply #11 on: August 05, 2006, 03:54:01 PM »
Not sure how I would do that  :-?

I have SME 7 with 4 different domains

when I had an email to sales@domain1
then sales@domain2 should not get a copy
but when sales@domain2 gets an email
then sales@domain1 should not get a copy

I couldn't see how to do that just with the Pseudonyms panel?
Dungog used to have a great panel just for that

 :-)

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Wildcards in pseudonyms
« Reply #12 on: August 05, 2006, 05:34:27 PM »
Quote from: "torsten"

I couldn't see how to do that just with the Pseudonyms panel?


AIUI, you create two Pseudonyms, sales@domain1.com and sales@domain2.com.

Offline mmccarn

  • *
  • 2,629
  • +10/-0
Wildcards in pseudonyms
« Reply #13 on: August 06, 2006, 05:16:47 PM »
Let me try again...

Virtual Domain to Mailbox
Objective: Deliver all email addressed to a given domain into a specified user's mailbox as follows:

1. Do NOT create a “virtual domain” entry using server-manager.

2. Create a template fragment for /var/qmail/control/virtualdomains
# mkdir -p /etc/e-smith/templates-custom/var/qmail/control/virtualdomains
# pico /etc/e-smith/templates-custom/var/qmail/control/virtualdomains/95virtualdomains

add this to it:
xyz.com:ben
anotherdomain.com:ben-or-another-user
you-get-the-idea.org:bynow


3. Create a template fragment for /var/qmail/control/rcpthosts
# mkdir -p /etc/e-smith/templates-custom/var/qmail/control/rcpthosts
# pico /etc/e-smith/templates-custom/var/qmail/control/rcpthosts/95virtualdomains

add this to it:
xyz.com
anotherdomain.com
you-get-the-idea.org


4. Create a template fragment for /var/service/qpsmtpd/control/goodrcptto
# mkdir -p /etc/e-smith/templates-custom/var/service/qpsmtpd/config/goodrcptto
# pico /etc/e-smith/templates-custom/var/service/qpsmtpd/config/goodrcptto/95virtualdomains

add this to it:
@xyz.com
@anotherdomain.com
@you-get-the-idea.org


5. Expand the 3 templates
# signal-event email-update

I’ve tested this from off-site, sending to a completely non-existent user account ‘@xyz.com’.

I’m confused by the statement “OK, I put @smallpencils.com in the /var/service/qpsmtpd/config/goodrcptto file and now the server is accepting the message but rejects it a few minutes later.” – does this mean the messages get delivered for a while, then start getting rejected again, or does this mean the message gets through qpsmtpd, but then gets rejected before being delivered to the intended mailbox?

Offline raem

  • *
  • 3,972
  • +4/-0
Wildcards in pseudonyms
« Reply #14 on: August 07, 2006, 06:26:50 AM »
torsten

> torsten wrote:
> I couldn't see how to do that just with the Pseudonyms panel?
 
> Charlie wrote:
> AIUI, you create two Pseudonyms, sales@domain1.com and
> sales@domain2.com.

This of course implies that you do not create user accounts called sales etc.
Any "generic job function" type names should be created as pseudonyms, and these get directed to the recipients user accounts
eg
sales@domain1.com >> johnb
sales@domain2.com >> maryw
...