External mail server with gmail MX service

Discussion in 'Installation/Configuration' started by adrenalinic, Sep 10, 2006.

  1. adrenalinic

    adrenalinic Member

    Hi.
    I'm tryng to use external mail service offered by Gmail setting how MX the 5 mail server of Gmail.

    i have a problem making this....

    I have setting on my domain the option "external mail server" on the host www.mysite.com and host mysite.com

    When setting up the host "mail.mysite.com" in dns manager i have added IP address of my machine, and have hadded 5 mail server of Gmail in the MX section of DNS manager.

    Quering host mail.mysite.com:

    Getting MX record for mail.mysite.com (from local DNS server, may be cached)... Got it!

    Host Preference IP(s) [Country]
    alt1.aspmx.l.google.com. 10 72.14.205.27 [US]
    alt2.aspmx.l.google.com. 20 64.233.167.114 [US]64.233.167.27 [US]

    This test see correctly the MX address of Gmail server....

    But.......
    when send an email to [email protected] form email address hosted on the same server, it return this error postfix message:

    The Postfix program

    <[email protected]>: mail for mysite.com loops back to
    myself

    Postfix tryng to send this mail at host mail.mysite.com with my ip...
    But host mail.mysite.com have different external Gmail mail server.

    I can not add to host mail.mysite.com an IP...because Gmail mail server not offer a static ip to associate to my host mail.mysite.com

    He is obvious that host mail.mysite.com try to send mail at ip address associated to host mail.mysite.com

    How can solve this Issue!?!?!
    I can not use Gmail external mail service?!
    https://www.google.com/a/
     
  2. adrenalinic

    adrenalinic Member

    My dns is autoritative for this domain and have waith for 48 hour..........
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    What is the output of:

    hostname -f
     
  4. adrenalinic

    adrenalinic Member

    output is:
    server3.myserver.org (my server...not my site)
     
  5. adrenalinic

    adrenalinic Member

    Hi.
    I have added mail server ASPMX.L.GOOGLE.COM
    to /etc/postfix/local-host-names and restart postfix..

    I will receive mail in next the 48 hours ??!!

    Thanks.
    Josef
     
  6. adrenalinic

    adrenalinic Member

    after adding the gmail mail server to local host name i have the same error:
    The Postfix program

    <[email protected]>: mail for mysite.com loops back to
    myself

    :eek: :confused:
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Please post an excerpt of your mail.log
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Add mysite.com to the end of /etc/postfix/local-host-names and restart Postifx.
     
  9. adrenalinic

    adrenalinic Member

    Hi.
    I have see a courious problems....i have tryed to send mail from webmail with squirrel mail from email hosted on the same server but is a different domain, to domain which point to google mail server.
    When send this mail....is sended whit mail [email protected] and not [email protected]!!!!!!
    I have see in the virtual user table and not exist any instance whit example.com!!

    :eek:
     
  10. adrenalinic

    adrenalinic Member

    this is a truncated log info of mail.log:

    Sep 10 22:41:16 server3 postfix/smtp[3898]: connect to example.com[192.0.34.166]: Connection timed out (port 25)
    Sep 10 22:41:16 server3 postfix/smtp[3900]: connect to example.com[192.0.34.166]: Connection timed out (port 25)
    Sep 10 22:41:16 server3 postfix/smtp[3898]: 16731EF8E440: to=<[email protected]>, relay=none, delay=151109, status=deferred (connect to example.com[192.0.34.166]: Connection timed out)
    Sep 10 22:41:16 server3 postfix/smtp[3901]: connect to example.com[192.0.34.166]: Connection timed out (port 25)
    Sep 10 22:41:16 server3 postfix/smtp[3900]: 36135EF8E441: to=<[email protected]>, relay=none, delay=151011, status=deferred (connect to example.com[192.0.34.166]: Connection timed out)
    Sep 10 22:41:16 server3 postfix/smtp[3901]: 85942EF8E442: to=<[email protected]>, relay=none, delay=111505, status=deferred (connect to example.com[192.0.34.166]: Connection timed out)
     
  11. adrenalinic

    adrenalinic Member

    hi!
    i have solved this problem.....(of example.com!:eek: )
    but the problem of postfix remain:

    The Postfix program

    <[email protected]>: mail for mysite.com loops back to
    myself
    _______________________________________
    I have tryed to add mysite.com to local host name but when send email receive error message: user not in virtual table...and reject my request
    :confused:
     
  12. adrenalinic

    adrenalinic Member

    Hi..
    I not say how can is possible this problem....

    all dns and A host is correctly configured...:

    A Record
    IP-Adresse Nome Host
    100.100.100.100 www
    100.100.100.100 mail

    My MX is setting up to :

    Mailserver Host
    ASPMX5.GOOGLEMAIL.COM mail
    ASPMX4.GOOGLEMAIL.COM mail
    ASPMX3.GOOGLEMAIL.COM mail
    ASPMX2.GOOGLEMAIL.COM mail
    ALT1.ASPMX.L.GOOGLE.COM mail
    ALT2.ASPMX.L.GOOGLE.COM mail
    ASPMX.L.GOOGLE.COM mail



    domain www.mysite.com is setting to "external mail server"
    codomain mysite.com is setting to "esternal mail server"

    in general postfix conf of ispconfig i not have selected voice "default mx"....i have to select this option?!

    Error:
    ------------------------------------------------------
    The Postfix program

    <[email protected]>: mail for mysite.com loops back to
    myself

    -----------------------------------------------------

    Testing hostname mail.mysite.com

    Getting MX record for mail.mysite.com (from local DNS server, may be cached)... Got it!

    Host Preference IP(s) [Country]
    aspmx.l.google.com. 10 66.249.93.27 [US]66.249.93.114 [US]
    alt1.aspmx.l.google.com. 30 72.14.205.27 [US]
    alt2.aspmx.l.google.com. 40 64.233.167.27 [US]64.233.167.114 [US]
    aspmx2.googlemail.com. 50 64.233.183.27 [US]
    aspmx3.googlemail.com. 60 64.233.167.27 [US]
    aspmx4.googlemail.com. 70 66.249.93.27 [US]
    aspmx5.googlemail.com. 80 66.249.83.27 [US]
    -------------------------------------------------------------------------------

    if try to send mail to [email protected]:

    Getting MX record for mysite.com (from local DNS server, may be cached)... There is no MX record for mysite.com! That's bad.
    Checking for an A record... Got it!

    Host Preference IP(s) [Country]
    mysite.com 0 100.100.100.100 [US]

    ---------------------------------------------------------
    My MX is correctly....


    I do not know more what other to make
    Someone has some possible idea ? :confused:
     
    Last edited: Sep 12, 2006
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Please check your postfix main.cf and /etc/hostname file if they contain mysite.com
     
  14. adrenalinic

    adrenalinic Member

    if add mysite to my local host name...server reject request because [email protected] not is in local recipietn...obvious....

    my main.cf is:

    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no

    # appending .domain is the MUA's job.
    append_dot_mydomain = no

    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h

    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_use_tls = yes
    smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.

    myhostname = server3.myserver.org
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    #mydestination = server3.myserver.org, localhost.myserver.org, , localhost
    relayhost =
    mynetworks = 127.0.0.0/8
    mailbox_command =
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    inet_protocols = all
    smtpd_sasl_local_domain =
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    smtpd_tls_auth_only = no
    smtp_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom
    home_mailbox = Maildir/

    virtual_maps = hash:/etc/postfix/virtusertable

    mydestination = /etc/postfix/local-host-names
    ---------------------------------------------------------------
    error persist..........
     
  15. adrenalinic

    adrenalinic Member

    new error in mail.log:

    Sep 12 06:12:53 server3 postfix/cleanup[11689]: warning: database /etc/postfix/virtusertable.db is older than source file /etc/postfix/virtusertable

    :confused:
     
  16. adrenalinic

    adrenalinic Member

  17. adrenalinic

    adrenalinic Member

    adding....mysite.com to local host names...have:

    Sep 12 06:52:52 server3 postfix/smtpd[28269]: NOQUEUE: reject: RCPT from host188-12-static.29-87-b.business.telecomitalia.it[87.29.12.188]: 550 <[email protected]>: Recipient address rejected: User unknown in local recipient table; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<[127.0.0.1]>
    Sep 12 06:52:57 server3 postfix/smtpd[28269]: lost connection after RCPT from host188-12-static.29-87-b.business.telecomitalia.it[87.29.12.188]
    Sep 12 06:52:57 server3 postfix/smtpd[28269]: disconnect from host188-12-static.29-87-b.business.telecomitalia.it[87.29.12.188]
     
  18. adrenalinic

    adrenalinic Member

    in my.cf of postfix have tryed to add:

    mydestination = server3.myserver.org, localhost, mysite.com, mail.mysite.com, ASPMX2.GOOGLEMAIL.COM

    whit any result....
     
  19. falko

    falko Super Moderator Howtoforge Staff

    I think what you want is an MX record for mysite.com instead of mail.mysite.com. Have a look at these two tutorials, and a lot of things should be clearer: http://www.howtoforge.com/ispconfig_dns_godaddy
    http://www.howtoforge.com/traditional_dns_howto
     
  20. adrenalinic

    adrenalinic Member

    hi.
    i have solved. all my dns setting is ok.
    the problem was in MX listed server...
    that server..will be write whitout the host "mail"....
    :eek:
     

Share This Page