relaying mail server changes mail recipient domain?

Discussion in 'Server Operation' started by ralic, Jul 17, 2008.

  1. ralic

    ralic New Member

    Hi all

    I'm having a problem with a mail destination domain name getting changed while in transit between sender server and my receiving server. I think the problem may lie in the DNS, but I'm not 100% sure and would appreciate some input from more experienced admins.

    I have a basic setup which is mail destination for itself and also hosting virtual domains.

    My DNS config for the base host is:
    Code:            A dom.            MX  20   PTR
    DNS config for the virtual domains are:
    my.dom           MX  10        # virtual email - catch and deliver [email protected] addresses     CNAME        # for convenient access to webmail software   CNAME        # for convenient access to web  pages of "virtual host"   MX  10        # virtual email - catch and delivery [email protected] addresses
    The problem lies in emails that are addressed to [email protected]

    Sometimes they are handed over to postfix exactly as they should be. i.e. as [email protected].
    When this happens all is smooth, because that domain is handled virtually.

    But sometimes they get handed over to postfix as user@[B]host[/B].my.dom and then delivery fails because is not virtual and therefore user must exist in /etc/aliases, which it doesn't.

    At first I thought I had my virtual setups wrong and have done a fair bit of research on virtual domains and postfix and eventually resorted to turning on debugging in postfix. Through that I have determined that the problem starts when the relaying mail server issues the RCPT TO command to postfix. Already at that stage the email domain name has been changed, so instead of:
    RCPT TO:<[email protected]>
    I see:
    RCPT TO:<[email protected]>
    And yes, I'm sure I'm typing the recipient address properly. :)

    The only scenario that I can think of is that the relaying domain (I'm sending from a webmail client on another system) is doing some wacky antispam check. Something like:
    RECEIVED ADDRESS: <[email protected]>
    GET IP: ->
    RDNS CHECK: ->
    RELAYED ADDRESS: <[email protected]>
    Is something like that feasible? possible? allowed? a bug?

    Appreciate any insights.

  2. falko

    falko Super Moderator ISPConfig Developer

    What's in /etc/postfix/
  3. ralic

    ralic New Member

    [email protected]:~$ cat /etc/postfix/ | grep -v ^#
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no
    append_dot_mydomain = no
    readme_directory = /usr/share/doc/postfix
    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:${data_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    myhostname =
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = $myhostname, localhost.$mydomain, localhost, localhost.localdomain
    relayhost = 
    mynetworks =
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    html_directory = /usr/share/doc/postfix/html
    virtual_alias_domains = 
    virtual_alias_maps = proxy:mysql:/etc/postfix/, mysql:/etc/postfix/
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/
    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_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_policy_service inet:
    transport_maps = proxy:mysql:/etc/postfix/
    virtual_create_maildirsize = yes
    virtual_maildir_extended = yes
    virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/
    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
    content_filter = amavis:[]:10024
    receive_override_options = no_address_mappings
    mailman_destination_recipient_limit = 1
    Nothing too out of the ordinary there. It should look quite familiar. :)
    I'm pretty sure that my postfix is not the culprit because the change is taking place even before the email arrives at my system.

    I've tried from various webmail clients (gmail, hotmail etc.) and so far, the problem only happens with one of them. I have opened a support ticket with the system concerned, but only got what looks like a junior level response so far.
  4. falko

    falko Super Moderator ISPConfig Developer

    It seems to be so from what I see... But I have no idea why. :(

Share This Page