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

relaying individual virtual domain to new postfix server ?

Expand Messages
  • lists@...
    I would like to transfer some virtual domains to a new postfix server, what is the proper way to do so, I ve tried adding to /etc/main.cf like: relay_domains =
    Message 1 of 3 , Nov 18, 2013
    • 0 Attachment
      I would like to transfer some virtual domains to a new postfix server,
      what is the proper way to do so,

      I've tried adding to /etc/main.cf like:

      relay_domains = dom.org.au
      transport_maps = hash:$config_directory/transport

      and /etc/transport

      dom.org.au smtp:[emu.sbt.net.au]

      that returned a warning
      Nov 19 12:06:49 postfix/trivial-rewrite[24520]: warning: do not list
      domain dom.org.au in BOTH virtual_mailbox_domains and relay_domains

      I've removed dom.org.au from the sql, that removed the error, but, mail
      still gets delivered localy

      Nov 19 12:21:37 geko postfix/qmgr[24491]: 8770E382B93:
      from=<xxx@...>, size=1845, nrcpt=1 (queue active)
      Nov 19 12:22:46 geko postfix/lmtp[29684]: 8770E382B93: to=<ve@...>,
      orig_to=<postmaster@...>, relay=127.0.0.1[127.0.0.1]:10024,
      delay=70, delays=1.4/42/0.26/27, dsn=2.0.0, status=sent (250 2.0.0 from
      MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 44247382BA8)
      Nov 19 12:22:46 geko postfix/qmgr[24491]: 8770E382B93: removed

      what is the proper way to relay virtual domains ?

      grep virtual main.cf
      virtual_transport = lmtp:unix:private/dovecot-lmtp
      virtual_alias_maps = proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf
      virtual_mailbox_base = /var/mail/vhosts
      virtual_mailbox_domains =
      proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
      virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
      virtual_mailbox_limit = $message_size_limit
      virtual_minimum_uid = 5000
      virtual_gid_maps = static:5000
      virtual_uid_maps = static:5000
    • Viktor Dukhovni
      ... This is correct, provided the domain is removed from any other address class. ... Provided this is postmapped and matches the actual domain. ... As
      Message 2 of 3 , Nov 18, 2013
      • 0 Attachment
        On Tue, Nov 19, 2013 at 01:22:12PM +1100, lists@... wrote:

        > I've tried adding to /etc/main.cf like:
        >
        > relay_domains = dom.org.au
        > transport_maps = hash:$config_directory/transport

        This is correct, provided the domain is removed from any other
        address class.

        > and /etc/transport
        >
        > dom.org.au smtp:[emu.sbt.net.au]

        Provided this is postmapped and matches the actual domain.

        > that returned a warning
        > Nov 19 12:06:49 postfix/trivial-rewrite[24520]: warning: do not list
        > domain dom.org.au in BOTH virtual_mailbox_domains and relay_domains

        As expected.

        > I've removed dom.org.au from the sql, that removed the error, but, mail
        > still gets delivered localy
        >
        > Nov 19 12:22:46 geko postfix/lmtp[29684]: 8770E382B93: to=<ve@...>,
        > orig_to=<postmaster@...>, relay=127.0.0.1[127.0.0.1]:10024,
        > delay=70, delays=1.4/42/0.26/27, dsn=2.0.0, status=sent (250 2.0.0 from
        > MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 44247382BA8)

        Virtual alias rewriting happens first! This recipient got rewritten
        to an unrelated domain. Your test is flawed.

        When you post logs, read them. Saves public humiliation. :-)

        --
        Viktor.
      • lists@...
        ... .. ... .. ... .. ... .. ... Viktor, thank you, public humilation is nothing compared to private frustration, belive me thanks for confirms/comments! ... #
        Message 3 of 3 , Nov 18, 2013
        • 0 Attachment
          On Tue, November 19, 2013 1:34 pm, Viktor Dukhovni wrote:
          > On Tue, Nov 19, 2013 at 01:22:12PM +1100, lists@... wrote:
          ..
          > This is correct, provided the domain is removed from any other
          > address class.
          ..
          > Provided this is postmapped and matches the actual domain.
          ..
          > As expected.
          ..
          > Virtual alias rewriting happens first! This recipient got rewritten
          > to an unrelated domain. Your test is flawed.
          >
          > When you post logs, read them. Saves public humiliation. :-)

          Viktor,

          thank you, public humilation is nothing compared to private frustration,
          belive me

          thanks for confirms/comments!

          I think I got it, at the risk of more humilation, from old server:
          ----------------
          # grep 676E238242E /var/log/maillog

          Nov 19 14:01:01 geko postfix/smtpd[19029]: 676E238242E:
          client=localhost.localdomain[127.0.0.1]

          Nov 19 14:01:01 geko postfix/cleanup[19909]: 676E238242E:
          message-id=<CAABZnC4qb_eBuOnVZ8vBKyKyCFJAQCgDm+nHQZdO7x34vTq6Gw@...>

          Nov 19 14:01:01 geko postfix/qmgr[24491]: 676E238242E:
          from=<xxx@...>, size=2301, nrcpt=1 (queue active)

          Nov 19 14:01:01 geko amavis[18992]: (18992-07) Passed CLEAN
          {RelayedOpenRelay}, [209.85.215.48]:63081 [209.85.215.48] <xxx@...>
          -> <ve@...>, Message-ID:
          <CAABZnC4qb_eBuOnVZ8vBKyKyCFJAQCgDm+nHQZdO7x34vTq6Gw@...>,
          mail_id: LzbOuupcc3v0, Hits: -0.887, size: 1857, queued_as: 676E238242E,
          25644 ms

          Nov 19 14:01:01 geko postfix/lmtp[18730]: CAFE8381F46:
          to=<ve@...>, relay=127.0.0.1[127.0.0.1]:10024, delay=34,
          delays=2.8/5.2/0.01/26, dsn=2.0.0, status=sent (250 2.0.0 from
          MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 676E238242E)

          Nov 19 14:01:02 geko postfix/smtp[20196]: 676E238242E: to=<ve@...>,
          relay=emu.sbt.net.au[103.15.178.123]:25, delay=1.1,
          delays=0.28/0.03/0.51/0.31, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued
          as 1FF9C5E72C)
          Nov 19 14:01:02 geko postfix/qmgr[24491]: 676E238242E: removed

          new server:
          -----------
          # grep 1FF9C5E72C /var/log/maillog

          Nov 19 14:00:58 emu postfix/smtpd[17448]: 1FF9C5E72C:
          client=unknown[180.235.131.4]

          Nov 19 14:00:58 emu postfix/cleanup[17454]: 1FF9C5E72C:
          message-id=<CAABZnC4qb_eBuOnVZ8vBKyKyCFJAQCgDm+nHQZdO7x34vTq6Gw@...>

          Nov 19 14:00:58 emu postfix/qmgr[12047]: 1FF9C5E72C: from=<xxx@...>,
          size=2478, nrcpt=1 (queue active)

          Nov 19 14:01:00 emu postfix/smtp[17458]: 1FF9C5E72C: to=<ve@...>,
          relay=127.0.0.1[127.0.0.1]:10024, delay=2.8, delays=0.06/0.01/0/2.8,
          dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250
          2.0.0 Ok: queued as DD3735E72D)

          Nov 19 14:01:00 emu postfix/qmgr[12047]: 1FF9C5E72C: removed
        Your message has been successfully submitted and would be delivered to recipients shortly.