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

Local aliases problem?

Expand Messages
  • Peter Serwe
    I ve recently converted a sendmail outbound relay and backup MX box to postfix, and while I have a bit of experience with qmail, exim, sendmail, and a few
    Message 1 of 6 , May 1, 2008
    • 0 Attachment
      I've recently converted a sendmail outbound relay and backup MX box to postfix,
      and while I have a bit of experience with qmail, exim, sendmail, and a
      few other MTA's,
      postfix is being somewhat elusive for this one particular issue.

      I send mail to the localhost from various cron'd applications that
      need to report status
      and send the mail out to a small distribution list. In the sendmail
      world, I used /etc/aliases
      to accomplish this and it worked fairly smoothly.

      Now, however, I have sendmail complaining that those aliases loop back
      to itself, and
      refuses to parse the aliases and distribute the mail to the
      recipients. It seems like it's
      not actually parsing /etc/aliases at all, and I've tried every means I
      could figure out to
      make it perform this behavior.

      Towards that end, I configured my /etc/postfix/main.cf thusly:

      # ALIAS DATABASE
      #
      # The alias_maps parameter specifies the list of alias databases used
      # by the local delivery agent. The default list is system dependent.
      #
      # On systems with NIS, the default is to search the local alias
      # database, then the NIS alias database. See aliases(5) for syntax
      # details.
      #
      # If you change the alias database, run "postalias /etc/aliases" (or
      # wherever your system stores the mail alias file), or simply run
      # "newaliases" to build the necessary DBM or DB file.
      #
      # It will take a minute or so before changes become visible. Use
      # "postfix reload" to eliminate the delay.
      #
      #alias_maps = dbm:/etc/aliases
      alias_maps = hash:/etc/aliases
      #alias_maps = hash:/etc/aliases, nis:mail.aliases
      #alias_maps = netinfo:/aliases

      # The alias_database parameter specifies the alias database(s) that
      # are built with "newaliases" or "sendmail -bi". This is a separate
      # configuration parameter, because alias_maps (see above) may specify
      # tables that are not necessarily all under control by Postfix.
      #
      #alias_database = dbm:/etc/aliases
      #alias_database = dbm:/etc/mail/aliases
      alias_database = hash:/etc/aliases
      #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases

      And have run postalias innumerable times, still without the result I'm
      expecting.

      Instead, I get these messages which I'm assuming indicates correct behavior
      on the part of postfix according to the way I'm unfortunately configured:

      May 1 15:31:16 testbed sendmail[2224]: m41MVGfD002224: from=rancid,
      size=258, class=-60, nrcpts=1,
      msgid=<200805012231.m41MVGfD002224@...>,
      relay=rancid@localhost
      May 1 15:31:16 testbed postfix/smtpd[1967]: connect from
      localhost.localdomain[127.0.0.1]
      May 1 15:31:16 testbed postfix/smtpd[1967]: D6D92CA0034:
      client=localhost.localdomain[127.0.0.1]
      May 1 15:31:16 testbed postfix/cleanup[2228]: D6D92CA0034:
      message-id=<200805012231.m41MVGfD002224@...>
      May 1 15:31:16 testbed sendmail[2224]: m41MVGfD002224:
      to=rancid-admin-cpe, ctladdr=rancid (200/500), delay=00:00:00,
      xdelay=00:00:00, mailer=relay, pri=138258, relay=[127.0.0.1]
      [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as D6D92CA0034)
      May 1 15:31:16 testbed postfix/qmgr[3071]: D6D92CA0034:
      from=<rancid@...>, size=790, nrcpt=1 (queue active)
      May 1 15:31:16 testbed postfix/smtpd[1967]: disconnect from
      localhost.localdomain[127.0.0.1]
      May 1 15:31:16 testbed postfix/smtp[2229]: D6D92CA0034:
      to=<rancid-admin-cpe@...>, relay=none, delay=0,
      status=bounced (mail for testbed.my.domain loops back to myself)
      May 1 15:31:16 testbed postfix/cleanup[2228]: F2789714001:
      message-id=<20080501223116.F2789714001@...>
      May 1 15:31:16 testbed postfix/qmgr[3071]: F2789714001: from=<>,
      size=2581, nrcpt=1 (queue active)
      May 1 15:31:17 testbed postfix/qmgr[3071]: D6D92CA0034: removed
      May 1 15:31:17 testbed postfix/smtp[2229]: F2789714001:
      to=<rancid@...>, relay=none, delay=1, status=bounced
      (mail for testbed.my.domain loops back to myself)
      May 1 15:31:17 testbed postfix/qmgr[3071]: F2789714001: removed

      Postfix is performing flawlessly in it's roles as a backup MX and a
      local relay for hosts here on my networks,
      just not for this seemingly trivial, yet important local alias-style
      distribution list functionality.

      Peter

      --
      ピーター
    • Wietse Venema
      ... Where should testbed.my.domain be delivered? What main.cf parameter is responsible for this decision? Wietse
      Message 2 of 6 , May 1, 2008
      • 0 Attachment
        > May 1 15:31:16 testbed postfix/smtp[2229]: D6D92CA0034:
        > to=<rancid-admin-cpe@...>, relay=none, delay=0,
        > status=bounced (mail for testbed.my.domain loops back to myself)

        Where should testbed.my.domain be delivered? What main.cf
        parameter is responsible for this decision?

        Wietse
      • Peter Serwe
        I think, apparently incorrectly, that it should be delivered via /etc/aliases to the external email aliases I specify. The main.cf parameter I think, again
        Message 3 of 6 , May 1, 2008
        • 0 Attachment
          I think, apparently incorrectly, that it should be delivered via
          /etc/aliases to the external email aliases I specify.

          The main.cf parameter I think, again apparently incorrectly, is the
          line that says:

          alias_maps = hash:/etc/aliases

          Peter

          On Thu, May 1, 2008 at 4:04 PM, Wietse Venema <wietse@...> wrote:
          >> May 1 15:31:16 testbed postfix/smtp[2229]: D6D92CA0034:
          >> to=<rancid-admin-cpe@...>, relay=none, delay=0,
          >> status=bounced (mail for testbed.my.domain loops back to myself)
          >
          > Where should testbed.my.domain be delivered? What main.cf
          > parameter is responsible for this decision?
          >
          > Wietse
          >



          --
          ピーター
        • Victor Duchovni
          ... See ADDRESS_REWRITING_README, aliases(5) only applies to *local* deliveries. You are sending the mail via smtp to yourself.
          Message 4 of 6 , May 1, 2008
          • 0 Attachment
            On Thu, May 01, 2008 at 07:11:53PM -0700, Peter Serwe wrote:

            > I think, apparently incorrectly, that it should be delivered via
            > /etc/aliases to the external email aliases I specify.
            >
            > The main.cf parameter I think, again apparently incorrectly, is the
            > line that says:
            >
            > alias_maps = hash:/etc/aliases

            See ADDRESS_REWRITING_README, aliases(5) only applies to *local*
            deliveries. You are sending the mail via smtp to yourself.

            http://www.postfix.org/ADDRESS_REWRITING_README.html#delivering
            http://www.postfix.org/BASIC_CONFIGURATION_README.html#mydestination

            --
            Viktor.

            Disclaimer: off-list followups get on-list replies or get ignored.
            Please do not ignore the "Reply-To" header.

            To unsubscribe from the postfix-users list, visit
            http://www.postfix.org/lists.html or click the link below:
            <mailto:majordomo@...?body=unsubscribe%20postfix-users>

            If my response solves your problem, the best way to thank me is to not
            send an "it worked, thanks" follow-up. If you must respond, please put
            "It worked, thanks" in the "Subject" so I can delete these quickly.
          • Peter Serwe
            Great, problem identified ;) Problem still exists however, in that I still can t get the behavior I want, probably because I still don t understand how to
            Message 5 of 6 , May 1, 2008
            • 0 Attachment
              Great, problem identified ;)

              Problem still exists however, in that I still can't get the behavior I
              want, probably because
              I still don't understand how to communicate that to the MTA.

              What's the right way to accomplish what I'm trying to do? Is there a
              way to route this through
              the local delivery agent, or a way to accomplish this through smtp? I
              understand a few different
              MTA's, but essentially I'm trying to get the behavior I had from
              sendmail, which didn't care how the
              message arrived, but ran it through /etc/aliases irrespective. I
              still don't quite understand what
              postfix wants me to do.

              Peter





              On Thu, May 1, 2008 at 7:17 PM, Victor Duchovni
              <Victor.Duchovni@...> wrote:
              >
              > See ADDRESS_REWRITING_README, aliases(5) only applies to *local*
              > deliveries. You are sending the mail via smtp to yourself.
              >
              > http://www.postfix.org/ADDRESS_REWRITING_README.html#delivering
              > http://www.postfix.org/BASIC_CONFIGURATION_README.html#mydestination
              >
              > --
              > Viktor.
              --
              ピーター
            • mouss
              ... if you want /etc/aliases to have any effect, put the domain in mydestination. do read the docs suggested by Viktor to learn more.
              Message 6 of 6 , May 3, 2008
              • 0 Attachment
                Peter Serwe wrote:
                > Great, problem identified ;)
                >
                > Problem still exists however, in that I still can't get the behavior I
                > want, probably because
                > I still don't understand how to communicate that to the MTA.
                >
                > What's the right way to accomplish what I'm trying to do? Is there a
                > way to route this through
                > the local delivery agent, or a way to accomplish this through smtp? I
                > understand a few different
                > MTA's, but essentially I'm trying to get the behavior I had from
                > sendmail, which didn't care how the
                > message arrived, but ran it through /etc/aliases irrespective. I
                > still don't quite understand what
                > postfix wants me to do.
                >


                if you want /etc/aliases to have any effect, put the domain in
                mydestination.

                do read the docs suggested by Viktor to learn more.
              Your message has been successfully submitted and would be delivered to recipients shortly.