Loading ...
Sorry, an error occurred while loading the content.

transport between servers with the same domain

Expand Messages
  • Ignacio Vazquez
    Hi there, We have a mail relay in the DMZ (SRV1) which receives all mail sent to example dot com, but we also have an additional server on the internal network
    Message 1 of 5 , Jun 29, 2009
    • 0 Attachment
      Hi there,

      We have a mail relay in the DMZ (SRV1) which receives all mail sent to
      example dot com, but we also have an additional server on the internal
      network (SRV2) wich receives some mails from the same domain. To do
      this in SRV1, the transport has:
      user1@... smtp:ip_SRV2
      user1@... smtp:ip_SRV2
      ...

      In SRV2:
           mydestination = example.com
      In /etc/postfix/transport of SRV2:
           user1@... local:
           user2@... local:
           ...
      In /etc/aliases (SRV2):
           user1 "| command"

      The problem comes when I want to send emails from SRV2 to example.com
      domain users who are in the /etc/postfix/transport of SRV2.
      Sending to other users in the domain example.com is correct.

      I use fallback_transport for it, the SRV2 configuration is:

      postconf -n:
      alias_database = hash:/etc/aliases, hash:/etc/mail/sympa_aliases,
      hash:/etc/mail/mailman
      alias_maps = hash:/etc/aliases, hash:/etc/mail/sympa_aliases, hash:/
      etc/mail/mailman
      append_dot_mydomain = no
      biff = no
      config_directory = /etc/postfix
      fallback_transport = [SRV1]:587
      inet_interfaces = all
      local_recipient_maps = $alias_maps, $alias_database, $transport_maps
      mailbox_command = maildrop
      mailbox_size_limit = 0
      message_size_limit = 25640000
      mydestination = $myhostname localhost, localhost.localdomain,
      $mydomain
      mydomain = example.com
      myhostname = SRV2.example.com
      mynetworks = 127.0.0.0/8
      myorigin = example.com
      recipient_delimiter = +
      relayhost = [SRV1]:587    # We use SRV1 to sign mails with domainkeys
      smtp_host_lookup = native
      smtp_sasl_auth_enable = yes
      smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
      smtp_sasl_security_options = noanonymous
      smtp_use_tls = yes
      smtpd_banner = $myhostname ESMTP
      smtpd_recipient_restrictions = permit_mynetworks,
      reject_unauth_destination
      smtpd_sender_restrictions = permit_mynetworks
      transport_maps = regexp:/etc/postfix/transport_
      mailman, hash:/etc/
      postfix/transport
      unknown_local_recipient_reject_code = 550


      The contents of /etc/postfix/transport (SRV2) is:
           user1@... local
           example.com smtp: ip_SRV1
      However, when SRV2 try to send a mail to user1@..., it sends
      to the relayhost (SRV1), instead of knowing that is local.

      For further confusion, sending users to match regexp:/etc/postfix/
      transport_mailman is successful.

      Thank you very much for your help,

      Greetings
    • Ignacio Vazquez
      It seems like postfix doesn t like two transports (regexp and hash) in the transport_maps... ¿could anyone help me? 2009/6/29 Ignacio Vazquez
      Message 2 of 5 , Jun 30, 2009
      • 0 Attachment
        It seems like postfix doesn't like two transports (regexp and hash) in the transport_maps...

        ¿could anyone help me?


        2009/6/29 Ignacio Vazquez <ivaicio@...>
        Hi there,

        We have a mail relay in the DMZ (SRV1) which receives all mail sent to
        example dot com, but we also have an additional server on the internal
        network (SRV2) wich receives some mails from the same domain. To do
        this in SRV1, the transport has:
        user1@... smtp:ip_SRV2
        user1@... smtp:ip_SRV2
        ...

        In SRV2:
             mydestination = example.com
        In /etc/postfix/transport of SRV2:
             user1@... local:
             user2@... local:
             ...
        In /etc/aliases (SRV2):
             user1 "| command"

        The problem comes when I want to send emails from SRV2 to example.com
        domain users who are in the /etc/postfix/transport of SRV2.
        Sending to other users in the domain example.com is correct.

        I use fallback_transport for it, the SRV2 configuration is:

        postconf -n:
        alias_database = hash:/etc/aliases, hash:/etc/mail/sympa_aliases,
        hash:/etc/mail/mailman
        alias_maps = hash:/etc/aliases, hash:/etc/mail/sympa_aliases, hash:/
        etc/mail/mailman
        append_dot_mydomain = no
        biff = no
        config_directory = /etc/postfix
        fallback_transport = [SRV1]:587
        inet_interfaces = all
        local_recipient_maps = $alias_maps, $alias_database, $transport_maps
        mailbox_command = maildrop
        mailbox_size_limit = 0
        message_size_limit = 25640000
        mydestination = $myhostname localhost, localhost.localdomain,
        $mydomain
        mydomain = example.com
        myhostname = SRV2.example.com
        mynetworks = 127.0.0.0/8
        myorigin = example.com
        recipient_delimiter = +
        relayhost = [SRV1]:587    # We use SRV1 to sign mails with domainkeys
        smtp_host_lookup = native
        smtp_sasl_auth_enable = yes
        smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
        smtp_sasl_security_options = noanonymous
        smtp_use_tls = yes
        smtpd_banner = $myhostname ESMTP
        smtpd_recipient_restrictions = permit_mynetworks,
        reject_unauth_destination
        smtpd_sender_restrictions = permit_mynetworks
        transport_maps = regexp:/etc/postfix/transport_
        mailman, hash:/etc/
        postfix/transport
        unknown_local_recipient_reject_code = 550


        The contents of /etc/postfix/transport (SRV2) is:
             user1@... local
             example.com smtp: ip_SRV1
        However, when SRV2 try to send a mail to user1@..., it sends
        to the relayhost (SRV1), instead of knowing that is local.

        For further confusion, sending users to match regexp:/etc/postfix/
        transport_mailman is successful.

        Thank you very much for your help,

        Greetings

      • Ralf Hildebrandt
        ... No, that works like a charm -- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin
        Message 3 of 5 , Jun 30, 2009
        • 0 Attachment
          * Ignacio Vazquez <ivaicio@...>:

          > It seems like postfix doesn't like two transports (regexp and hash) in the
          > transport_maps...

          No, that works like a charm

          --
          Ralf Hildebrandt
          Geschäftsbereich IT | Abteilung Netzwerk
          Charité - Universitätsmedizin Berlin
          Campus Benjamin Franklin
          Hindenburgdamm 30 | D-12203 Berlin
          Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
          ralf.hildebrandt@... | http://www.charite.de
        • Ignacio Vazquez Alvarez
          ... I think I found where is the problem... In SRV2 (the internal server) i have: cat /etc/postfix/transport_mailman /^bol_.*@example.com$/ local:
          Message 4 of 5 , Jul 1 12:37 AM
          • 0 Attachment
            Ralf Hildebrandt escribió:
            > * Ignacio Vazquez <ivaicio@...>:
            >
            >
            >> It seems like postfix doesn't like two transports (regexp and hash) in the
            >> transport_maps...
            >>
            >
            > No, that works like a charm
            >
            >
            I think I found where is the problem...
            In SRV2 (the internal server) i have:

            cat /etc/postfix/transport_mailman
            /^bol_.*@...$/ local:
            /.*@.../ smtp:ip_SRV1

            cat /etc/mail/mailman
            bol_test: "|/usr/lib/mailman/mail/mailman"
            ...

            cat /etc/postfix/transport
            user1@... local:
            example.com smtp:ip_SRV1

            cat /etc/mail/sympa_aliases
            user1: "| /home/sympa/bin/queue"


            If i send a mail to bol_test@... postfix knows that it's local
            and looks aliases (/etc/mail/mailman) and the command is executed.
            However, if i send a mail to user1@..., it is relayed to SRV1
            although in /etc/postfix/transport i say user1 is local.
            Well, i think the problem is in the line of etc/postfix/transport_mailman:
            /.*@.../ smtp:ip_SRV1
            I added this line to specify "all directions other than
            /^bol_.*@...$/, send it to srv1"

            Does this line is needed?
            What is the best way to do what I explained?
          • Ignacio Vazquez
            ... A little help please. If more data are needed, I ll be happy to send it.
            Message 5 of 5 , Jul 2 3:44 AM
            • 0 Attachment
              2009/6/29, Ignacio Vazquez <ivaicio@...>:
              > Hi there,
              >
              > We have a mail relay in the DMZ (SRV1) which receives all mail sent to
              > example dot com, but we also have an additional server on the internal
              > network (SRV2) wich receives some mails from the same domain. To do
              > this in SRV1, the transport has:
              > user1@... smtp:ip_SRV2
              > user1@... smtp:ip_SRV2
              > ...
              >
              > In SRV2:
              > mydestination = example.com
              > In /etc/postfix/transport of SRV2:
              > user1@... local:
              > user2@... local:
              > ...
              > In /etc/aliases (SRV2):
              > user1 "| command"
              >
              > The problem comes when I want to send emails from SRV2 to example.com
              > domain users who are in the /etc/postfix/transport of SRV2.
              > Sending to other users in the domain example.com is correct.
              >
              > I use fallback_transport for it, the SRV2 configuration is:
              >
              > postconf -n:
              > alias_database = hash:/etc/aliases, hash:/etc/mail/sympa_aliases,
              > hash:/etc/mail/mailman
              > alias_maps = hash:/etc/aliases, hash:/etc/mail/sympa_aliases, hash:/
              > etc/mail/mailman
              > append_dot_mydomain = no
              > biff = no
              > config_directory = /etc/postfix
              > fallback_transport = [SRV1]:587
              > inet_interfaces = all
              > local_recipient_maps = $alias_maps, $alias_database, $transport_maps
              > mailbox_command = maildrop
              > mailbox_size_limit = 0
              > message_size_limit = 25640000
              > mydestination = $myhostname localhost, localhost.localdomain,
              > $mydomain
              > mydomain = example.com
              > myhostname = SRV2.example.com <http://srv2.example.com/>
              > mynetworks = 127.0.0.0/8
              > myorigin = example.com
              > recipient_delimiter = +
              > relayhost = [SRV1]:587 # We use SRV1 to sign mails with domainkeys
              > smtp_host_lookup = native
              > smtp_sasl_auth_enable = yes
              > smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
              > smtp_sasl_security_options = noanonymous
              > smtp_use_tls = yes
              > smtpd_banner = $myhostname ESMTP
              > smtpd_recipient_restrictions = permit_mynetworks,
              > reject_unauth_destination
              > smtpd_sender_restrictions = permit_mynetworks
              > transport_maps = regexp:/etc/postfix/transport_mailman, hash:/etc/
              > postfix/transport
              > unknown_local_recipient_reject_code = 550
              >
              >
              > The contents of /etc/postfix/transport (SRV2) is:
              > user1@... local
              > example.com smtp: ip_SRV1
              > However, when SRV2 try to send a mail to user1@..., it sends
              > to the relayhost (SRV1), instead of knowing that is local.
              >
              > For further confusion, sending users to match regexp:/etc/postfix/
              > transport_mailman is successful.
              >
              > Thank you very much for your help,
              >
              > Greetings
              >


              A little help please.
              If more data are needed, I'll be happy to send it.
            Your message has been successfully submitted and would be delivered to recipients shortly.