Subject: imapd

From: David Morsberger <[email-masked]>
Date: Tue, 03 Dec 2002 19:31:59 -0500

I have been having a problem upgrading to imap2002. How do I solve this
problem?

Problem: I am unable to store mail in the inbox. All other email folders
work ok. Below is an entry in the procmail log file.

delivered to /var/spool/mail/dmorsberger
>From [email-masked] Mon Dec  2 22:21:25 2002 -0500
Subject: Re: Other:    (KMM2204908V61061L0KM)
 Folder: /usr/local/bin/dmail +inbox
2046

Our configuration:

all mail is to be stored in the $HOME/mail directory. There is an inbox file
and a file for each imap folder.

We are using procmail to process mail from sendmail

We are using dmail to place mail in the appropriate folder because our
default format is mbx.

I made the following change based on the FAQ to the env_unix.c file
 static char *mailsubdir = "mail";       /* mail subdirectory name */

I followed dmail through gdb and I think it would work if the following code
(env_cc:1581) did not set *dst to null:
     if (anonymous || blackBox || closedBox)
       sprintf (dst,"%s/INBOX",mymailboxdir ());
     else *dst = '\0';         /* otherwise driver selects the name */

What is a blackBox or closedBox? Should I be setting one of those variables
to T?

Does case matther? Should the physical file be named INBOX or inbox?

Thanks,
Dave

---

From: Mark Crispin <[email-masked]>
Date: Tue, 3 Dec 2002 16:41:51 -0800 (Pacific Standard Time)

No, you should not be setting blackBox or closedBox (unless you know
*precisely* what you are doing); and yes, it is correct that *dst is set
to null and you should not be changing that.

The key is the "delivered to /var/spool/mail/dmorsberger" message; this is
indicating that it is delivering mail in the traditional UNIX mailbox
format.

Does a file named "INBOX" (all uppercase) exist in the home directory?

Did you set CREATEPROTO to mbxproto in the Makefile?

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.

---

From: David Morsberger <[email-masked]>
Date: Tue, 03 Dec 2002 20:13:33 -0500

Mark,

I set the following in the Makefile:

CREATEPROTO=mbxproto
EMPTYPROTO=unixproto

I have tried it with both inbox and INBOX.

Here is the debug output after I created ~/mail/INBOX:

Note: The debug messages state /home/dmorsberger/mail/INBOX but the data is
in /var/spool/mail/dmorsberger

Uppercase INBOX
bash-2.05$ ./dmail -D +INBOX
Test
Test
delivering to dmorsberger+INBOX
Verifying safe delivery to /home/dmorsberger/mail/INBOX
dummy appending to #driver.dummy/INBOX (file /home/dmorsberger/mail/INBOX)
delivered to /home/dmorsberger/mail/INBOX
Verifying safe delivery to /home/dmorsberger/mail/INBOX
You have mail in /var/spool/mail/dmorsberger
bash-2.05$ ls -l /home/dmorsberger/mail/INBOX
-rw-------    1 dmorsber sdlgrp          0 Dec  3 20:03
/home/dmorsberger/mail/INBOX
bash-2.05$ ls -l /var/spool/mail/dmorsberger
-rw-rw---T    1 dmorsber mail          190 Dec  3 20:07
/var/spool/mail/dmorsberger
bash-2.05$ cat /var/spool/mail/dmorsberger
>From [email-masked] Tue Dec  3 20:07:46 2002 -0500
Status: 
(EST)
Test
Test

Second run
bash-2.05$ ./dmail -D +INBOX
Test2
Test
Test2
delivering to dmorsberger+INBOX
Verifying safe delivery to /var/spool/mail/dmorsberger
unix appending to INBOX (file /var/spool/mail/dmorsberger)
delivered to /var/spool/mail/dmorsberger
Verifying safe delivery to /var/spool/mail/dmorsberger

> From: Mark Crispin <[email-masked]>
> Organization: Networks & Distributed Computing
> Date: Tue, 03 Dec 2002 16:41:51 -0800 (Pacific Standard Time)
> To: David Morsberger <[email-masked]>
> Cc: [email-masked]
> Subject: Re: imapd
>

---

From: Mark Crispin <[email-masked]>
Date: Tue, 3 Dec 2002 17:17:42 -0800 (Pacific Standard Time)

On Tue, 3 Dec 2002, David Morsberger wrote:
> -rw-------    1 dmorsber sdlgrp          0 Dec  3 20:03 /home/dmorsberger/mail/INBOX

There's your problem.

An mbx-format INBOX is a 2048 byte file in a specific format.  It is not a
zero-byte file.

-- Mark --

---

From: David Morsberger <[email-masked]>
Date: Tue, 03 Dec 2002 20:27:53 -0500

Mark,

Have these changed?

1) the case sensitivity of inbox.
2) An empty file is treated as a traditional (mbox or unix?) mailbox.

> Date: Tue, 03 Dec 2002 17:17:42 -0800 (Pacific Standard Time)

---

From: Mark Crispin <[email-masked]>
Date: Tue, 3 Dec 2002 17:42:01 -0800 (Pacific Standard Time)

> 1) the case sensitivity of inbox.

Always case sensitive.

> 2) An empty file is treated as a traditional (mbox or unix?) mailbox.

Always.  mbx files are never empty.

-- Mark --

---

From: David Morsberger <[email-masked]>
Date: Tue, 03 Dec 2002 21:08:04 -0500

Mark,

Why does imap2001a work with inbox vs. INBOX and treat empty files as mbox
files?

> Date: Tue, 03 Dec 2002 17:42:01 -0800 (Pacific Standard Time)

---

From: Mark Crispin <[email-masked]>
Date: Tue, 3 Dec 2002 18:11:32 -0800 (Pacific Standard Time)

> Why does imap2001a work with inbox vs. INBOX and treat empty files as mbox

imap-2001a has never accepted a file called "inbox".

An empty file has never been an mbx file.  It could be an mbox file, but
only if it is called "mbox".

Could you have been running a hacked version?  If so, I don't know
anything about it.

-- Mark --

---

From: David Morsberger <[email-masked]>
Date: Tue, 03 Dec 2002 21:24:10 -0500

Mark,

I do not think it is a hacked version. The only change was mailsubdir.

Is it possible that inbox was treated as a regular / non-special mail
folder?

I understand that a mbx file will never be empty. I thought the type is
automatically determined and an empty file will be treated as a unix type.

The goal is to have INBOX be a unix file type and all others a mbx type.
Most users use pop and a local mail tool to access the INBOX. The imap users
who use separate imap folders can transparently take advantage of the mbx
file type. I personally do not use INBOX because I want to use the
concurrent features of the mbox file type. The last line in my .procmailrc
file is:
| dmail +Input

Thanks,
Dave

> Date: Tue, 03 Dec 2002 18:11:32 -0800 (Pacific Standard Time)

---

From: Mark Crispin <[email-masked]>
Date: Tue, 3 Dec 2002 18:28:19 -0800 (Pacific Standard Time)

> The goal is to have INBOX be a unix file type and all others a mbx type.

The name INBOX in the home directory is reserved to the mbx format.

A traditional unix format inbox is either the spool directory file or file
"mbox" in the home directory.

-- Mark --

---

From: David Morsberger <[email-masked]>
Date: Tue, 03 Dec 2002 21:41:30 -0500

Mark,

Thanks for your time!

That cleared it up.

If I need a unix file type for INBOX then should I rebuild with
CREATEPROTO=unixproto and use the imap client and tools to create mbx
mailboxes?

> Date: Tue, 03 Dec 2002 18:28:19 -0800 (Pacific Standard Time)

---

From: Mark Crispin <[email-masked]>
Date: Tue, 3 Dec 2002 18:44:09 -0800 (Pacific Standard Time)

> CREATEPROTO=unixproto and use the imap client and tools to create mbx

CREATEPROTO decides what to do for new files.

If you don't have one of the special file names (~/INBOX for mbx, ~/mbox
for traditional UNIX, ~/mail.txt for tenex) for a home-directory based
INBOX, then INBOX is always the spool directory file in traditional UNIX
format.

-- Mark --