.HP 5
.na
.B send
-.RB [ \-verbose " | " \-noverbose ]
+.RI [ +folder ]
.RI [ msgs ]
+.RB [ \-verbose " | " \-noverbose ]
.RB [ \-Version ]
.RB [ \-help ]
.ad
.PP
.B Send
with no
+.I +folder
+and
.I msgs
-argument will send the current message in the draft folder.
+arguments will send the current message in the draft folder.
.B Send
-always takes messages from the draft folder.
-(But, a
+sends messages from the draft folder, unless
.I +folder
-argument might be added in the future.)
+is given.
Consult the
.BR mh-draft (7)
man page for more information.
.SH DEFAULTS
.nf
-.RB ` msgs "' defaults to the current message in the draft folder"
+.RB ` msgs "' defaults to the current message"
+.RB ` +folder "' defaults to the draft folder"
.RB ` \-noverbose '
.fi
int msgnum, status;
int in, out;
int n;
- char *cp, *maildir = NULL;
+ char *cp, *maildir = NULL, *folder = NULL;
char buf[BUFSIZ], **argp, **arguments;
char *msgs[MAXARGS], *vec[MAXARGS];
char *files[MAXARGS];
vec[vecp++] = --cp;
continue;
}
+ } else if (*cp == '+' || *cp == '@') {
+ if (folder) {
+ adios(EX_USAGE, NULL, "only one folder at a time!");
+ } else {
+ folder = mh_xstrdup(expandfol(cp));
+ }
} else {
if (*cp == '/') {
files[nfiles++] = cp;
}
if (nmsgs) {
- maildir = toabsdir(draftfolder);
+ folder = folder ? folder : draftfolder;
+ maildir = toabsdir(folder);
if (chdir(maildir) == NOTOK) {
adios(EX_OSERR, maildir, "unable to change directory to");
}
- if (!(mp = folder_read(draftfolder))) {
- adios(EX_IOERR, NULL, "unable to read draft folder %s",
- draftfolder);
+ if (!(mp = folder_read(folder))) {
+ adios(EX_IOERR, NULL, "unable to read folder %s",
+ folder);
}
if (mp->nummsg == 0) {
- adios(EX_DATAERR, NULL, "no messages in draft folder %s",
- draftfolder);
+ adios(EX_DATAERR, NULL, "no messages in folder %s",
+ folder);
}
/* parse all the msgranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < nmsgs; msgnum++) {