#267 new
Leigh Stoller

IMAP server directory

Reported by Leigh Stoller | July 18th, 2012 @ 01:19 AM

Hi. Most IMAP clients allow you to specify the (sub)directory
on the server. Our server config requires this, but I do not
see a setting for it.

Is there a way to set this?

Thanks!

Comments and changes to this ticket

  • benny

    benny July 18th, 2012 @ 05:18 AM

    The short answer is no. The most common use of the prefix is to be able to avoid that all mailboxes are inside INBOX, but this is handled automatically by MailMate (and can be explicitly controlled in the “Edit Subscriptions” interface).

    The long answer is yes. The current beta of MailMate (see the Software Update preferences pane) has a hidden setting which provides more flexibility (no GUI though). The following is from the manual:


    Some users may need to specify an IMAP namespace prefix explicitly. A known example is UW IMAP servers which return a set of namespaces similar to the following:

    NAMESPACE (("" "/")("#mhinbox" NIL)("#mh/" "/")) (("~" "/")) (("#shared/" "/")("#ftp/" "/")("#news." ".")("#public/" "/"))
    

    If MailMate uses the above as is then it is likely that all files in the home catalog of the user are fetched as IMAP mailboxes. This is a server configuration problem and it is obviously a serious security issue. Nevertheless, if you need to override the NAMESPACE response from the server then you can add the following line to the Sources.plist file in ~/Library/Application Support/MailMate:

    namespaceResponse = '(("MailboxPrefix" "/")) NIL NIL';
    

    You must replace MailboxPrefix with the name of the folder with your IMAP mailboxes.


    Perhaps I should elaborate on the security problem. If the server provides access to non-IMAP folders then it may be possible to use an email client (or a specialized application for IMAP access) to retrieve other files in your home directory on the server. In other words, if your IMAP account is compromised then your entire home directory may be compromised as well. The fix is to properly configure the IMAP server.

    Your problem may be different though. You are welcome to provide details -- in particular if the above is not a solution for you.

  • Leigh Stoller

    Leigh Stoller July 18th, 2012 @ 02:06 PM

    Thanks. Our server uses Dovecot, and it has the same problem as the UW server.
    I set the namespace to:

    namespaceResponse = "((\"IMAP\" \"/\")) NIL NIL";
    

    and it correctly gets set set of mailboxes from that folder, but then
    I get the following popup. It keeps popping it up over and over. Never
    seen this before from any other mail client. See attached screenshot.

  • benny

    benny July 18th, 2012 @ 02:42 PM

    • State changed from “new” to “resolved”

    The error is only implicitly related to MailMate. The server has some number of maximum connections allowed for a user and you reach this maximum for two reasons:

    1. You are probably running more than one email client and maybe you are also using multiple devices (with email clients) for the same account.

    2. MailMate uses 3 connections to the server by default.

    The error reported is not standardized, so there is no safe way for MailMate to detect the problem and decrease the number of connections (and maybe 1 is still too many).

    The reason that MailMate reports the error and not the other email clients is that MailMate is probably the last application to be launched.

    It is possible to manually decrease the number of connections used by MailMate, but the best fix would be to increase the number of allowed connections. I think too many servers are too conservative in this regard.

    Nevertheless, if you quit MailMate and edit the following file ~/Library/Application Support/MailMate/Sources.plist then you can add the following key/value pair to change the behavior of MailMate:

    maxNumberOfConnections = 1;
    

    I need a better solution to this problem. I could make a heuristic detecting responses from Dovecot, UW IMAP, Gmail, etc., but that would just be a hack. I could also make a GUI for the above, but that still requires that the user understands what the problem is. Finally, I could decrease the default to 1 to make it less likely to fail, but that would hurt performance/responsiveness in certain scenarios.

  • Leigh Stoller

    Leigh Stoller July 18th, 2012 @ 03:00 PM

    You are probably running more than one email client and maybe you are also using multiple devices (with email clients) for the same account.

    Yep, that is the problem. I increased the number on our server and now thing are
    running okay.

    However, there is still a problem. When I go to edit the subscription list, the prefix
    appears to be ignored, and I get a listing of my entire home directory, which is huge!

    I know that our server setup is wrong on this, but we have some users who rely on it.

  • benny

    benny July 18th, 2012 @ 03:31 PM

    • State changed from “resolved” to “accepted”

    Correct. The subscriptions editor does not respect the namespaceResponse setting. I tried to fix this (I cannot test it) and I've built a test release (r2970). Hold down ⇧ when clicking “Check Now” in the Software Update preferences pane. (Anyone else reading this should be aware that test releases can some times be very buggy -- handle with care.)

    Let me know whether or not it works for you.

  • benny

    benny July 18th, 2012 @ 03:40 PM

    Sorry, I should have written ⌥ instead of ⇧.

  • Leigh Stoller

    Leigh Stoller July 18th, 2012 @ 03:43 PM

    Yep, I figured that out ... but no change in behaviour.

  • benny

    benny July 18th, 2012 @ 03:52 PM

    Ok, it was a apparently a quick non-fix. I don't have time to investigate it further right now, but I'll update this ticket when I've had time to look into it.

  • benny

    benny July 19th, 2012 @ 09:48 AM

    • State changed from “accepted” to “fixcommitted”

    A new test release is available. I verified it worked using a “[Gmail]” prefix for a Google account. Sorry about the bogus fix.

    I know you have users relying on the default namespace response, but maybe these users do not know that their entire home directory is viewable via IMAP... I'm no expert on the subject, but maybe this note from the Dovecot site is useful.

  • benny

    benny November 9th, 2012 @ 12:16 PM

    • State changed from “fixcommitted” to “fixreleased”
  • Ben Hood

    Ben Hood July 31st, 2013 @ 02:15 PM

    I'm sorry but I don't get how to set this. We're using cyrus and we have a whole bunch of shared folders on the server side. The private folders are subfolders under INBOX. The shared folders come under a prefix called shared/projects. MailMate seems to handle the subfolders of INBOX as expected, but if I set the following in the Sources.plist:

    namespaceResponse = '(("shared/projects" "/")) NIL NIL';
    

    I lose everything other than what is directly in the INBOX.

    In addition, restarting MailMate and getting it to re-read this setting seems to cost an awful lot of system resources.

    What am I doing wrong here?

  • Ben Hood

    Ben Hood July 31st, 2013 @ 02:20 PM

    Googling a bit further, I note the the following setting might look like what I need:

    defaults write com.freron.MailMate MmNonPrivateNamespacesEnabled -bool YES
    

    This appears to include the shared/projects project in the MM sidebar, but unfortunately it causes MM to beach ball, so I'm sure that this is the solution.

  • benny

    benny August 1st, 2013 @ 01:03 PM

    (Sorry about the late response.)

    I assume you found the manual page. I do ask for feedback, so thanks for writing here.

    The multiple changes to the namespace settings trigger MailMate to fetch mailboxes and then delete mailboxes from its local cache. I guess the beach ball is related to this work (although ideally it should not happen). If it doesn't stop then it might be better to start over by quitting MailMate and then delete these folders:

    ~/Library/Application Support/MailMate/Messages
    ~/Library/Application Support/MailMate/Database.noindex
    ~/Library/Application Support/MailMate/Attachments
    

    Then launch MailMate and it should have a clean start at fetching the messages.

    How many messages are in these shared IMAP folders? MailMate does not perform well if you add more than a few 100K messages (MailMate is fully offline and fetches and indexes everything). If this is a problem then the only option is to use “Edit Subscriptions” in the IMAP account preferences to only subscribe to the shared mailboxes you primarily need.

    Again, thanks for the feedback.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Mac OS X email client.

Shared Ticket Bins

People watching this ticket

Attachments

Pages