| Date: Sun, 21 May 2006 18:41:05 +0000
multiple mail boxes (Lou Kamenov)
Diffstat:
M src/cmd/acme/mail/dat.h | 1 +
M src/cmd/acme/mail/mail.c | 10 +++++++---
M src/cmd/acme/mail/mesg.c | 4 ++--
3 files changed, 10 insertions(+), 5 deletions(-)
--- |
| t@@ -42,7 +42,7 @@ CFsys *acmefs;
void
usage(void)
{
- fprint(2, "usage: Mail [-sS] [-o outgoing] [mailboxname [directoryname]]\n");
+ fprint(2, "usage: Mail [-sS] [-n srvname] [-o outgoing] [mailboxname [directoryname]]\n");
threadexitsall("usage");
}
t@@ -88,6 +88,7 @@ threadmain(int argc, char *argv[])
plumbshowmailfd = plumbopenfid("showmail", OREAD|OCEXEC);
shortmenu = 0;
+ srvname = "mail";
ARGBEGIN{
case 's':
shortmenu = 1;
t@@ -101,6 +102,9 @@ threadmain(int argc, char *argv[])
case 'm':
smprint(maildir, "%s/", EARGF(usage()));
break;
+ case 'n':
+ srvname = EARGF(usage());
+ break;
default:
usage();
}ARGEND
t@@ -108,9 +112,9 @@ threadmain(int argc, char *argv[])
acmefs = nsmount("acme",nil);
if(acmefs == nil)
error("cannot mount acme: %r");
- mailfs = nsmount("mail", nil);
+ mailfs = nsmount(srvname, nil);
if(mailfs == nil)
- error("cannot mount mail: %r");
+ error("cannot mount %s: %r", srvname);
name = "mbox";
|
| t@@ -1046,8 +1046,8 @@ mimedisplay(Message *m, char *name, char *rootdir, Window *w, int fileonly)
dest = estrdup(m->filename);
if(m->filename[0] != '/')
dest = egrow(estrdup(home), "/", dest);
- fsprint(w->body, "\t9p read mail/%s/%sbody > %s\n",
- mboxname, name, dest);
+ fsprint(w->body, "\t9p read %s/%s/%sbody > %s\n",
+ srvname, mboxname, name, dest);
free(dest);
}
} |