- if (file) {
- /*
- ** Dist a file
- */
- anot = 0; /* don't want to annotate a file */
- } else {
- /*
- ** Dist a message
- */
- if (!msg)
- msg = seq_cur;
- if (!folder)
- folder = getcurfol();
- maildir = toabsdir(folder);
-
- if (chdir(maildir) == NOTOK)
- adios(maildir, "unable to change directory to");
-
- /* read folder and create message structure */
- if (!(mp = folder_read(folder)))
- adios(NULL, "unable to read folder %s", folder);
-
- /* check for empty folder */
- if (mp->nummsg == 0)
- adios(NULL, "no messages in %s", folder);
-
- /* parse the message range/sequence/name and set SELECTED */
- if (!m_convert(mp, msg))
- done(1);
- seq_setprev(mp); /* set the previous-sequence */
-
- if (mp->numsel > 1)
- adios(NULL, "only one message at a time!");
+ /* parse the message range/sequence/name and set SELECTED */
+ if (!m_convert(mp, msg)) {
+ exit(EX_USAGE);