Koozali.org: home of the SME Server

Mail forwarding conundrum

Offline judgej

  • *
  • 375
  • +0/-0
Mail forwarding conundrum
« on: April 20, 2008, 12:29:34 AM »
Can anyone tell me why the following situation is not working as I expect? I'm sure it is working to design, but it's not what I want, so am looking for a better way around it.

I have a an SME server on domain1.com, which is the main e-mail server.

It has a group called 'group1' with two users as members (user1 and user2). I can e-mail from another server to group1@domain1.com, and the message gets to both end users.

Now, I create an alias called alias1, which points to group1. I can send an e-mail from another server to alias1@domain1.com, and the message gets to both end users.

So far, so good.

I have another domain, domain2, on a non-SME virtual server somewhere else. I set up the virtual hosts file so that info@domain2.com gets forwarded to alias1@domain1.com or group1@domain1.com.

If I send a message to info@domain2.com, then where does the e-mail end up? Not with the two end users, but in the administrator's inbox on domain1.com.

The weird thing is, if I set up the forwarding to go to user1@domain1.com and user2@domain1.com, both end users get the e-mail. I just can't forward it via either the user group, or the group and alias, even though mail sent *directly* to the group or the alias does get through to the end users.

Any clues what could be happening? I've looked at the logs, but it does not make any sense to me.

I guess it has something to do with the way aliases and user mapping is configured on SME server, but I don't know what.

Ultimately, I just want to forward everything sent to domain2.com to aliases on domain1.com, where the local administrator can decide who it gets forwarded to.

-- Jason

Edit: perhaps anything sent to a group on SME server *must* have a local domain, but anything forwarded to an individual user does not?
« Last Edit: April 20, 2008, 12:36:35 AM by judgej »
-- Jason

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Mail forwarding conundrum
« Reply #1 on: April 20, 2008, 04:40:38 PM »
I have another domain, domain2, on a non-SME virtual server somewhere else. I set up the virtual hosts file so that info@domain2.com gets forwarded to alias1@domain1.com or group1@domain1.com.

If I send a message to info@domain2.com, then where does the e-mail end up?

That depends entirely on what that non-SME server does.

Offline judgej

  • *
  • 375
  • +0/-0
Re: Mail forwarding conundrum
« Reply #2 on: April 20, 2008, 07:19:04 PM »
That depends entirely on what that non-SME server does.

Nope. It depends *partly* on what the non-SME Server does, and *partly* on what the SME Server does.

From what I can make out, it leaves the 'To:' header intact (info@domain2.com) and forwards the mail on for delivery to the group on the SME Server (it gets sent to group@domain1.com). That is the bit where it gets tricky.

If it forwards to user1@domain1.com, then the user gets that e-mail, and can see that the e-mail was originally destined for info@domain2.com. If it gets sent to the group1@domain1.com, then that SME Server does *not* deliver copies of that e-mail to users in that group; instead it sends it to the administrator.

What I don't know is:

- Is this by SME Server design, i.e. something the project decided should happen?
- Is it a consequence of the way qmail or sendmail works, i.e. standard Internet protocols?
- Could it be a bug, perhaps an oversight that a few tweaks to the way e-mails are forwarded to group members is set up?

From what I can see, the non-SME Server forwards the message on correctly. However, the fact that the SME Server does not do what I expect it to do with that e-mail on receipt, could be a consequence of *the way* it is forwarded. Maybe I need canonical forwarding on the non-SME Server, so the 'To:' header gets rewritten?
« Last Edit: April 20, 2008, 07:29:04 PM by judgej »
-- Jason

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Mail forwarding conundrum
« Reply #3 on: April 20, 2008, 10:53:16 PM »
If it gets sent to the group1@domain1.com, then that SME Server does *not* deliver copies of that e-mail to users in that group; instead it sends it to the administrator.

If any mail is sent to group1@domain1.com, and SME server does not deliver it to all members of that group, then that's a bug in SME server, and you should have raised an issue in the Bug Tracker.

Having said that, I suspect that you are using multidrop fetchmail on the domain1 server, in which case you should either stop doing that, or work out exactly what sort header you need to tell fetchmail to use so that it can guess the intended recipient correctly.

Offline judgej

  • *
  • 375
  • +0/-0
Re: Mail forwarding conundrum
« Reply #4 on: April 20, 2008, 11:14:46 PM »
I'm not sure if I'm using multidrop or not. The server uses 'exim' as the mail system (which I think is just a version of sendmail). I'm following the instructions on this page: http://knowledge.dvs.demon.net/node/140 and the word 'multidrop' does not feature anywhere in there.

Mail sent directly to group1@domain1.com (i.e. "To: group1@domain1.com") is delivered correctly to members in the group.

-- Jason

Offline judgej

  • *
  • 375
  • +0/-0
Re: Mail forwarding conundrum [SOLVED]
« Reply #5 on: April 21, 2008, 12:04:39 AM »
I think I have this solved now. A dodgy domain was sucking up some of my e-mails, and that is why they appeared not to be getting to their destination. Fixing that, and forwarded e-mails now go to all the intended recipients, whether directly, through a group, or through an alias pointing to a group.

Thanks fo ryou help.
-- Jason