Dovecot Shared Mailbox and Sent Items

Discussion in 'General' started by user848429, Jan 6, 2021.

  1. user848429

    user848429 New Member

    Hello,
    I have activated the shared mailbox function in dovecot which works well, but I have a problem with sent messages.
    When a user replies to a mail in the shared folder's inbox, the mail is copied to his personal Sent folder and not the Sent folder of the shared mailbox.
    Whether it's with Thunderbird or Roundcube, I don't see how to solve this problem.
     
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    "Sent" folders are client behavior, nothing the server controls. I don't use thunderbird; rouncube seems to only have a single setting for the sent folder.
     
    user848429 likes this.
  3. tafkaz

    tafkaz Member HowtoForge Supporter

    Hi,
    sorry for hijacking this thread, but maybe you can help me with my futile attempts to set acl and shared imap up, i just can't seem to get it to work.

    My current status is that I can share an IMAP folder with a user, but that user cannot see the folder and therefore cannot subscribe to it.
    in the IMAP tree of the receiving user only a folder "shared" appears instead of a folder "shared/[email protected]", so no subfolder at all.
    I think there is something wrong with the shared namespace and maybe also with the permissions?

    The setup is one with ISPConfig and doovecot 2.3.10.1, as separator we have a dot, so . not /

    Code:
    dovecot -n:
    > # 2.3.10.1 (a3d0e1171): /etc/dovecot/dovecot.conf
    > # Pigeonhole version 0.5.10 (67bf5bd7)
    > # OS: Linux 4.9.0-12-amd64 x86_64 Debian 9.12
    > # Hostname: ispmaster.foobar.com
    > auth_mechanisms = plain login
    > listen = *,[::]
    > log_timestamp = "%Y-%m-%d %H:%M:%S "
    > mail_attribute_dict = file:/var/vmail/%d/%n/.dovecot-attributes
    > mail_max_userip_connections = 100
    > mail_plugins = quota acl virtual notify push_notification webpush
    > mail_privileged_group = vmail
    > managesieve_notify_capability = mailto
    > managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext imapsieve vnd.dovecot.imapsieve
    > namespace {
    >   inbox = yes
    >   location =
    >   prefix =
    >   separator = .
    >   type = private
    > }
    > namespace {
    >   hidden = no
    >   ignore_on_failure = no
    >   inbox = no
    >   list = children
    >   location = maildir:%%h/Maildir:INDEX=%h/shared/%%u:CONTROL=%h/shared/%%u
    >   prefix = shared.%%u.
    >   separator = .
    >   subscriptions = yes
    >   type = shared
    > }
    > namespace Virtual {
    >   hidden = yes
    >   list = no
    >   location = virtual:/etc/dovecot/virtual:INDEX=/var/vmail/%d/%u/virtual
    >   prefix = Virtual.
    >   separator = .
    >   subscriptions = no
    > }
    > passdb {
    >   args = /etc/dovecot/dovecot-sql.conf
    >   driver = sql
    > }
    > plugin {
    >   acl = vfile
    >   acl_shared_dict = file:/var/lib/dovecot/db/shared-mailboxes
    >   coi_mailbox_root = DeltaChat
    >   imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve
    >   imapsieve_mailbox1_causes = COPY
    >   imapsieve_mailbox1_name = Junk
    >   imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve
    >   imapsieve_mailbox2_causes = COPY
    >   imapsieve_mailbox2_from = Junk
    >   imapsieve_mailbox2_name = *
    >   push_notification_driver = webpush:max_retries=0:rawlog_dir=/var/vmail/%d/%n/
    >   quota = dict:user::file:/var/vmail/%d/%n/.quotausage
    >   sieve = /var/vmail/%d/%n/.sieve
    >   sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
    >   sieve_max_redirects = 25
    >   sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
    >   sieve_plugins = sieve_imapsieve sieve_extprograms
    >   webpush_subscription_expire = 5 min
    >   webpush_subscription_limit = 10
    >   webpush_vapid_curve = prime256v1
    > }
    > protocols = imap pop3 sieve
    > service auth {
    >   unix_listener /var/spool/postfix/private/auth {
    >     group = postfix
    >     mode = 0660
    >     user = postfix
    >   }
    >   unix_listener auth-userdb {
    >     group = vmail
    >     mode = 0600
    >     user = vmail
    >   }
    >   user = root
    > }
    > service imap-login {
    >   client_limit = 1000
    >   process_limit = 512
    > }
    > service lmtp {
    >   unix_listener /var/spool/postfix/private/dovecot-lmtp {
    >     group = postfix
    >     mode = 0600
    >     user = postfix
    >   }
    > }
    > service managesieve-login {
    >   inet_listener sieve {
    >     port = 4190
    >   }
    > }
    > service stats {
    >   unix_listener stats-reader {
    >     group = vmail
    >     mode = 0660
    >     user = vmail
    >   }
    >   unix_listener stats-writer {
    >     group = vmail
    >     mode = 0660
    >     user = vmail
    >   }
    > }
    > ssl = required
    > ssl_ca = </etc/ssl/foobar.com/foobar.com.combined.crt
    > ssl_cert = </etc/ssl/foobar.com/foobar.com.combined.crt
    > ssl_dh = # hidden, use -P to show it
    > ssl_key = # hidden, use -P to show it
    > userdb {
    >   driver = prefetch
    > }
    > userdb {
    >   args = /etc/dovecot/dovecot-sql.conf
    >   driver = sql
    > }
    > protocol imap {
    >   imap_capability = +XDOVECOT WEBPUSH
    >   imap_metadata = yes
    >   mail_plugins = quota acl virtual notify push_notification webpush acl imap_acl imap_quota imap_sieve imap_coi
    > }
    > protocol pop3 {
    >   mail_plugins = quota acl virtual notify push_notification webpush
    >   pop3_uidl_format = %08Xu%08Xv
    > }
    > protocol lda {
    >   mail_plugins = quota acl virtual notify push_notification webpush sieve
    >   postmaster_address = [email protected]
    > }
    > protocol lmtp {
    >   mail_plugins = quota acl virtual notify push_notification webpush sieve lmtp_coi
    >   postmaster_address = [email protected]
    > } 
    The file /var/lib/dovecot/db/shared-mailboxes is created automatically and has the following contents when shared from [email protected] to [email protected]:

    Code:
    shared/shared-boxes/user/[email protected]/[email protected]
    
    1
    If you need anything else let me know,
    Would be great if you could help us.
    thanks a ton
    Sascha
     
  4. user848429

    user848429 New Member

    No problem, I forgot to thanks Jesse, I had finally figured out how to solve my problem with the help of signatures in thunderbird.
    For your problem tafkaz, I don't have many differences with your config. Yours is even more complete than mine (which may also include errors)
    What changes is my shared_dict name is shared-mailboxes.db and my shared namespace location is location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u
    For separators, I used /

    Code:
    protocol imap {
      mail_plugins = quota imap_quota acl imap_acl
    }
    Code:
    plugin {
      # Without global ACLs:
      acl = vfile
      acl_shared_dict = file:/var/lib/dovecot/db/shared-mailboxes.db
    }
    Code:
    namespace inbox {
      # Namespace type: private, shared or public
      type = private
    
      # Hierarchy separator to use. You should use the same separator for all
      # namespaces or some clients get confused. '/' is usually a good one.
      # The default however depends on the underlying mail storage format.
      separator = /
    
      # Prefix required to access this namespace. This needs to be different for
      # all namespaces. For example "Public/".
      #prefix =
    
      # Physical location of the mailbox. This is in same format as
      # mail_location, which is also the default for it.
      #location =
    
      # There can be only one INBOX, and this setting defines which namespace
      # has it.
      inbox = yes
    
      # If namespace is hidden, it's not advertised to clients via NAMESPACE
      # extension. You'll most likely also want to set list=no. This is mostly
      # useful when converting from another server with different namespaces which
      # you want to deprecate but still keep working. For example you can create
      # hidden namespaces with prefixes "~/mail/", "~%u/mail/" and "mail/".
      #hidden = no
    
      # Show the mailboxes under this namespace with LIST command. This makes the
      # namespace visible for clients that don't support NAMESPACE extension.
      # "children" value lists child mailboxes, but hides the namespace prefix.
      #list = yes
    
      # Namespace handles its own subscriptions. If set to "no", the parent
      # namespace handles them (empty prefix should always have this as "yes")
      #subscriptions = yes
    
      # See 15-mailboxes.conf for definitions of special mailboxes.
     
    }
    
    namespace {
      type = shared
      separator = /
    
      # Mailboxes are visible under "shared/[email protected]/"
      # %%n, %%d and %%u are expanded to the destination user.
      prefix = shared/%%u/
    
      # Mail location for other users' mailboxes. Note that %variables and ~/
      # expands to the logged in user's data. %%n, %%d, %%u and %%h expand to the
      # destination user's data.
      location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u
    
      # Use the default namespace for saving subscriptions.
      #subscriptions = no
    
      # List the shared/ namespace only if there are visible shared mailboxes.
      #list = children
     
    }
    I used Roundcube to set permissions on each mailbox folders in acl dictionnary
     

Share This Page