plan9port

[fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port # fast
git clone https://src.adamsgaard.dk/plan9port.git # slow
Log | Files | Refs | README | LICENSE Back to index

commit 44fc56d8c3cc534bf903133c63a9c9ecb42e5b63
parent 25c823399b92efee49d15f0e78303f70b278dd99
Author: rsc <devnull@localhost>
Date:   Sun, 21 May 2006 18:41:05 +0000

multiple mail boxes (Lou Kamenov)

Diffstat:
Msrc/cmd/acme/mail/dat.h | 1+
Msrc/cmd/acme/mail/mail.c | 10+++++++---
Msrc/cmd/acme/mail/mesg.c | 4++--
3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/cmd/acme/mail/dat.h b/src/cmd/acme/mail/dat.h @@ -170,6 +170,7 @@ extern char *outgoing; extern char *mailboxdir; extern char *mboxname; extern char *user; +extern char *srvname; extern char deleted[]; extern int wctlfd; extern int shortmenu; diff --git a/src/cmd/acme/mail/mail.c b/src/cmd/acme/mail/mail.c @@ -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"); } @@ -88,6 +88,7 @@ threadmain(int argc, char *argv[]) plumbshowmailfd = plumbopenfid("showmail", OREAD|OCEXEC); shortmenu = 0; + srvname = "mail"; ARGBEGIN{ case 's': shortmenu = 1; @@ -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 @@ -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"; diff --git a/src/cmd/acme/mail/mesg.c b/src/cmd/acme/mail/mesg.c @@ -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); } }