Hi Erik -
The simple answer is that mx was an experiment, made concurrently with mbx
in 1996, which failed. The reasons for its failure include its dependency
upon stat() to obtain message metadata (specifically, INTERNALDATE and
RFC822.SIZE) and its highly unsatisfactory shared access handling.
There has been little work on mx in the subsequent decade since that time
other than the minimal updates required for all drivers. However, the
lessons learned by this experiment strongly contributed to the successful
mix design.
There are no plans to delete the mx code. However, should events lead
unfavorably, I will not go to heroic efforts to preserve it either.
I guess that it is alright for the purpose that you intend to use it, but
I recommend that instead you hack a version of mixcvt to do this. It
should be pretty obvious what you need to do: remove the code in main()
starting with:
else if (!(meta = fopen (strcat (strcpy (tmp,strcat (dest,"/" MIXNAME)),
MIXMETA),"w")))
fprintf (stderr,"Unable to create metadata %.800s: %.80s\n",
tmp,strerror (errno));
along with the write_message() function, and replace it with something
like (adding the obvious variables):
for (i = 1; i <= stream->nmsgs; ++i) {
sprintf (tmp,"%s/%lu.eml",dest,mail_uid (source,i));
if (!(file = fopen (tmp,"wb")) {
fprintf (stderr,"Unable to open %s: %s",tmp,strerror (errno));
return 1;
}
s = mail_fetch_header (source,i,NIL,NIL,&len,FT_PEEK);
if (fwrite (s,1,len,file) != len) {
fprintf (stderr,"Unable to write header %s: %s",tmp,strerror (errno));
return 1;
}
s = mail_fetch_text (source,i,NIL,NIL,&len,FT_PEEK);
if (fwrite (s,1,len,file) != len) {
fprintf (stderr,"Unable to write body %s: %s",tmp,strerror (errno));
return 1;
}
if (fclose (file)) {
fprintf (stderr,"Unable to close %s: %s",tmp,strerror (errno));
return 1;
}
}
retcode = 0;
To answer your other question, the mx driver does not permit any leaf of
the mailbox name to be all numeric. Thus, a name like /foo/bar/123zap/fud
is valid, but /foo/bar/123/fud is not.
Also, you should eschew using "root" (or any other UID 0 userid) with any
c-client based application. UID 0 is used as an internal flag in c-client
to mean "not logged in" and thus no environment is set up. Many of the
environment routines return constant default strings when root, with the
sole purpose of avoiding a crash if they are called anyone.
-- Mark --
http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.
_______________________________________________
Imap-uw mailing list
Imap-uw@u.washington.edu
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw