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

how to lookup user via LDAP in Postfix

Expand Messages
  • Zhou, Yan
    Hi there, (This is indeed a postfix question). I am using Postfix and DoveCot together, and my /etc/postfix/master.cf looks like this: (using DoveCot LDA to
    Message 1 of 4 , Jun 22, 2011
      how to lookup user via LDAP in Postfix

      Hi there,

      (This is indeed a postfix question).

      I am using Postfix and DoveCot together, and my /etc/postfix/master.cf looks like this:  (using DoveCot LDA to deliver to user mailboxes)

      dovecot   unix  -       n       n       -       -       pipe

         flags=Rhu user=hubdirect argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}

      Right now the ${recipient}  is the address. I want to specify the user that associates with the address.   This needs to be done via LDAP lookup because we are using virtual users.

      How does Postfix know the user, with a given address?  Is that a configuration in Postfix?

      I know how to verify domain and address with Postfix integrating with LDAP. Is there any way a username lookup can be done via LDAP lookup? 

      Thanks,

      Yan





      Confidentiality Notice: The information contained in this electronic transmission is confidential and may be legally privileged. It is intended only for the addressee(s) named above. If you are not an intended recipient, be aware that any disclosure, copying, distribution or use of the information contained in this transmission is prohibited and may be unlawful. If you have received this transmission in error, please notify us by telephone (513) 229-5500 or by email (postmaster@...). After replying, please erase it from your computer system.

    • Reindl Harald
      ... why should postfix have to know about users? it only have to konw about RCPT and domains, the rest is the job of the MDA and even for authentication
      Message 2 of 4 , Jun 22, 2011
        Am 22.06.2011 22:07, schrieb Zhou, Yan:
        > Hi there,
        >
        > (This is indeed a postfix question).
        >
        > I am using Postfix and DoveCottogether, andmy /etc/postfix/master.cf looks like this: (using DoveCot LDA to
        > deliver to user mailboxes)
        >
        > dovecot unix - n n - - pipe
        >
        > flags=Rhu user=hubdirect argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}
        >
        > Right now the ${recipient} is the address.I want to specify the user that associates with the address. This
        > needs to be done via LDAP lookup because we are using virtual users.
        >
        > How does Postfix know the user, with a given address? Is that a configuration in Postfix?

        why should postfix have to know about users?

        it only have to konw about RCPT and domains, the rest is the job of the MDA
        and even for authentication postfix supports dovecot native for SASL
      • Benny Pedersen
        ... if dovecot had alias table, then postfix virtual was not needed, dovecot lda could hook into postfix like procmail then postfix does not need to know
        Message 3 of 4 , Jun 25, 2011
          On Wed, 22 Jun 2011 22:48:00 +0200, Reindl Harald wrote:

          > it only have to konw about RCPT and domains, the rest is the job of
          > the MDA
          > and even for authentication postfix supports dovecot native for SASL

          if dovecot had alias table, then postfix virtual was not needed,
          dovecot lda could hook into postfix like procmail then

          postfix does not need to know anything
        • mouss
          ... do that in dovecot. ... what is a user ? if you insist on doing this in postfix, then 1) use virtual_alias_maps to convert the address to
          Message 4 of 4 , Jun 26, 2011
            Le 22/06/2011 22:07, Zhou, Yan a écrit :
            > Hi there,
            >
            > (This is indeed a postfix question).
            >
            > I am using Postfix and DoveCot together, and my /etc/postfix/master.cf
            > looks like this: (using DoveCot LDA to deliver to user mailboxes)
            >
            > dovecot unix - n n - - pipe
            > flags=Rhu user=hubdirect argv=/usr/libexec/dovecot/deliver -f
            > ${sender} -d ${recipient}
            >
            > Right now the ${recipient} is the address. I want to specify the user
            > that associates with the address.

            do that in dovecot.

            > This needs to be done via LDAP
            > lookup because we are using virtual users.
            >
            > How does Postfix know the user, with a given address?

            what is a "user"?

            if you insist on doing this in postfix, then
            1) use virtual_alias_maps to convert the address to
            someuser@....

            2) in the pipe that defines dovecot, use -d ${user}

            but note:
            - this removes the domain part, so you must make sure all users map to a
            different user in the fixeddomain.example

            - this doesn't pass the '+' extension. so you can't use this feature in
            dovecot (storing extension mail in subfolders).

            you've been warned.

            > Is that a configuration in Postfix?

            when delivering with "virtual", virtual_uid_maps and virtual_gid_maps
            yield the uid and gid of the mailbox. but that's when postfix delivers
            mail. not if using an external MDA or relaying mail to another server.

            >
            > I know how to verify domain and address with Postfix integrating with
            > LDAP. Is there any way a username lookup can be done via LDAP lookup?
            >
            > Thanks,
            > Yan
            >
            >
            >
            >
            >
            > Confidentiality Notice: The information contained in this electronic transmission is confidential and may be legally privileged. It is intended only for the addressee(s) named above. If you are not an intended recipient, be aware that any disclosure, copying, distribution or use of the information contained in this transmission is prohibited and may be unlawful. If you have received this transmission in error, please notify us by telephone (513) 229-5500 or by email (postmaster@...). After replying, please erase it from your computer system.
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.