ISP Config 2: From POP3/SMTP to GMail/Google

Discussion in 'Installation/Configuration' started by _X_, Nov 12, 2011.

  1. _X_

    _X_ New Member

    I have fully functional ISP Config 2 server (ubuntu) on one IP/Domain and second IP/Domains for shared hosting.

    On second IP(shared) there is Domain (MyDomain.com) that used local mail server (postfix) for years without any problem and with all records set. They want to move mail to GMail/Google. All steps that I know of are in order but mail is not working so I'm missing something. Here is what I have done so far.

    1) IPS Manager/Sites/MyDomain Site
    Co-Domains:
    Domain: MyDomain.com
    Options: Mailserver: External Mailserver
    2) DNS Manager/MyDomain.com/Records
    aspmx.l.google.com.
    alt1.aspmx.l.google.com.
    alt2.aspmx.l.google.com.
    aspmx2.googlemail.com.
    aspmx3.googlemail.com.
    3) in named.conf there is:
    zone "mydomain.com" {
    type master;
    file "pri.mydomain.com";
    };
    4) in pri.mydomain.com there is:
    $TTL 86400
    @ IN SOA not shared IP. mydomain.mydomain.com. (
    2011111201 ; serial, todays date + todays serial #
    28800 ; refresh, seconds
    7200 ; retry, seconds
    604800 ; expire, seconds
    86400 ) ; minimum, seconds
    ;
    NS IP of server that is not shared IP. ; Inet Address of name server 1
    NS nameserver.com. ; Inet Address of name server 2
    ;

    MX 10 aspmx.l.google.com.
    MX 20 alt1.aspmx.l.google.com.
    MX 20 alt2.aspmx.l.google.com.
    MX 50 aspmx2.googlemail.com.
    MX 50 aspmx3.googlemail.com.

    mydomain.com. A mydomain IP
    www A mydomain IP

    mydomain.com. TXT "v=spf1 a mx ptr ~all"

    ;;;; MAKE MANUAL ENTRIES BELOW THIS LINE! ;;;;

    5) dig mx mydomain.com gives:
    ; <<>> DiG 9.4.2-P2.1 <<>> mx mydomain.com
    ;; global options: printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33901
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;mydomain.com. IN MX

    ;; ANSWER SECTION:
    mydomain.com. 2118 IN MX 10 mail.mydomain.com.

    ;; Query time: 1 msec
    ;; SERVER: someIP#53(someIP)
    ;; WHEN: Sat Nov 12 15:55:41 2011
    ;; MSG SIZE rcvd: 51

    6) local-host-names is:

    ###################################
    #
    # ISPConfig local-host-names Configuration File
    # Version 1.0
    #
    ###################################
    localhost
    maindomain.com
    localhost.maindomain.com
    localhost.com
    localhost.localdomain
    mail.mydomain.com
    forum.mydomain.com
    #### MAKE MANUAL ENTRIES BELOW THIS LINE! ####


    something is wrong and I cannot see it, although it is probably screaming and jumping in front of me :)
    bold section is problem I know, but dont know where does it came from :)
     
    Last edited: Nov 12, 2011
  2. _X_

    _X_ New Member

    6a) After ALL Recycle Bins were emptied local-host-names is:

    ###################################
    #
    # ISPConfig local-host-names Configuration File
    # Version 1.0
    #
    ###################################
    localhost
    maindomain.com
    localhost.maindomain.com
    localhost.com
    localhost.localdomain
    #### MAKE MANUAL ENTRIES BELOW THIS LINE! ####
     
  3. _X_

    _X_ New Member

    7) Found that I need to add to DNS Manager/MyDomain.com/Records
    CNAME:
    Hostname: mail
    Target: ghs.google.com

    but that did not change much. still getting

    Diagnostic-Code: smtp;554 5.7.1 <user@mydomain.com>: Relay access denied
     
  4. _X_

    _X_ New Member

    Tried to get all back to Local MailServer but still get same error?

    Deleted google MX records and set all to Internal MailServer.

    EDIT: Found error in DNS. Now local mail delivery works.
     
    Last edited: Nov 12, 2011
  5. _X_

    _X_ New Member

    After I got local mail delivery working again here is what I have done to make it work with Google Mail/Apps

    - Added MX records as needed for mydomain.com
    - switched to External MailServer for domain and co-domain.

    Is there something else that needs to be done?
     
  6. _X_

    _X_ New Member

    So, with MX records for google added and local MX record with priority 90, changing to local mailserver everything works, and changing to external mailserver on both places does not work?

    postfix does not relay according to MX records?
     
  7. _X_

    _X_ New Member

    even with mail.mydomain.com defined (without DNS and MX records, just for mydomain.com) it does not work. Mail is not relayed to MX records with lower priority (<90) which are google.com urls.

    pri.mydomain.com looks like

    MX 90 mail.mydomain.com.
    MX 40 ASPMX3.GOOGLEMAIL.COM.
    MX 40 ASPMX2.GOOGLEMAIL.COM.
    MX 20 ALT2.ASPMX.L.GOOGLE.COM.
    MX 20 ALT1.ASPMX.L.GOOGLE.COM.
    MX 10 ASPMX.L.GOOGLE.COM.

    mydomain.com. A 111.222.333.444
    www A 111.222.333.444

    mydomain.com. TXT "v=spf1 a mx ptr ~all"

    do I need A record for mail.mydomain.com?
     
  8. falko

    falko Super Moderator ISPConfig Developer

    Yes, you need an A record for mail.mydomain.com.
     
  9. _X_

    _X_ New Member

    Thanks for reply, but with or without A record for mail.mydomain.com and MX records set, I cannot change MX records for domain as it looks like there are some errors in DNS records at my provider DNS server. No matter what and how I set A, MX and CNAME records there is always only one MX record pointing to mail.mydomain.com with priority 10.
     
  10. falko

    falko Super Moderator ISPConfig Developer

  11. _X_

    _X_ New Member

    I did and 2 problems found:

    - Looks like the A records (the GLUE) got from the parent zone check are different than the ones got from your nameservers. You have to make sure your parent server has the same NS records for your zone as you do.

    - ERROR: One or more of your nameservers did not respond:

    although the second one is not that much alarming ATM since first NS is working.
     
  12. _X_

    _X_ New Member

    Just solved problem with my provider. Actually, MX records and all DNS records (local BIND) on my server were ignored and only settings and records at provider DNS are what matters in my case. No matter what I set and change for main domain (mydomain.com) does not count :)
     

Share This Page