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

filtering LDA with LDAP virtual

Expand Messages
  • Stephen Byrne
    My system currently uses virtual_mailbox_domains and virtual_mailbox_maps from LDAP (users do not have unix accounts, no ldap-pam) and delivers to Maildirs in
    Message 1 of 2 , Apr 27, 2013
    • 0 Attachment
      My system currently uses virtual_mailbox_domains and
      virtual_mailbox_maps from LDAP (users do not have unix accounts, no
      ldap-pam) and delivers to Maildirs in
      /var/mail/vhosts/${domain}/${user}/Maildir/, all of which are owned by
      vmail:vmail.

      I would like to have the LDA do filtering at delivery time. I would love
      to be able to have per-virtual-user filtering config in
      /var/mail/vhosts/${domain}/${user}, but would settle for a single
      system-wide filtering configuration.

      I tried getting postdrop or /usr/lib/dovecot/deliver to do this with a
      virtual_transport, but I ran into a few issues. Firstly, the argv macros
      documented in 'man 8 pipe' do not seem to have a way to pass the Maildir
      path, but I can hard-code '/var/mail/vhosts/${domain}/${user}' in the
      master.cf line and ignore virtual_mailbox_base in main.cf. Secondly,
      postdrop and dovecot's deliver both seem to want to do authentication
      using the user from the pipe args in master.cf, but there are no
      corresponding unix accounts.

      How should I go about trying to do this?

      The relevant configuration:

      from main.cf
      virtual_mailbox_domains = ldap:/etc/postfix/ldap-virtual-domain.cf
      virtual_mailbox_maps = ldap:/etc/postfix/ldap-virtual-mailbox.cf
      virtual_mailbox_base = /var/mail/vhosts
      virtual_uid_maps = static:5000 # vmail
      virtual_gid_maps = static:5000 # vmail
      maildrop_destination_recipient_limit = 1
      virtual_transport = maildrop

      /etc/postfix/ldap-virtual-domain.cf
      search_base = o=hosted,dc=home,dc=sbyrne,dc=net
      query_filter = dc=%s
      result_attribute = dc
      result_format = %s

      /etc/postfix/ldap-virtual-mailbox.cf
      search_base = dc=%d,o=hosted,dc=home,dc=sbyrne,dc=net
      query_filter = uid=%u
      result_attribute = mail
      result_format = %d/%u/Maildir/

      --
      Stephen Byrne
      stephen@...
    • Viktor Dukhovni
      ... http://wiki.dovecot.org/LDA/Sieve -- Viktor.
      Message 2 of 2 , Apr 27, 2013
      • 0 Attachment
        On Sat, Apr 27, 2013 at 10:28:27AM -0400, Stephen Byrne wrote:

        > I would like to have the LDA do filtering at delivery time. I would
        > love to be able to have per-virtual-user filtering config in
        > /var/mail/vhosts/${domain}/${user}, but would settle for a single
        > system-wide filtering configuration.

        http://wiki.dovecot.org/LDA/Sieve

        --
        Viktor.
      Your message has been successfully submitted and would be delivered to recipients shortly.