Removed mts.conf; the maildelivery option went into slocal directly.
[mmh] / uip / slocal.c
index 85bc52a..2573cbe 100644 (file)
@@ -102,6 +102,11 @@ static struct swit switches[] = {
        { NULL, 0 }
 };
 
+
+/* global maildelivery file */
+char *maildelivery = NMHETCDIR"/maildelivery";
+
+
 static int globbed = 0;  /* have we built "vars" table yet? */
 static int parsed = 0;  /* have we built header field table yet   */
 static int utmped = 0;  /* have we scanned umtp(x) file yet */
@@ -189,7 +194,7 @@ static void glob(int);
 static struct pair *lookup(struct pair *, char *);
 static int logged_in(void);
 static int timely(char *, char *);
-static int usr_file(int, char *, int);
+static int usr_file(int, char *);
 static int usr_pipe(int, char *, char *, char **, int);
 static int usr_folder(int, char *);
 static RETSIGTYPE alrmser(int);
@@ -220,7 +225,6 @@ main(int argc, char **argv)
        if (context_foil(NULL) == -1)
                done(1);
 
-       mts_init(invo_name);
        arguments = getarguments(invo_name, argc, argv, 0);
        argp = arguments;
 
@@ -405,8 +409,7 @@ main(int argc, char **argv)
 
        if (mbox == NULL) {
                snprintf(mailbox, sizeof(mailbox), "%s/%s",
-                               mmdfldir[0] ? mmdfldir : pw->pw_dir,
-                               mmdflfil[0] ? mmdflfil : pw->pw_name);
+                               mailspool, pw->pw_name);
                mbox = mailbox;
        }
        if (home == NULL)
@@ -457,11 +460,7 @@ localmail(int fd, char *mdlvr)
                verbose_printf("(delivering to standard mail spool)\n");
 
        /* last resort - deliver to standard mail spool */
-#ifdef SLOCAL_MBOX
-       return usr_file(fd, mbox, MBOX_FORMAT);
-#else
-       return usr_file(fd, mbox, MMDF_FORMAT);
-#endif
+       return usr_file(fd, mbox);
 }
 
 
@@ -647,8 +646,7 @@ usr_delivery(int fd, char *delivery, int su)
                case 'f':
                        /* mbox format */
                        if (!mh_strcasecmp(action, "file")) {
-                               status = usr_file(fd, string,
-                                               MBOX_FORMAT);
+                               status = usr_file(fd, string);
                                break;
                        }
                        /* deliver to nmh folder */
@@ -659,19 +657,13 @@ usr_delivery(int fd, char *delivery, int su)
                        break;
 
                case 'm':
-                       /* mmdf format */
-                       if (!mh_strcasecmp(action, "mmdf")) {
-                               status = usr_file(fd, string,
-                                               MMDF_FORMAT);
-                               break;
-                       }
                        /* mbox format */
-                       else if (mh_strcasecmp(action, "mbox"))
+                       if (mh_strcasecmp(action, "mbox"))
                                continue;  /* else fall */
 
                case '>':
                        /* mbox format */
-                       status = usr_file(fd, string, MBOX_FORMAT);
+                       status = usr_file(fd, string);
                        break;
 
                case 'd':
@@ -1059,25 +1051,18 @@ timely(char *t1, char *t2)
 */
 
 static int
-usr_file(int fd, char *mailbox, int mbx_style)
+usr_file(int fd, char *mailbox)
 {
-       int md, mapping;
+       int md;
 
        if (verbose)
                verbose_printf("delivering to file \"%s\"", mailbox);
 
-       if (mbx_style == MBOX_FORMAT) {
-               if (verbose)
-                       verbose_printf(" (mbox style)");
-               mapping = 0;
-       } else {
-               if (verbose)
-                       verbose_printf(" (mmdf style)");
-               mapping = 1;
-       }
+       if (verbose)
+               verbose_printf(" (mbox style)");
 
        /* open and lock the file */
-       if ((md = mbx_open(mailbox, mbx_style, pw->pw_uid, pw->pw_gid,
+       if ((md = mbx_open(mailbox, pw->pw_uid, pw->pw_gid,
                        m_gmprot())) == -1) {
                if (verbose)
                        adorn("", "unable to open:");
@@ -1087,8 +1072,7 @@ usr_file(int fd, char *mailbox, int mbx_style)
        lseek(fd, (off_t) 0, SEEK_SET);
 
        /* append message to file */
-       if (mbx_copy(mailbox, mbx_style, md, fd, mapping, NULL, verbose)
-                       == -1) {
+       if (mbx_copy(mailbox, md, fd, verbose) == -1) {
                if (verbose)
                        adorn("", "error writing to:");
                return -1;