projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactoring in spost.
[mmh]
/
uip
/
slocal.c
diff --git
a/uip/slocal.c
b/uip/slocal.c
index
85bc52a
..
7546cdd
100644
(file)
--- 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 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);
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",
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)
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 */
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")) {
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 */
break;
}
/* deliver to nmh folder */
@@
-659,19
+653,13
@@
usr_delivery(int fd, char *delivery, int su)
break;
case 'm':
break;
case 'm':
- /* mmdf format */
- if (!mh_strcasecmp(action, "mmdf")) {
- status = usr_file(fd, string,
- MMDF_FORMAT);
- break;
- }
/* mbox format */
/* mbox format */
- else if (mh_strcasecmp(action, "mbox"))
+ if (mh_strcasecmp(action, "mbox"))
continue; /* else fall */
case '>':
/* mbox format */
continue; /* else fall */
case '>':
/* mbox format */
- status = usr_file(fd, string, MBOX_FORMAT);
+ status = usr_file(fd, string);
break;
case 'd':
break;
case 'd':
@@
-1059,25
+1047,18
@@
timely(char *t1, char *t2)
*/
static int
*/
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 (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 */
/* 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:");
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 */
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;
if (verbose)
adorn("", "error writing to:");
return -1;