Postfix relay question

Discussion in 'Server Operation' started by kule, Mar 20, 2010.

  1. kule

    kule New Member

    Hi Guys,

    Wonder if anyone can shed any light on this. I have 2 servers one which uses a postfix relay to the main postfix email server.

    This all works great (thanks for the tutorials Falko) however I have noticed on the email server when emails are sent via the relay:

    Code:
    example.com = x.x.x.1 = relay
    mail.example.com = x.x.x.2 = postfix email server
    
    postfix/smtpd[xxx]: warning: x.x.x.1 address not listed for hostname mail.example.com
    As I understand it; it's because the reverse dns of x.x.x.1 doesn't equate to mail.example.com however as it's connecting from the relay shouldn't be trying a lookup of x.x.x.1 to example.com not mail.example.com?

    It's not a biggie as it's all working but I would like to understand whats happening and fix it if possible.

    Thanks
    Luke
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Does mail.example.com point to x.x.x.1?
     
  3. kule

    kule New Member

    No:

    example.com = x.x.x.1 = relay
    mail.example.com = x.x.x.2 = postfix email server

    example.com[x.x.x.1] is my webserver which relays emails to the postfix on mail.example.com[x.x.x.2]
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Can you post your main.cf from both servers?
     
  5. kule

    kule New Member

    example.com[relay]:

    Code:
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no
    
    append_dot_mydomain = no
    
    myhostname = example1
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = localhost.localdomain, localhost
    relayhost = mail.example.com
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_sasl_security_options = 
    mynetworks = 127.0.0.0/8
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    
    readme_directory = /usr/share/doc/postfix
    html_directory = /usr/share/doc/postfix/html
    mail.example.com[mail server]

    Code:
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no
    
    append_dot_mydomain = no
    
    # TLS parameters
    smtpd_tls_cert_file=/etc/postfix/smtpd.cert
    smtpd_tls_key_file=/etc/postfix/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
    
    myhostname = mail.example.com
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = mail.example.com, localhost.localdomain, localhost
    relayhost = 
    mynetworks = 127.0.0.0/8
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    
    #Virtual Setup
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /home/vmail
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_create_maildirsize = yes
    virtual_mailbox_extended = yes
    virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
    virtual_mailbox_limit_override = yes
    virtual_maildir_limit_message = "The user you are trying to reach is over quota."
    virtual_overquota_bounce = yes
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
    
    header_checks = regexp:/etc/postfix/header_checks
    
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings
    
    readme_directory = /usr/share/doc/postfix
    html_directory = /usr/share/doc/postfix/html
     
  6. sjau

    sjau Local Meanie Moderator

    have you tried using the IP of the main server or adding an entry to the /etc/hosts file? Can you ping mail.domain.com from the relay server?
     
  7. kule

    kule New Member

    Hi sjau

    Yep you can ping mail.example.com from the relay server.

    Just to clarify again - everything works ok and email sent from the relay is delivered. I just get a weird warning on the mail server, which I would like to understand & if possible fix.

    Can you clarify about putting an entry in the /etc/hosts file? Did you mean on the mail server?

    Kind Regards
    Luke
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Can you change
    Code:
    myhostname = example1
    to
    Code:
    myhostname = example.com
    on the example.com server?

    What's in /etc/mailname on both servers?
     
  9. kule

    kule New Member

    I changed the /etc/hostname & the myhostname to example.com - fingers crossed I think that sorted it.

    /etc/mailname was example.com in both so I adjusted the mail server to be mail.example.com as well anyways.

    Many thanks for your time with this.

    Luke
     

Share This Page