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

Re: Trouble configuring backup MX to reject unauth destination

Expand Messages
  • Titanus Eramius
    Fri, 05 Apr 2013 08:49:39 -0400 skrev Brian Evans ... False may be the wrong word, and I m sorry if it is. What I mean is, virtual_mailbox_maps always returns
    Message 1 of 28 , Apr 5, 2013
    • 0 Attachment
      Fri, 05 Apr 2013 08:49:39 -0400 skrev Brian Evans
      <grknight@...>:

      > > Thank you for the link, it was very informative, but didn't solve
      > > the problem. I also tried making a virtual_mailbox_maps MySQL query
      > > that always returned false, but Postfix still accepted all mail,
      > > and then bounced it after Dovecot rejected it.
      >
      > You say you return "false"?
      > Postfix expects to receive no results (a.k.a. 0 rows) if a
      > virtual_mailbox_maps address in mysql does not exist.
      > Do not return "false", empty string, null, or any other value if it
      > does not exist.

      False may be the wrong word, and I'm sorry if it is. What I mean is,
      virtual_mailbox_maps always returns nothing from MySQL, like so:

      titanus@ntdata:/etc/postfix$ sudo postmap -q test@...
      mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
      titanus@ntdata:/etc/postfix$ echo $?
      1
      (this user exists)

      titanus@ntdata:/etc/postfix$ sudo postmap -q non_existent@...
      mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
      titanus@ntdata:/etc/postfix$ echo $?
      1
      (this user does not)

      I did this because I had some trouble constructing the query-string
      Wietse recommended, and thought this would be a simple and easy way to
      test if virtual_mailbox_maps was the problem.

      When trying the syntax within the MySQL CLI, a "Empty set" is returned
      when querying for a non-existent user

      mysql> SELECT username FROM mailbox
      -> WHERE username = 'non_existent@...';
      Empty set (0.00 sec)


      I hope this better explains what I meant
      Cheers
    • Titanus Eramius
      Solved it :-) When sending to unknown users, Postfix now rejects the mail with User unknown in virtual mailbox table , and it does so for hosted (that is,
      Message 2 of 28 , Apr 6, 2013
      • 0 Attachment
        Solved it :-)

        When sending to unknown users, Postfix now rejects the mail with "User
        unknown in virtual mailbox table", and it does so for hosted (that is,
        virtual mailbox domains) domains as well.

        It seems the SRS-daemon* I have been using with the main.cf parameters
        recipient_canonical_maps
        recipient_canonical_classes
        sender_canonical_maps
        sender_canonical_classes

        was the root of the problem. I have just commented them out to solve
        it. Reading through the documentation for those four parameters, does
        not seem to indicate why they would mess with Postfix' ability to use
        virtual_mailbox_maps.

        But I guess my lack of understanding about Postfix internals is a
        problem as well. I am sorry for the wasted time, and would like to
        thank all who helped out.

        Have a nice weekend


        * https://github.com/Fruneau/pfixtools
      Your message has been successfully submitted and would be delivered to recipients shortly.