Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Google Domains - how to send email to and from with same host
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Google Domains - how to send email to and from with same host

sidewindersidewinder Member
edited July 2014 in Help

for example, if I my script is mailing from "[email protected]" to "[email protected]", sendmail will send the email directly to the local user (if that user exists) and DNS is never used to route the email to gmail - it stays local.

Any ideas? All the local email from within my domain either gets rejected bc the user doesn't exist or if the user does exist it never makes it to the google servers bc sendmail never tries to route the email to the google servers.

Hope I explained the problem correctly.

thanks in advance to VPS gurus here that I know have the answer to this question!

Comments

  • trewqtrewq Administrator, Patron Provider

    This is why you never set the host name of your server to a domain. It should always be a subdomain.

    Easiest long term solution is to change your servers hostname.

  • So u think if I change the hostname of my server to xxx.mydomain.com that will fix it? I will try but I have my doubts.

    Others have had this problem as well and appears easy to fix if u run plesk which I do not. Basically what I am trying to do is disable DNS Service for x domain in postfix or sendmail.

  • changed hostname to xxx.mydomain.com and same result. here is the topic on serverfault that addresses this situation. It seems like something a lot of people using google domains would encounter but my google-fu must suck or something bc I can't find an answer:

    http://serverfault.com/questions/349108/postfix-force-server-to-send-mail-outside-of-localhost

  • @sidewinder said:
    So u think if I change the hostname of my server to xxx.mydomain.com that will fix it? I will try but I have my doubts.

    Others have had this problem as well and appears easy to fix if u run plesk which I do not. Basically what I am trying to do is disable DNS Service for x domain in postfix or sendmail.

    no he means instead of having your hostname as domain.com you set it as vps1 or mailserver or something

  • trewqtrewq Administrator, Patron Provider

    @hostnoob said:
    no he means instead of having your hostname as domain.com you set it as vps1 or mailserver or something

    No, he changed it to the correct thing. It doesn't mean he changed it correctly though.

  • @trewq said:
    No, he changed it to the correct thing. It doesn't mean he changed it correctly though.

    Oh right, my bad then.

  • sidewindersidewinder Member
    edited May 2018

    when changing hostname to mainvps: sendmail[22588]: My unqualified host name (main vps) unknown; sleeping for retry

    when changing to clients.mydomain.com, mail is sent, but local email still sent to the local user...

    https://stackoverflow.com/questions/22265721/postfix-local-smtp-ignoring-dns
    https://stackoverflow.com/questions/1107730/cant-send-email-to-addresses-at-my-own-domain

  • ATHKATHK Member

    Just curious, why not use google SMTP servers instead of your own mail server?

  • redoredo Member

    Just curious, what does it mean with "google domain" in the title?

  • trewqtrewq Administrator, Patron Provider

    @redo said:
    Just curious, what does it mean with "google domain" in the title?

    I'm guessing Google is being used as the domains mail server.

  • bad title, probably should of been "mail when using google apps"... here was my solution for anyone that cares using sendmail..

    I added these 2 lines and rebuilt the .cf file, restarted sendmail and all was good
    define(MAIL_HUB',mydomain.com.')dnl
    define(LOCAL_RELAY',mydomain.com.')dnl

    and works great. thanks for the help and hope if anyone else is having these problems this will help them too

  • RBHRBH Member

    Consider also adding valid SPF records.

Sign In or Register to comment.