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

Using MySQL for virtual_users

Expand Messages
  • Michael Carter
    Hello all, I m trying to use MySQL for temporary/throwaway address management for one of my hosted domains. I ve set up MySQL so that it returns a local user
    Message 1 of 8 , Jul 15, 2014
      Hello all,

      I'm trying to use MySQL for temporary/throwaway address management for one of my hosted domains.
      I've set up MySQL so that it returns a local user name when it finds a match.
      I've tested this using postmap:

      postmap -q "test1@..." mysql:/etc/postfix/mysql-virt-users.cf

      When I try this I get back the correct local user name:
      In main.cf, I've added this file to the virtual_users line:

      virtual_alias_maps = $virtual_maps hash:/etc/postfix/virtual_users hash:/Library/Server/Mail/Config/postfix/virtual_users mysql:/etc/postfix/mysq-virt-users.cf

      When I try to email to this address, I get an immediate bounce:

      Recipient address rejected: User unknown in virtual alias table

      Here is the log entry:

      Jul 15 19:25:04 mail.mydomain.org postfix/smtpd[29356]: NOQUEUE: reject: RCPT from nk11p08mm-asmtp002.mac.com[17.158.58.247]: 550 5.1.1 <test1@...>: Recipient address rejected: User unknown in virtual alias table; from=<avidflyer@...> to=<test1@...> proto=ESMTP helo=<nk11p08mm-asmtp002.mac.com>

      Of course, when I add the address to the actual virtual_users table it works fine.
      I've tried this using alias_maps instead, and also removing all other mappings from 'virtual_user_maps' entry and just leaving the mysql:... part.
      No luck.

      What I can't find a reference for is should the query be returning just the username of a local user? I've tried returning that, and also 'user@localhost' and 'user@...' with similar results.

      Can anyone provide any input?

      Thanks,
      #mikec
    • Viktor Dukhovni
      ... Look carefully at the above, pay attention to detail. -- Viktor.
      Message 2 of 8 , Jul 16, 2014
        On Tue, Jul 15, 2014 at 07:42:16PM -0700, Michael Carter wrote:

        > I've tested this using postmap:
        >
        > postmap -q "test1@..." mysql:/etc/postfix/mysql-virt-users.cf
        >
        > When I try this I get back the correct local user name:
        > In main.cf, I've added this file to the virtual_users line:
        >
        > virtual_alias_maps = $virtual_maps hash:/etc/postfix/virtual_users hash:/Library/Server/Mail/Config/postfix/virtual_users mysql:/etc/postfix/mysq-virt-users.cf

        Look carefully at the above, pay attention to detail.

        --
        Viktor.
      • Mike Carter
        The file names match on my system. I hand typed them here. Any other input? Sent from my iPhone
        Message 3 of 8 , Jul 16, 2014
          The file names match on my system. I hand typed them here.

          Any other input?

          Sent from my iPhone

          > On Jul 16, 2014, at 12:45 AM, Viktor Dukhovni <postfix-users@...> wrote:
          >
          >> On Tue, Jul 15, 2014 at 07:42:16PM -0700, Michael Carter wrote:
          >>
          >> I've tested this using postmap:
          >>
          >> postmap -q "test1@..." mysql:/etc/postfix/mysql-virt-users.cf
          >>
          >> When I try this I get back the correct local user name:
          >> In main.cf, I've added this file to the virtual_users line:
          >>
          >> virtual_alias_maps = $virtual_maps hash:/etc/postfix/virtual_users hash:/Library/Server/Mail/Config/postfix/virtual_users mysql:/etc/postfix/mysq-virt-users.cf
          >
          > Look carefully at the above, pay attention to detail.
          >
          > --
          > Viktor.
        • lists@rhsoft.net
          ... read what you posted! mysq-virt-users.cf != mysql-virt-users.cf why don t you just use copy&paste?
          Message 4 of 8 , Jul 16, 2014
            Am 16.07.2014 15:39, schrieb Mike Carter:
            > The file names match on my system. I hand typed them here.
            > Any other input?

            read what you posted!

            "mysq-virt-users.cf" != "mysql-virt-users.cf"
            why don't you just use copy&paste?

            >> On Jul 16, 2014, at 12:45 AM, Viktor Dukhovni <postfix-users@...> wrote:
            >>
            >>> On Tue, Jul 15, 2014 at 07:42:16PM -0700, Michael Carter wrote:
            >>>
            >>> I've tested this using postmap:
            >>>
            >>> postmap -q "test1@..." mysql:/etc/postfix/mysql-virt-users.cf
            >>>
            >>> When I try this I get back the correct local user name:
            >>> In main.cf, I've added this file to the virtual_users line:
            >>>
            >>> virtual_alias_maps = $virtual_maps hash:/etc/postfix/virtual_users hash:/Library/Server/Mail/Config/postfix/virtual_users mysql:/etc/postfix/mysq-virt-users.cf
            >>
            >> Look carefully at the above, pay attention to detail.
          • Mike Carter
            Yes, I mis-typed them here. I see that. Let s just assume that they match on my system and move beyond that as a reason. So assuming the references are
            Message 5 of 8 , Jul 16, 2014
              Yes, I mis-typed them here. I see that. Let's just assume that they match on my system and move beyond that as a reason.

              So assuming the references are correct, the files match, etc etc, what *else* should I be looking at.

              Thanks.

              Sent from my iPhone

              > On Jul 16, 2014, at 6:46 AM, "lists@..." <lists@...> wrote:
              >
              >
              >
              > Am 16.07.2014 15:39, schrieb Mike Carter:
              >> The file names match on my system. I hand typed them here.
              >> Any other input?
              >
              > read what you posted!
              >
              > "mysq-virt-users.cf" != "mysql-virt-users.cf"
              > why don't you just use copy&paste?
              >
              >>>> On Jul 16, 2014, at 12:45 AM, Viktor Dukhovni <postfix-users@...> wrote:
              >>>>
              >>>> On Tue, Jul 15, 2014 at 07:42:16PM -0700, Michael Carter wrote:
              >>>>
              >>>> I've tested this using postmap:
              >>>>
              >>>> postmap -q "test1@..." mysql:/etc/postfix/mysql-virt-users.cf
              >>>>
              >>>> When I try this I get back the correct local user name:
              >>>> In main.cf, I've added this file to the virtual_users line:
              >>>>
              >>>> virtual_alias_maps = $virtual_maps hash:/etc/postfix/virtual_users hash:/Library/Server/Mail/Config/postfix/virtual_users mysql:/etc/postfix/mysq-virt-users.cf
              >>>
              >>> Look carefully at the above, pay attention to detail.
            • lists@rhsoft.net
              ... nobody is interested in assume anything * missing output of postconf -n (copy&paste not read and re-type) * missing copy&paste from the postconf command
              Message 6 of 8 , Jul 16, 2014
                Am 16.07.2014 15:49, schrieb Mike Carter:
                > Yes, I mis-typed them here. I see that. Let's just assume that they match on my system and move beyond that as a reason.
                > So assuming the references are correct, the files match, etc etc, what *else* should I be looking at.

                nobody is interested in assume anything

                * missing output of "postconf -n" (copy&paste not read and re-type)
                * missing copy&paste from the postconf command *and* it's output

                >> On Jul 16, 2014, at 6:46 AM, "lists@..." <lists@...> wrote:
                >>
                >>
                >>
                >> Am 16.07.2014 15:39, schrieb Mike Carter:
                >>> The file names match on my system. I hand typed them here.
                >>> Any other input?
                >>
                >> read what you posted!
                >>
                >> "mysq-virt-users.cf" != "mysql-virt-users.cf"
                >> why don't you just use copy&paste?
                >>
                >>>>> On Jul 16, 2014, at 12:45 AM, Viktor Dukhovni <postfix-users@...> wrote:
                >>>>>
                >>>>> On Tue, Jul 15, 2014 at 07:42:16PM -0700, Michael Carter wrote:
                >>>>>
                >>>>> I've tested this using postmap:
                >>>>>
                >>>>> postmap -q "test1@..." mysql:/etc/postfix/mysql-virt-users.cf
                >>>>>
                >>>>> When I try this I get back the correct local user name:
                >>>>> In main.cf, I've added this file to the virtual_users line:
                >>>>>
                >>>>> virtual_alias_maps = $virtual_maps hash:/etc/postfix/virtual_users hash:/Library/Server/Mail/Config/postfix/virtual_users mysql:/etc/postfix/mysq-virt-users.cf
                >>>>
                >>>> Look carefully at the above, pay attention to detail.
              • Viktor Dukhovni
                ... I m afraid that would be unwise. Post the output of postconf -n (not retyped), and then we ll talk. Also check for any any overrides in master.cf and
                Message 7 of 8 , Jul 16, 2014
                  On Wed, Jul 16, 2014 at 06:49:26AM -0700, Mike Carter wrote:

                  > Yes, I mis-typed them here. I see that. Let's just assume that
                  > they match on my system and move beyond that as a reason.

                  I'm afraid that would be unwise. Post the output of "postconf -n"
                  (not retyped), and then we'll talk. Also check for any any overrides
                  in master.cf and report any that are relevant.

                  --
                  Viktor.
                • Michael Carter
                  Fair enough. Thanks Viktor.
                  Message 8 of 8 , Jul 16, 2014
                    Fair enough. Thanks Viktor.

                    On Jul 16, 2014, at 7:12 AM, Viktor Dukhovni <postfix-users@...> wrote:

                    > On Wed, Jul 16, 2014 at 06:49:26AM -0700, Mike Carter wrote:
                    >
                    >> Yes, I mis-typed them here. I see that. Let's just assume that
                    >> they match on my system and move beyond that as a reason.
                    >
                    > I'm afraid that would be unwise. Post the output of "postconf -n"
                    > (not retyped), and then we'll talk. Also check for any any overrides
                    > in master.cf and report any that are relevant.
                    >
                    > --
                    > Viktor.
                  Your message has been successfully submitted and would be delivered to recipients shortly.