Mail.app namespaces

Dan Mahoney (Gushi) danm at prime.gushi.org
Sun Feb 14 10:21:40 EET 2021


On Sat, 13 Feb 2021, Dan Mahoney (Gushi) wrote:

To answer my own question here, I added the following namespace:

namespace {
   separator = /
   prefix = partial/
   location = mbox:~%u/.partial-mail/
   list = yes
   hidden = no
}

And then, in my home directory, created a ~/.partial-mail folder, that I 
could add symlinks to for mailboxes I actually care about (really, just 
inbox, but I like having options).

The final bit of the puzzle, to suppress mail.app's stupidity, was to go 
into my "Advanced IMAP Configuration" (which every other MUA would call 
"IMAP Configuration") :)

And set "IMAP Path Prefix" to "partial" (note the no trailing /)

Dovecot happily follows symlinks and this lets me offer it to any other 
user who needs this, without my having to create any extra databases under 
the hood.

And because I've overridden my main prefix, I don't get my usual default 
folders (i.e. everything in ~/mail that any normal user would get)

This is better than a per-user override (and I think per-MUA override 
never would have worked), since this is an accessable knob in the config.

Despite the fact that I have hidden set to "no", any user who doesn't have 
this magic folder will simply not see it.  (That said, I'll try setting it 
to "yes" to see if it behaves.)

Now let's just hope icloud keychain doesn't helpfully set this same 
variable on other systems, like my ios devices.

I should *probably* for the sake of completeness, symlink in the "Special" 
folders.  (Drafts, etc)

Best,

-Dan


> All,
>
> Dovecot 2.3.13 under Freebsd 11.3, installed via pkg.
>
> I had a question related to dovecot and OSX mail.app.
>
> My primary mailer is "alpine".  Sometimes I need to see a message in a 
> graphical app so I occasionally turn to mail.app.
>
> I keep a lot of old mail.  Mail.app on recent macos versions insist on 
> downloading *everything* for easier searching and indexing.  Most of which I 
> don't need.  (20G of mail over the last 20+ years, plus a bunch of mailing 
> lists I keep archived, but only read when I need to search them).
>
> ios mail doesn't do this.  Subscriptions don't work (in mail.app, 
> subscriptions are only for public/shared folders).
>
> Ergo, is there a server-side way to make just one client not able to 
> see/list/download ALL folders?  Perhaps by presenting them as subscription 
> folders, or perhaps by hiding them in the namespace.
>
> I'm not unwilling to configure an alternate namespace for myself.  (It's 
> helps that I'm the sysadmin here).
>
> Ideally, this would be a thing I could only set for my account -- match on a 
> user-agent/username string of some sort?
>
> (My other option has been "create a different username and forward to myself 
> there", but this feels like it should be solvable).
>
> -Dan
>
> My doveconf follows:
>
> # 2.3.13 (89f716dc2): /usr/local/etc/dovecot/dovecot.conf
> # OS: FreeBSD 11.4-RELEASE-p3 amd64 # Hostname: prime.gushi.org
> disable_plaintext_auth = no
> mail_full_filesystem_access = yes
> mail_location = mbox:%h/mail:INBOX=%h/.mail:INDEX=/var/db/indexes/%u
> namespace {
>  alias_for =
>  hidden = yes
>  list = no
>  location =
>  prefix = mail/
>  separator = /
> }
> namespace {
>  alias_for =
>  hidden = no
>  list = yes
>  location =
>  prefix = ~/mail/
>  separator = /
>  subscriptions = yes
> }
> namespace {
>  alias_for =
>  hidden = yes
>  list = no
>  location =
>  prefix = ~%u/mail/
>  separator = /
> }
> namespace {
>  hidden = no
>  list = yes
>  location = mbox:~%u/.incoming/
>  prefix = Inbounds/
>  separator = /
> }
> namespace inbox {
>  inbox = yes
>  location =
>  prefix =
>  separator = /
> }
> passdb {
>  driver = pam
> }
> plugin {
>  mail_log_events = delete undelete expunge copy mailbox_delete 
> mailbox_rename
>  mail_log_fields = uid box msgid size
> }
> service imap-login {
>  inet_listener imap {
>    port = 143
>  }
>  inet_listener imap_other {
>    port = 1143
>  }
>  inet_listener imaps {
>    port = 993
>    ssl = yes
>  }
>  inet_listener imaps_other {
>    port = 1993
>    ssl = yes
>  }
> }
> service pop3-login {
>  inet_listener pop3 {
>    port = 110
>  }
>  inet_listener pop3_other {
>    port = 1110
>  }
>  inet_listener pop3s {
>    port = 995
>    ssl = yes
>  }
>  inet_listener pop3s_other {
>    port = 1995
>    ssl = yes
>  }
> }
> ssl_cert = </etc/mail/certs/prime.gushi.org.certkey
> ssl_dh = # hidden, use -P to show it
> ssl_key = # hidden, use -P to show it
> userdb {
>  driver = passwd
> }
>
>

-- 

"I love you forever eternally."

-Connaian Expression

--------Dan Mahoney--------
Techie,  Sysadmin,  WebGeek
Gushi on efnet/undernet IRC
FB:  fb.com/DanielMahoneyIV
LI:   linkedin.com/in/gushi
Site:  http://www.gushi.org
---------------------------



More information about the dovecot mailing list