Subject: Mail_Open in IMAP_2000

From: J T Breitner <[email-masked]>
Date: Sun, 26 Nov 2000 11:35:01 EST

If imap-2000 attempts to open a mailbox with no messages and no
"prefixing" mail message in the box (otherwise a zero-byte file), mail_open
appears to return null.

I understand why, but is there any way to require it to insert the prefixing
message into the mailbox? The issue has become if they delete all their mail and do
not have this prefixing message, c-client returns null.  That's ok, except that
sometimes the null is a good thing, like when the user fadinks with their permissions.

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Sun, 26 Nov 2000 10:56:06 -0800 (PST)

> "prefixing" mail message in the box (otherwise a zero-byte file), mail_open

What do you mean by "return null"?

c-client should return an open mailstream with zero messages.  If it does not,
are you running a modified version of c-client?  Have you deleted any drivers?

---

From: Jacob Morzinski <[email-masked]>
Date: Tue, 28 Nov 2000 03:16:33 -0500 (EST)

On Sun, 26 Nov 2000, J T Breitner wrote:
> message into the mailbox?

I'm not sure what you mean by "appears to return null."
Nevertheless, when I was playing with imap-4.7, I was hitting a
similar problem -- attempting to open an empty file would succeed,
but would use the "dummy" driver instead of the "unix" driver,
which caused problems for me later down the line.

I worked around my problem by setting "quell-folder-internal-msg"
just before opening the empty file, and unsetting it immediately
after.  The result is that empty files are opened with the unix
driver, and a prefix message is eventually inserted into the mailbox.

The core code went something like:

    quell = mail_parameters(NULL, GET_USERHASNOLIFE, NULL);
    if (quell)
      mail_parameters(NULL, SET_USERHASNOLIFE, NULL);
    context_create(cntxt, NULL, ps_global->VAR_INBOX_PATH);
    if (quell)
      mail_parameters(NULL, SET_USERHASNOLIFE, quell);

---

From: Mark Crispin <[email-masked]>
Date: Tue, 28 Nov 2000 01:29:32 -0800 (PST)

On Tue, 28 Nov 2000 03:16:33 -0500 (EST), Jacob Morzinski wrote:
> attempting to open an empty file would succeed,

What problems?  The dummy driver simply means that the file is zero bytes, and
it doesn't know what format it is.  As soon as the file becomes non-zero
bytes, it will automatically switch to the correct format.

> driver, and a prefix message is eventually inserted into the mailbox.

This makes no sense.

>       mail_parameters(NULL, SET_USERHASNOLIFE, quell);

What this code does is *disable* the "quell-folder-internal-msg" around the
create -- which you never should have enabled to begin with and is disabled by
default.

It sounds to me like you were playing around with something that you didn't
fully understand.