X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fslocal.c;h=7546cdd953169507c74e8c75ad4aec7565e462f6;hb=de448e64862babc8ea92d6ee3f61f68ba3915128;hp=2ac93d1dc4e316ddc91e09f7fe8703f78d09d5f3;hpb=5b792c4424571f05bc2008e3109797d18d7d00d1;p=mmh diff --git a/uip/slocal.c b/uip/slocal.c index 2ac93d1..7546cdd 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -189,7 +189,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); @@ -405,8 +405,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 +456,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 +642,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 +653,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 +1047,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 +1068,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; @@ -1369,7 +1349,7 @@ you_lose: while (fgets(buffer, sizeof(buffer), qfp)) { if (first) { first = 0; - if (!strncmp(buffer, "From ", i)) { + if (strncmp(buffer, "From ", i)==0) { #ifdef RPATHS char *fp, *cp, *hp, *ep; #endif