Koozali.org: home of the SME Server

Local email -> Gmail

Offline wires12

  • ***
  • 56
  • +0/-0
Local email -> Gmail
« on: March 12, 2012, 05:16:27 PM »
I'm working with replacing several servers with a SME box.

So far so good except for one inelegant problem. The site uses Gmail as their email provider for their domain. Works well with minimal spam. However there is a fax server that needs to send status reports via email to users. Unfortnately the fax server will not provide the authentication Gmail requires.

No problem I say, send the emails to the SME box and then forward that user's email to their Gmail account. Not so fast the SME box says, an email addressed to user@sme1.mydomain.com is local and I don't need to forward it.

My question is is it possible for the SME server to be named sme1.mydomain.com and still have it forward email to an address like user@mydomain.com?

I solved the problem for now by renaming the SME box to sme1@mycompany.local but that is a bit ugly.

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: Local email -> Gmail
« Reply #1 on: March 13, 2012, 03:47:15 AM »
You should be able to setup a forwarding address for each user.

Offline wires12

  • ***
  • 56
  • +0/-0
Re: Local email -> Gmail
« Reply #2 on: March 13, 2012, 07:55:26 AM »
I set up forwarding addresses.

user1 -> user1@mydomain.com which is a Gmail account

The fax box is set to send mail to user1@sme1.mydomain.com and that works fine. The problem comes when the SME server receives the mail. The problem was evident while watching /var/log/qmail/current, the email would be received but SME thought it was local and didn't forward.

Offline TerryF

  • grumpy old man
  • *
  • 1,848
  • +6/-0
Re: Local email -> Gmail
« Reply #3 on: March 13, 2012, 09:04:50 AM »
Have a look here Mailsorting Contrib
--
qui scribit bis legit

Offline wires12

  • ***
  • 56
  • +0/-0
Re: Local email -> Gmail
« Reply #4 on: March 27, 2012, 08:23:09 AM »
Looked at the contrib. Not really what I'm looking for.

What I'd like is of the SME box to understand it isn't the mail server for mydomain.com. It should handle mail explicitly addressed to it @sme1.mydomain.com but it should forward mail on the the gmail server instead treating is as local email.

Here is some representative /var/log/qmail/current logging:
Code: [Select]
***GOOD, forward to non-domain gmail account

new msg 77433207
info msg 77433207: bytes 615 from <faxfinder@sme1.mydomain.com> qp 24726 uid 453
starting delivery 60: msg 77433207 to local user1@sme1.mydomain.com
status: local 1/10 remote 0/20
new msg 77433132
info msg 77433132: bytes 729 from <faxfinder@sme1.mydomain.com> qp 24731 uid 5000

starting delivery 61: msg 77433132 to remote user1@gmail.com
status: local 1/10 remote 1/20
delivery 60: success: did_1+1+1/qp_24731/
status: local 0/10 remote 1/20
end msg 77433207
delivery 61: success: 209.85.225.26_accepted_message./Remote_host_said:_250_2.0.0_OK_1329425435_r7si6336094icc.106/
status: local 0/10 remote 0/20
end msg 77433132

Code: [Select]
***BAD, not forwarding to a domain gmail account   

new msg 77433212
info msg 77433212: bytes 615 from <faxfinder@sme1.mydomain.com> qp 24842 uid 453
starting delivery 62: msg 77433212 to local user1@sme1.mydomain.com
status: local 1/10 remote 0/20
new msg 77433180
info msg 77433180: bytes 729 from <faxfinder@sme1.mydomain.com> qp 24847 uid 5000

starting delivery 63: msg 77433180 to local alias-localdelivery-user1@mydomain.com
status: local 2/10 remote 0/20
delivery 62: success: did_1+1+1/qp_24847/
status: local 1/10 remote 0/20
end msg 77433212
new msg 77433212
info msg 77433212: bytes 855 from <faxfinder@sme1.mydomain.com> qp 24850 uid 400
starting delivery 64: msg 77433212 to local user1@sme1.mydomain.com
status: local 2/10 remote 0/20
delivery 63: success: forward:_qp_24850/did_0+0+1/
status: local 1/10 remote 0/20
end msg 77433180
delivery 64: failure: Recipient_unknown/
status: local 0/10 remote 0/20
bounce msg 77433212 qp 24854
end msg 77433212
new msg 77433214
info msg 77433214: bytes 1394 from <> qp 24854 uid 406
starting delivery 65: msg 77433214 to local faxfinder@sme1.mydomain.com
status: local 1/10 remote 0/20
delivery 65: success: did_1+0+1/
status: local 0/10 remote 0/20
end msg 77433214

The following two lines point to the root of the problem:
starting delivery 61: msg 77433132 to remote user1@gmail.com
-vs-
starting delivery 63: msg 77433180 to local alias-localdelivery-user1@mydomain.com

Does the Hostnames and addresses page in server-manager have anything to do with this?

I really need a solution as the sme1.mydomain.local workaround is causing other problems.


Thanks!
« Last Edit: April 01, 2012, 03:58:17 PM by wires12 »

Offline p-jones

  • *
  • 594
  • +0/-0
Re: Local email -> Gmail
« Reply #5 on: March 27, 2012, 12:01:23 PM »
Is it not possible to hand the mail on to the gmail smtp server ?
...

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: Local email -> Gmail
« Reply #6 on: March 27, 2012, 01:29:21 PM »
This may be a DNS issue, rather than a mail issue - the SME server seems to think it is responsible for email addressed to "sme1.mydomain.com".

If setting the google SMTP server as the internal mail server for your domain doesn't work, you'll need to:
a. Make sure your SME does NOT think it is the MX server for your primary domain and
b. Make sure your fax sends its email to an email address for which the SME DOES think it is the MX server.


Or -- if your gmail accounts have alternate "@gmail.com" addresses, simply configure the local user mailbox to forward to the alternate address.

Offline kruhm

  • *
  • 680
  • +0/-0
Re: Local email -> Gmail
« Reply #7 on: April 01, 2012, 08:02:01 AM »
Hi wires12,

First of all, thanks for being a PLATINUM SUPPORTER! Your support is much appreciated. (For those interested in becoming supporters, please visit the DONATE button at the top of this page.)

Here is what you are looking for:
Code: [Select]
db domains setprop domain.tld MailServer a.b.c.d
signal-event email-update

So I believe your solution is:
Code: [Select]
db domains setprop lexairinc.com MailServer 74.125.45.26
signal-event email-update

Hope this helps.

Thanks again,
kruhm

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Local email -> Gmail
« Reply #8 on: April 01, 2012, 04:34:37 PM »
wires12,

That solution from kruhm is documented in the FAQ, so please read first in future
http://wiki.contribs.org/SME_Server:Documentation:FAQ#Internal_Mail_Servers
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline wires12

  • ***
  • 56
  • +0/-0
Re: Local email -> Gmail
« Reply #9 on: April 01, 2012, 07:03:42 PM »
Thanks for the setprop pointer. I had looked at it but have not tried it yet. It will be a little while before I can test to see if it solves my problem.

An alternate gmail address would be great but I can't find ones that already exist and setting up more is problematic long term.

The donate button is cool. SME is the coolest and most useful networking tool thing I've seen since WfW.
« Last Edit: April 01, 2012, 07:05:36 PM by wires12 »