*** /tmp/T0a006k2 Mon Jul 28 16:38:40 1997 --- actions.c Mon Jul 28 16:32:28 1997 *************** *** 81,86 **** --- 81,87 ---- #include #include #include + #include #include "defs.h" #include "filter.h" *************** *** 89,94 **** --- 90,96 ---- FILE *emergency_local_delivery(); extern char *date_n_user(); + mail_message(address) char *address; { *************** *** 103,108 **** --- 105,111 ---- int in_header = TRUE, line_count = 0, mailunit, pid, statusp; char tempfile[SLEN], mailbox[SLEN], buffer[VERY_LONG_STRING], *cp; + struct passwd *p; if (verbose && ! log_actions_only && outfd != NULL) fprintf(outfd, catgets(elm_msg_cat,FilterSet,FilterMailingMessage, *************** *** 221,228 **** /** OTHERWISE it is to the current user... **/ ! sprintf(mailbox, "%s%s", mailhome, username); if (!lock()) { if (outfd != NULL) { fprintf(outfd, catgets(elm_msg_cat,FilterSet, --- 224,234 ---- /** OTHERWISE it is to the current user... **/ ! /* sprintf(mailbox, "%s%s", mailhome, username); */ ! sprintf(mailbox, "%s%s", home, "/.INBOX"); + + if (!lock()) { if (outfd != NULL) { fprintf(outfd, catgets(elm_msg_cat,FilterSet, *************** *** 240,248 **** else if ((mailunit = open(mailbox, O_APPEND | O_WRONLY | O_CREAT, 0600)) >= 0) mailfd = fdopen(mailunit, "a"); ! else if ((mailfd = emergency_local_delivery()) == NULL) ! exit(1); ! while (fgets(buffer, sizeof(buffer), tempfd) != NULL) { line_count++; if (the_same(buffer, "From ") && line_count > 1) --- 246,254 ---- else if ((mailunit = open(mailbox, O_APPEND | O_WRONLY | O_CREAT, 0600)) >= 0) mailfd = fdopen(mailunit, "a"); ! else ! if ((mailfd = emergency_local_delivery()) == NULL) ! exit(1); while (fgets(buffer, sizeof(buffer), tempfd) != NULL) { line_count++; if (the_same(buffer, "From ") && line_count > 1) *** /tmp/T0a006k2 Mon Jul 28 16:38:40 1997 --- lock.c Mon Jul 28 16:22:35 1997 *************** *** 191,198 **** int attempts = 0, ret; #ifdef USE_DOTLOCK_LOCKING /* { USE_DOTLOCK_LOCKING */ ! strcpy(dotlock_name,mailhome); ! strcat(dotlock_name,username); lockfile = mk_lockname(dotlock_name); #ifdef PIDCHECK /** first, try to read the lock file, and if possible, check the pid. --- 191,200 ---- int attempts = 0, ret; #ifdef USE_DOTLOCK_LOCKING /* { USE_DOTLOCK_LOCKING */ ! /* strcpy(dotlock_name,mailhome); ! strcat(dotlock_name,username);*/ ! strcpy(dotlock_name,home); ! strcat(dotlock_name,"/.INBOX"); lockfile = mk_lockname(dotlock_name); #ifdef PIDCHECK /** first, try to read the lock file, and if possible, check the pid. *************** *** 231,237 **** #endif /* } USE_DOTLOCK_LOCKING */ #ifdef NEEDS_FLOCK_FD /* { NEEDS_FLOCK_FD */ ! (void)sprintf(flock_name,"%s%s",mailhome,username); flock_fd = open(flock_name, O_RDWR | O_CREAT, 0600); if ( flock_fd >= 0 ) { --- 233,241 ---- #endif /* } USE_DOTLOCK_LOCKING */ #ifdef NEEDS_FLOCK_FD /* { NEEDS_FLOCK_FD */ ! /* (void)sprintf(flock_name,"%s%s",mailhome,username); */ ! (void)sprintf(flock_name,"%s%s",home,"/.INBOX"); ! /* printf("flock: %s\n", flock_name); */ flock_fd = open(flock_name, O_RDWR | O_CREAT, 0600); if ( flock_fd >= 0 ) {