Subject: creating mbx

From: Ben H Kram <[email-masked]>
Date: Fri, 28 Jul 2000 08:17:02 -0400

I'm using the perl interface to c-client, not sure if this is the best place to as this question, so I'll apologise if this is inappropriate.

I've build c-client.a with mbx as the default creation mailbox type.
I set CREATEPROTO=mbx in the Makefile.

I haven't figured out how to create a new object without an existing mailbox, so for now I do:
	$c = Mail::Cclient->new($exists) or print LOG "new: $!\n";
$exists is a regular old mbox, (I don't have any mbx's hanging around.)
That works fine.

Then I do:
    $c->create($mb) or print LOG "create[$mb]: $!\n";
$mb is a file that doesn't exist, and is in the same dir as $exists.  
I would like this to exist so I can append() a message to it.

I get:
	create[/path/to/spool/test2]: Bad file descriptor

Thanks for any wisdom in advance.

Ben

-- 
"Aha," it thought.
"So /that's/ how it is!"

So it stopped rolling...
	-The Missing Piece, Shel Silverstein
-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Jauder Ho <[email-masked]>
Date: Fri, 28 Jul 2000 10:31:41 -0700 (PDT)

Here's a script I wrote to create an empty mbx file.

#!/usr/bin/perl
#
# creatmbx
#
# The perl way to creating a mbx format mailbox.
#
# Double check output by using od on file.

# Vars grokked from reading source files.
my $NUSERFLAGS = "30";
my $HDRSIZE    = "2048";
my $string;

# Check args
die "ERROR: creatmbx <file>\n" unless ($#ARGV == 0);

# Ported from imap/src/osdep/unix/mbx.c
open(FILE,"> $ARGV[0]");
$string = sprintf ("*mbx*\015\012%08lx00000000\015\012", time);

for ($i = 0; $i < $NUSERFLAGS; ++$i) {
        $string .= sprintf "\015\012";
}

# Pad the rest of the file with nulls as expected
$string = unpack("a${HDRSIZE}", pack("a${HDRSIZE}","$string"));

print FILE $string;
close(FILE);

# The End.

---

From: Ricardo Stella <[email-masked]>
Date: Fri, 28 Jul 2000 13:37:05 -0400

Now that I think about it... Don't you need EMPTYPROTO=mbx ???

-- 
------------------------------------------------------------------
 Ricardo Stella                                  O.I.T.
 (609)896-5000 x7436           _suAve_           Rider University
  *** Remove 'no-spam' from e-mail address before replying.  ***

---

From: b <[email-masked]>
Date: Fri, 28 Jul 2000 13:42:42 -0400

> Now that I think about it... Don't you need EMPTYPROTO=mbx ???

Thanks for the script...

In c-client/Makefile it says..

# ...since they do not exist in the default namespace.  Also, it is meaningless to
# set certain other formats (e.g. mbx and mx) as the EMPTYPROTO since these
# formats can never be empty files.

So I'm not sure I can...

cheers,
ben

---

From: Jauder Ho <[email-masked]>
Date: Fri, 28 Jul 2000 10:53:03 -0700 (PDT)

Don't remember. Look at my patches, http://www.carumba.com/talk/imap/ I
need to get around to updating them at some point but they should provide
at least a good starting point.

--Jauder

---

From: Ricardo Stella <[email-masked]>
Date: Fri, 28 Jul 2000 14:09:59 -0400

Thanks...

If found the 'hide the .' patch.

It looks like Mark added code for this already in the 2K version, but
it's nowhere documented.  Apparently you can set HIDEDOTFILES
somewhere...

Same case for moving the imap folder from $HOME to whatever (though that
is documented but does not seem to work under Solaris 2.6 - I posted
that before).

R.