Index: ossp-pkg/petidomo/Makefile.in RCS File: /v/ossp/cvs/ossp-pkg/petidomo/Makefile.in,v rcsdiff -q -kk '-r1.10' '-r1.11' -u '/v/ossp/cvs/ossp-pkg/petidomo/Makefile.in,v' 2>/dev/null --- Makefile.in 2000/12/15 14:54:00 1.10 +++ Makefile.in 2000/12/15 15:48:00 1.11 @@ -2,6 +2,20 @@ # Petidomo Makefile # +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ + CC = @CC@ CXX = @CXX@ AR = ar @@ -14,13 +28,12 @@ CPPFLAGS = @CPPFLAGS@ @DEFS@ LDFLAGS = @LDFLAGS@ -OBJS = acl.o archive.o argvSetDebugLevel.o authen.o config.o exit.o \ +OBJS = acl.o archive.o authen.o config.o exit.o \ filter.o handleacl.o help.o hermes.o index.o io.o listserv.o \ mailer.o members.o parsearray.o password.o rfcparse.o \ subscribe.o tool.o signature.o unsubscribe.o main.o LIBS = librfc822/librfc822.a liblists/liblists.a libargv/libargv.a \ - libconfigfile/libconfigfile.a libtext/libtext.a \ - libdebug/libdebug.a + libconfigfile/libconfigfile.a libtext/libtext.a FLAGS_TO_PASS = CC="$(CC)" CXX="$(CXX)" AR="$(AR)" RANLIB="$(RANLIB)" LEX="$(LEX)" \ YACC="$(YACC)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \ @@ -35,15 +48,9 @@ .cpp.o: $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -all: hermes listserv - petidomo: $(OBJS) $(LIBS) $(CC) $(OBJS) -o $@ $(LDFLAGS) $(LIBS) -hermes listserv: petidomo - @rm -f $@ - ln -s petidomo $@ - acl.c acl_scan.h: acl.y $(YACC) -d -p acl acl.y mv y.tab.c acl.c @@ -62,7 +69,7 @@ @for n in lib*; do (cd $$n && $(MAKE) $@); done clean:: - rm -f petidomo listserv hermes + rm -f petidomo rm -f $(OBJS) rm -f acl_scan.c acl_scan.h acl.c @@ -74,29 +81,28 @@ # Dependencies -acl.o: libtext/text.h petidomo.h libargv/argv.h debug.h acl_scan.c acl_scan.h +acl.o: libtext/text.h petidomo.h libargv/argv.h acl_scan.c acl_scan.h acl_scan.o: acl_scan.h -archive.o: libtext/text.h petidomo.h libargv/argv.h debug.h -argvSetDebugLevel.o: debug.h libargv/argv.h -authen.o: libtext/text.h petidomo.h libargv/argv.h debug.h +archive.o: libtext/text.h petidomo.h libargv/argv.h +authen.o: libtext/text.h petidomo.h libargv/argv.h config.o: liblists/lists.h libconfigfile/configfile.h petidomo.h -config.o: libargv/argv.h debug.h -exit.o: libtext/text.h petidomo.h libargv/argv.h debug.h -filter.o: petidomo.h libargv/argv.h debug.h -handleacl.o: petidomo.h libargv/argv.h debug.h -help.o: libtext/text.h petidomo.h libargv/argv.h debug.h -hermes.o: libtext/text.h petidomo.h libargv/argv.h debug.h -index.o: libtext/text.h petidomo.h libargv/argv.h debug.h -io.o: petidomo.h libargv/argv.h debug.h -listserv.o: libtext/text.h petidomo.h libargv/argv.h debug.h -mailer.o: libtext/text.h petidomo.h libargv/argv.h debug.h -main.o: petidomo.h libargv/argv.h debug.h -members.o: libtext/text.h petidomo.h libargv/argv.h debug.h -parsearray.o: petidomo.h libargv/argv.h debug.h -password.o: petidomo.h libargv/argv.h debug.h +config.o: libargv/argv.h +exit.o: libtext/text.h petidomo.h libargv/argv.h +filter.o: petidomo.h libargv/argv.h +handleacl.o: petidomo.h libargv/argv.h +help.o: libtext/text.h petidomo.h libargv/argv.h +hermes.o: libtext/text.h petidomo.h libargv/argv.h +index.o: libtext/text.h petidomo.h libargv/argv.h +io.o: petidomo.h libargv/argv.h +listserv.o: libtext/text.h petidomo.h libargv/argv.h +mailer.o: libtext/text.h petidomo.h libargv/argv.h +main.o: petidomo.h libargv/argv.h +members.o: libtext/text.h petidomo.h libargv/argv.h +parsearray.o: petidomo.h libargv/argv.h +password.o: petidomo.h libargv/argv.h rfcparse.o: librfc822/rfc822.h libtext/text.h petidomo.h libargv/argv.h -rfcparse.o: debug.h -signature.o: petidomo.h libargv/argv.h debug.h -subscribe.o: libtext/text.h petidomo.h libargv/argv.h debug.h -tool.o: libtext/text.h petidomo.h libargv/argv.h debug.h -unsubscribe.o: libtext/text.h petidomo.h libargv/argv.h debug.h +rfcparse.o: +signature.o: petidomo.h libargv/argv.h +subscribe.o: libtext/text.h petidomo.h libargv/argv.h +tool.o: libtext/text.h petidomo.h libargv/argv.h +unsubscribe.o: libtext/text.h petidomo.h libargv/argv.h Index: ossp-pkg/petidomo/acl.y RCS File: /v/ossp/cvs/ossp-pkg/petidomo/acl.y,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/acl.y,v' 2>/dev/null --- acl.y 2000/12/13 15:35:14 1.2 +++ acl.y 2000/12/15 15:48:00 1.3 @@ -155,7 +155,6 @@ FILE * fh; int rc; - debug((DEBUG_ACL, 2, "Starting ACL-filter \"%s\".", filter)); fh = popen(filter, "w"); if (fh == NULL) { syslog(LOG_ERR, "Failed to open ACL-filter \"%s\": %m", filter); @@ -171,10 +170,8 @@ rc = WEXITSTATUS(rc); switch(rc) { case 0: - debug((DEBUG_ACL, 2, "Filter returned %d (TRUE).", rc)); return TRUE; case 1: - debug((DEBUG_ACL, 2, "Filter returned %d (FALSE).", rc)); return FALSE; default: syslog(LOG_ERR, "ACL-filter \"%s\" returned unexpected value %d.", filter, rc); @@ -213,20 +210,16 @@ switch(oper) { case TOK_EQUAL: if (left != NULL && strcasecmp(left, string) == 0) { - debug((DEBUG_ACL, 1, "ACL: \"%s\" == \"%s\" == TRUE", left, string)); return TRUE; } else { - debug((DEBUG_ACL, 1, "ACL: \"%s\" == \"%s\" == FALSE", left, string)); return FALSE; } case TOK_MATCH: if (left != NULL && text_easy_pattern_match(left, string) == TRUE) { - debug((DEBUG_ACL, 1, "ACL: \"%s\" match \"%s\" == TRUE", left, string)); return TRUE; } else { - debug((DEBUG_ACL, 1, "ACL: \"%s\" match \"%s\" == FALSE", left, string)); return FALSE; } default: @@ -260,13 +253,11 @@ /* First check the mail against the master acl file. */ - debug((DEBUG_ACL, 2, "Testing mail against \"~petidomo/etc/acl\".")); yyin = fopen("etc/acl", "r"); if (yyin == NULL) { switch(errno) { case ENOENT: /* no master acl file */ - debug((DEBUG_ACL, 1, "No master acl file found.")); goto check_local_acl_file; default: syslog(LOG_ERR, "Couldn't open \"~petidomo/etc/acl\" acl file.: %m"); @@ -306,13 +297,11 @@ goto finished; filename = text_easy_sprintf("lists/%s/acl", listname); - debug((DEBUG_ACL, 2, "Testing mail against \"~petidomo/%s\".", filename)); yyin = fopen(filename, "r"); if (yyin == NULL) { switch(errno) { case ENOENT: /* no list acl file */ - debug((DEBUG_ACL, 1, "No acl file for list \"%s\".", listname)); goto finished; default: syslog(LOG_ERR, "Couldn't open \"~petidomo/%s\" file: %m", filename); Index: ossp-pkg/petidomo/archive.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/archive.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/archive.c,v' 2>/dev/null --- archive.c 2000/12/13 15:35:14 1.2 +++ archive.c 2000/12/15 15:48:00 1.3 @@ -65,44 +65,35 @@ path = text_easy_sprintf("lists/%s/%s", listname, ListConfig->archivepath); path = xstrdup(path); } - debug((DEBUG_ARCHIVE, 2, "Our archive path is \"%s\".", path)); /* Check whether we have a file or a directory. */ if (stat(path, &sb) == 0 && (sb.st_mode & S_IFDIR) != 0) { - /* Store the article to the current number into the directory. */ - - debug((DEBUG_ARCHIVE, 3, "\"%s\" is a directory.", path)); - /* Read the "active"-file to see at what article number we were. */ filename = text_easy_sprintf("%s/.active", path); fh = fopen(filename, "r"); - if (fh != NULL) { + if (fh != NULL) + { fscanf(fh, "%u", &counter); - debug((DEBUG_ARCHIVE, 5, ".active file contained '%u'.", counter)); fclose(fh); - } - else { + } + else + { if (errno != ENOENT) - syslog(LOG_ERR, "Failed to read file \"%s\": %m", filename); + syslog(LOG_ERR, "Failed to read file \"%s\": %m", filename); else - debug((DEBUG_ARCHIVE, 1, "File \".active\" did not exist.")); - counter = 0; - } + counter = 0; + } /* Store the article. */ do { filename = text_easy_sprintf("%s/%u", path, counter); - debug((DEBUG_ARCHIVE, 4, "Testing whether file \"%s\" exists already.", - filename)); if (stat(filename, &sb) == -1) { - debug((DEBUG_ARCHIVE, 7, "Nope, it doesn't.")); if (errno == ENOENT) { - debug((DEBUG_ARCHIVE, 1, "Writing mail to file \"%s\".", filename)); fh = fopen(filename, "a"); if (fh != NULL) { fprintf(fh, "From %s-owner@%s %s", listname, ListConfig->fqdn, date); @@ -121,8 +112,6 @@ break; } } - else - debug((DEBUG_ARCHIVE, 7, "Yep, it does.")); } while (++counter); /* until break */ /* Write the current "active" number back to the file. */ @@ -132,7 +121,6 @@ fh = fopen(filename, "w"); if (fh != NULL) { fprintf(fh, "%u", counter); - debug((DEBUG_ARCHIVE, 5, "Wrote '%u' to .active file.", counter)); fclose(fh); } else @@ -142,7 +130,6 @@ /* Simply append the article to this file. */ - debug((DEBUG_ARCHIVE, 1, "Appending mail to logfile \"%s\".", path)); fh = fopen(path, "a"); if (fh != NULL) { /* Write an envelope first. */ Index: ossp-pkg/petidomo/authen.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/authen.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/authen.c,v' 2>/dev/null --- authen.c 2000/12/13 15:35:14 1.2 +++ authen.c 2000/12/15 15:48:00 1.3 @@ -43,7 +43,6 @@ syslog(LOG_ERR, "Failed to parse the approve statement in the mail body."); return -1; } - debug((DEBUG_HERMES, 3, "Found password \"%s\" in mail body.", currLine)); MailStruct->Approve = currLine; } return 0; @@ -69,9 +68,6 @@ if (ListConfig->admin_password == NULL) return FALSE; - debug((DEBUG_AUTHEN, 5, "Comparing provided password '%s' to correct one '%s'.", - ListConfig->admin_password, password)); - if (!strcasecmp(ListConfig->admin_password, password)) return TRUE; } @@ -80,33 +76,25 @@ bool isValidPostingPassword(const char * password, const char * listname) -{ + { const struct List_Config * ListConfig; if (password == NULL) - return FALSE; + return FALSE; if (isValidAdminPassword(password, listname) == TRUE) - return TRUE; + return TRUE; - if (listname != NULL) { + if (listname != NULL) + { ListConfig = getListConfig(listname); if (ListConfig->posting_password == NULL) - return FALSE; + return FALSE; - debug((DEBUG_AUTHEN, 5, "provided password '%s' to correct one '%s'.", - ListConfig->posting_password, password)); - - if (!strcasecmp(ListConfig->posting_password, password)) { - debug((DEBUG_AUTHEN, 2, "Provided password is correct!")); + if (!strcasecmp(ListConfig->posting_password, password)) return TRUE; } - else { - debug((DEBUG_AUTHEN, 2, "Provided password is incorrect!")); - } - - } return FALSE; -} + } Index: ossp-pkg/petidomo/config.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/Attic/config.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/Attic/config.c,v' 2>/dev/null --- config.c 2000/12/13 15:35:14 1.2 +++ config.c 2000/12/15 15:48:00 1.3 @@ -73,17 +73,14 @@ /* First of all, determine the home directory of the "petidomo" user. This will be our base directory for all operations. */ - debug((DEBUG_CONFIG, 9, "Looking for the home directory of user petidomo.")); pwd = getpwnam("petidomo"); if (pwd != NULL) { - debug((DEBUG_CONFIG, 8, "Home directory of petidomo is \"%s\".", pwd->pw_dir)); if (strcmp(basedir, pwd->pw_dir) != 0) basedir = xstrdup(pwd->pw_dir); /* Replace the default above. */ endpwent(); } else syslog(LOG_WARNING, "User \"petidomo\" not found."); - debug((DEBUG_CONFIG, 8, "Will use basedir \"%s\".", basedir)); /* chdir() into the base directory. */ @@ -186,7 +183,6 @@ /* No? Then read the config file. */ sprintf(buffer, "lists/%s/config", listname); - debug((DEBUG_CONFIG, 6, "getListConfig(): Loading config file \"%s\".", buffer)); rc = ReadConfig(buffer, ListCF); if (rc != 0) { syslog(LOG_ERR, "Failed to parse the list \"%s\"'s config file.", listname); @@ -207,8 +203,6 @@ syslog(LOG_ERR, "Failed to allocate %d byte of memory.", sizeof(struct List_Config)); exit(1); } - debug((DEBUG_CONFIG, 6, "Loaded config file successfully.")); - debug((DEBUG_CONFIG, 4, "Read listtype is \"%s\".", listtype)); if (!strcasecmp(listtype, "open")) ListConfig->listtype = LIST_OPEN; else if (!strcasecmp(listtype, "closed")) Index: ossp-pkg/petidomo/filter.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/filter.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/filter.c,v' 2>/dev/null --- filter.c 2000/12/13 15:35:14 1.2 +++ filter.c 2000/12/15 15:48:00 1.3 @@ -53,8 +53,6 @@ assert(MailStruct != NULL); assert(filter != NULL); - debug((DEBUG_FILTER, 2, "Starting mail filter \"%s\".", filter)); - /* Sanity checks. */ if (MailStruct == NULL || filter == NULL) @@ -89,7 +87,6 @@ } close(child_in[READ]); close(child_out[WRITE]); - debug((DEBUG_FILTER, 2, "Child process is set up. Executing filter.")); execl("/bin/sh", "sh", "-c", filter, NULL); return -1; case -1: @@ -130,7 +127,6 @@ syslog(LOG_ERR, "Couldn't set flags for write-pipe descriptor: %m"); goto error_exit; } - debug((DEBUG_FILTER, 4, "Pipes are in non-blocking mode now.")); /* Now write the mail into the pipe and read the result from the child. This has to happen parallely or we risk that the child @@ -161,11 +157,9 @@ rc = write(child_in[WRITE], p + byte_written, (strlen(p + byte_written) > IO_BLOCKSIZE) ? IO_BLOCKSIZE : strlen(p + byte_written)); - debug((DEBUG_FILTER, 4, "Write returned '%d'.", rc)); if (rc >= 0) { byte_written += rc; if (p[byte_written] == '\0') { - debug((DEBUG_FILTER, 2, "New write state")); write_state++; /* new state */ byte_written = 0; if (write_state == STATE_FINISHED) @@ -182,7 +176,6 @@ if ((newmail_size - byte_read) <= (IO_BLOCKSIZE)) { newmail_size += 10*1024; - debug((DEBUG_FILTER, 4, "Allocting new read buffer: %d byte", newmail_size)); newmail = realloc(newmail, newmail_size); if (newmail == NULL) { syslog(LOG_ERR, "Failed to allocate %d byte of memory: %m", newmail_size); @@ -190,7 +183,6 @@ } } rc = read(child_out[READ], newmail + byte_read, IO_BLOCKSIZE); - debug((DEBUG_FILTER, 4, "Read returned '%d'.", rc)); if (rc > 0) byte_read += rc; else if (rc == 0) { @@ -201,9 +193,6 @@ syslog(LOG_ERR, "Reading from filter process failed: %m"); goto error_exit; } - else { - debug((DEBUG_FILTER, 4, "read would block")); - } } newmail[byte_read] = '\0'; @@ -218,8 +207,6 @@ break; } } - debug((DEBUG_FILTER, 5, "New header is:\n%s", MailStruct->Header)); - debug((DEBUG_FILTER, 5, "New body is:\n%s", MailStruct->Body)); /* Get returncode. */ @@ -227,11 +214,8 @@ if (!WIFEXITED(rc)) return -1; - debug((DEBUG_FILTER, 4, "Filter \"%s\" returned %d.", filter, WEXITSTATUS(rc))); return WEXITSTATUS(rc); - return 0; - error_exit: close(child_in[WRITE]); close(child_out[READ]); Index: ossp-pkg/petidomo/handleacl.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/handleacl.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/handleacl.c,v' 2>/dev/null --- handleacl.c 2000/12/13 15:35:14 1.2 +++ handleacl.c 2000/12/15 15:48:00 1.3 @@ -51,18 +51,14 @@ switch(operation) { case ACL_NONE: - debug((DEBUG_ACL, 4, "No ACL statement matched the mail.")); break; case ACL_PASS: - debug((DEBUG_ACL, 4, "Mail passed access control.")); break; case ACL_DROP: - syslog(LOG_INFO, "Mail is dropped due to access control."); return 1; case ACL_REJECTWITH: assert(parameter != NULL); case ACL_REJECT: - syslog(LOG_INFO, "Mail is rejected due to access control."); fh = vOpenMailer(envelope, owner, (MailStruct->Reply_To) ? (MailStruct->Reply_To) : (MailStruct->From), NULL); if (fh == NULL) { @@ -132,7 +128,6 @@ syslog(LOG_INFO, "Mail is filtered through \"%s\" due to access control.", parameter); rc = MailFilter(MailStruct, parameter); - debug((DEBUG_ACL, 3, "Mail filter \"%s\" returned %d.", parameter, rc)); if (rc != 0) { syslog(LOG_ERR, "Mail filter \"%s\" returned error code %d.", parameter, rc); return -1; @@ -146,15 +141,5 @@ if (parameter != NULL) free(parameter); -#ifdef DEBUG - if (listname != NULL) { - debug((DEBUG_ACL, 3, "\"%s\" is authorized to post to \"%s\".", - MailStruct->From, listname)); - } - else { - debug((DEBUG_ACL, 3, "Request from \"%s\" is okay, says ACL", MailStruct->From)); - } -#endif - return 0; } Index: ossp-pkg/petidomo/help.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/help.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/help.c,v' 2>/dev/null --- help.c 2000/12/13 15:35:14 1.2 +++ help.c 2000/12/15 15:48:00 1.3 @@ -49,8 +49,6 @@ /* Send list's description back. */ - debug((DEBUG_COMMAND, 5, "Sending \"%s\" list \"%s\" description.", - originator, param1)); ListConfig = getListConfig(param1); sprintf(envelope, "%s-owner@%s", param1, MasterConfig->fqdn); fh = vOpenMailer(envelope, originator, NULL); @@ -86,8 +84,6 @@ /* List does not exist, I am afraid. */ - debug((DEBUG_COMMAND, 5, "Received HELP command for non-existing list \"%s\".", - param1)); fh = vOpenMailer(envelope, originator, NULL); if (fh == NULL) { syslog(LOG_ERR, "Failed to send mail to \"%s\" regarding this request.", @@ -123,7 +119,6 @@ /* Send help text to the originator. */ - debug((DEBUG_COMMAND, 5, "Sending helpfile to \"%s\".", originator)); fh = vOpenMailer(envelope, originator, NULL); if (fh == NULL) { syslog(LOG_ERR, "Failed to send mail to \"%s\" regarding this request.", @@ -182,7 +177,6 @@ /* Send the help file out. */ - debug((DEBUG_COMMAND, 5, "Sending helpfile to \"%s\".", replyto)); fh = vOpenMailer(envelope, replyto, NULL); if (fh == NULL) { syslog(LOG_ERR, "Failed to send mail to \"%s\" regarding this request.", replyto); Index: ossp-pkg/petidomo/hermes.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/hermes.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/hermes.c,v' 2>/dev/null --- hermes.c 2000/12/13 15:35:14 1.2 +++ hermes.c 2000/12/15 15:48:00 1.3 @@ -43,7 +43,6 @@ int rc, len, operation; assert(listname != NULL); - debug((DEBUG_HERMES, 5, "Received article for the \"%s\" mailing list", listname)); /* Initialize internals. */ @@ -57,8 +56,6 @@ exit(rc); } - debug((DEBUG_HERMES, 3, "Parsed incoming mail successfully.")); - /* Do sanity checks. */ if (MailStruct->Envelope == NULL) { @@ -87,8 +84,6 @@ /* Check for authorization. */ - debug((DEBUG_HERMES, 5, "Checking whether posting is authorized.")); - if (FindBodyPassword(MailStruct) != 0) exit(1); @@ -125,9 +120,6 @@ if (ListConfig->listtype == LIST_CLOSED) { /* Only subscribers may post */ if (isSubscribed(listname, MailStruct->From, NULL, NULL, TRUE) == FALSE) { - debug((DEBUG_HERMES, 5, "\"%s\" is not a subscriber of \"%s\". Rejecting.", - MailStruct->From, listname)); - fh = vOpenMailer(envelope, owner, NULL); if (fh != NULL) { fprintf(fh, "From: %s (Petidomo Mailing List Server)\n", owner); @@ -156,7 +148,6 @@ exit(1); } rc = handleACL(MailStruct, listname, operation, parameter); - debug((DEBUG_HERMES, 8, "handleACL() returned %d.", rc)); switch(rc) { case -1: syslog(LOG_ERR, "handleACL() failed with an error."); @@ -166,18 +157,11 @@ case 1: return 0; } - - debug((DEBUG_HERMES, 3, "\"%s\" is authorized to post to \"%s\".", - MailStruct->From, listname)); - } - else { - debug((DEBUG_HERMES, 5, "Listtype doesn't require authorization.")); } /* Copy the desired headers from the original mail to our own buffer. */ - debug((DEBUG_HERMES, 9, "Preparing headers for posting.")); for(len = 0, currLine = MailStruct->Header, dst = PostingHeaders; *currLine != '\0'; currLine = nextLine) { @@ -205,7 +189,6 @@ len = nextLine - currLine; memmove(dst, currLine, len); dst += len; - debug((DEBUG_HERMES, 9, "Copied line.")); } } @@ -255,19 +238,14 @@ /* Add the signature if there is one. */ buffer = text_easy_sprintf("lists/%s/signature", listname); - debug((DEBUG_HERMES, 6, "Checking whether \"%s\" exists.", buffer)); if (stat(buffer, &sb) == 0) { - debug((DEBUG_HERMES, 3, "Appending signature \"%s\".", buffer)); buffer = loadfile(buffer); if (buffer == NULL) { syslog(LOG_ERR, "Failed reading the signature file for list \"%s\".", listname); exit(1); } MailStruct->ListSignature = buffer; - debug((DEBUG_HERMES, 7, "Signature is: \"%s\".", buffer)); } - else - debug((DEBUG_HERMES, 3, "No signature file \"%s\".", buffer)); /* No more modifications will be made. Now copy the posting headers into the structure instead of the original ones. */ @@ -277,14 +255,12 @@ /* Apply the posting filter. */ if (ListConfig->postingfilter != NULL) { - debug((DEBUG_HERMES, 3, "Applying posting filter for list \"%s\".", listname)); rc = MailFilter(MailStruct, ListConfig->postingfilter); if (rc != 0) { syslog(LOG_ERR, "Postingfilter \"%s\" returned error %d while processing posting " \ "for list \"%s\".", ListConfig->postingfilter, rc, listname); exit(1); } - debug((DEBUG_HERMES, 6, "Filter was successful: returncode = %d.", rc)); } /* Deliver the article to all recipients. */ Index: ossp-pkg/petidomo/index.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/index.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/index.c,v' 2>/dev/null --- index.c 2000/12/13 15:35:14 1.2 +++ index.c 2000/12/15 15:48:00 1.3 @@ -45,9 +45,6 @@ struct dirent * entry; unsigned int entry_num; - debug((DEBUG_COMMAND, 3, "GenIndex(\"%s\", \"%s\") with default list \"%s\".", - param1, param2, defaultlist)); - address = (MailStruct->Reply_To) ? MailStruct->Reply_To : MailStruct->From; /* Initialize internal stuff. */ @@ -96,14 +93,10 @@ continue; if (isValidListName(entry->d_name) == FALSE) continue; - debug((DEBUG_COMMAND, 5, "Found entry \"lists/%s\".", entry->d_name)); ListConfig = getListConfig(entry->d_name); - if (ListConfig->showonindex == FALSE) { - debug((DEBUG_COMMAND, 5, "List \"%s\" won't appear on the index.", - entry->d_name)); + if (ListConfig->showonindex == FALSE) continue; - } entry_num++; /* Print stuff to the mail. */ Index: ossp-pkg/petidomo/listserv.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/listserv.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/listserv.c,v' 2>/dev/null --- listserv.c 2000/12/13 15:35:14 1.2 +++ listserv.c 2000/12/15 15:48:00 1.3 @@ -51,7 +51,6 @@ syslog(LOG_ERR, "Parsing the incoming mail failed."); exit(rc); } - debug((DEBUG_LISTSERV, 3, "Parsed incoming mail successfully.")); /* Do sanity checks. */ @@ -103,10 +102,8 @@ if (*g_currLine == '\0' || *g_currLine == '#') continue; - if (!strcmp(g_currLine, "-- ")) { - debug((DEBUG_LISTSERV, 6, "Ignoring trailing signature.")); + if (!strcmp(g_currLine, "-- ")) break; - } /* Log contents of current line. */ @@ -118,10 +115,8 @@ for (j = 0; !isspace((int)g_currLine[j]) && j < (sizeof(keyword)-1); j++) keyword[j] = g_currLine[j]; keyword[j] = '\0'; - debug((DEBUG_LISTSERV, 5, "command is \"%s\".", keyword)); for (i = 0; (&(ParseArray[i]))->keyword != NULL; i++) { if (strcasecmp(keyword, (&(ParseArray[i]))->keyword) == 0) { /* hit */ - debug((DEBUG_LISTSERV, 4, "Recognized command \"%s\".", keyword)); rc = sscanf(g_currLine, "%*s%511s%511s", param1, param2); rc = ((&(ParseArray[i]))->handleCommand)(MailStruct, ((rc >= 1) ? param1 : NULL), @@ -140,7 +135,6 @@ /* No valid command. */ - debug((DEBUG_LISTSERV, 4, "Unrecognized command \"%s\".", keyword)); junklines++; } } Index: ossp-pkg/petidomo/mailer.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/mailer.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/mailer.c,v' 2>/dev/null --- mailer.c 2000/12/13 15:35:14 1.2 +++ mailer.c 2000/12/15 15:48:00 1.3 @@ -63,10 +63,6 @@ MasterConfig = getMasterConfig(); - debug((DEBUG_MAILER, 2, "MTA is \"%s\".", MasterConfig->mta)); - debug((DEBUG_MAILER, 2, "MTA options are \"%s\".", MasterConfig->mta_options)); - debug((DEBUG_MAILER, 2, "Envelope is \"%s\".", envelope)); - /* Determine the length of the required buffer. */ cmdline_len = strlen(MasterConfig->mta); @@ -74,12 +70,10 @@ cmdline_len += strlen(envelope); va_start(ap, envelope); while ((q = va_arg(ap, const char *)) != NULL) { - debug((DEBUG_MAILER, 2, "Recipient: \"%s\".", q)); cmdline_len += strlen(q) + 1; } va_end(ap); cmdline = xmalloc(cmdline_len+8); /* we don't take any risks :) */ - debug((DEBUG_MAILER, 3, "Command line will be %u byte long.", cmdline_len)); /* Copy the mta's path and name into the buffer. */ @@ -91,7 +85,6 @@ for (options = MasterConfig->mta_options; *options != '\0'; ) { - debug((DEBUG_MAILER, 4, "Parsing '%c' character.", *options)); if (options[0] == '%' && options[1] == 's') { p = my_strcpy(p, envelope); @@ -101,7 +94,6 @@ } else { - debug((DEBUG_MAILER, 4, "Wrote '%c' to aray.", *options)); *p++ = *options++; } } @@ -118,8 +110,6 @@ p[-1] = '\0'; va_end(ap); - debug((DEBUG_MAILER, 1, "Starting up \"%s\".", cmdline)); - fh = popen(cmdline, "w"); if (fh == NULL) syslog(LOG_ERR, "Failed opening pipe to \"%s\": %m", cmdline); @@ -187,19 +177,14 @@ /* Set up the call to the MTA, including options. */ arguments[counter++] = MasterConfig->mta; - debug((DEBUG_MAILER, 5, "MTA is \"%s\".", arguments[0])); sprintf(buffer, MasterConfig->mta_options, envelope); - debug((DEBUG_MAILER, 5, "MTA options are \"%s\".", buffer)); for (p = buffer, arguments[counter++] = buffer; *p != '\0'; p++) { - debug((DEBUG_MAILER, 9, "Left to parse: \"%s\".", p)); if (isspace((int)*p)) { *p++ = '\0'; - debug((DEBUG_MAILER, 9, "Left to parse: \"%s\".", p)); while(*p != '\0' && isspace((int)*p)) p++; - debug((DEBUG_MAILER, 9, "Left to parse: \"%s\".", p)); arguments[counter++] = p; } } @@ -213,22 +198,14 @@ nextAddress = text_find_next_line(currAddress); len = my_strlen(currAddress); if (address_byte + len > max_address_byte) - { - debug((DEBUG_MAILER, 1, "Sending early, command line exceeds %d characters.", ARG_MAX)); break; - } if (counter > ARG_NUM_MAX) - { - debug((DEBUG_MAILER, 1, "Sending early, command line exceeds %d arguments.", ARG_NUM_MAX)); break; - } currAddress[len] = '\0'; - debug((DEBUG_MAILER, 8, "Address \"%s\" is %u byte long.", currAddress, len)); address_byte += len; arguments[counter++] = currAddress; if (counter+8 >= arguments_num) { - debug((DEBUG_MAILER, 1, "Enlarging internal array.")); arguments_num += 256; arguments = realloc(arguments, (arguments_num+1) * sizeof(char *)); if (arguments == NULL) Index: ossp-pkg/petidomo/members.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/members.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/members.c,v' 2>/dev/null --- members.c 2000/12/13 15:35:14 1.2 +++ members.c 2000/12/15 15:48:00 1.3 @@ -41,9 +41,6 @@ char * p; int i; - debug((DEBUG_COMMAND, 3, "SendSubscriberList(\"%s\") with default list \"%s\".", - param1, defaultlist)); - /* Try to find out, which parameter is what. */ if (param1 != NULL) { @@ -103,9 +100,6 @@ /* Okay, send the address list back. */ - debug((DEBUG_COMMAND, 1, "Sending list of subscribed addresses for list " - "\"%s\" to \"%s\".", listname, address)); - buffer = text_easy_sprintf("lists/%s/list", listname); buffer = loadfile(buffer); if (buffer == NULL) { Index: ossp-pkg/petidomo/password.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/password.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/password.c,v' 2>/dev/null --- password.c 2000/12/13 15:35:14 1.2 +++ password.c 2000/12/15 15:48:00 1.3 @@ -32,8 +32,6 @@ char * p; char * q; - debug((DEBUG_COMMAND, 3, "setPassword(\"%s\").", param1)); - /* Find the beginning of the parameter. */ p = g_currLine; @@ -63,7 +61,6 @@ /* Store the result. */ - debug((DEBUG_COMMAND, 2, "Setting current password to \"%s\".", p)); s_password = p; return 0; Index: ossp-pkg/petidomo/rfcparse.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/rfcparse.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/rfcparse.c,v' 2>/dev/null --- rfcparse.c 2000/12/13 15:35:14 1.2 +++ rfcparse.c 2000/12/15 15:48:00 1.3 @@ -53,16 +53,12 @@ rc = rfc822_parse_address(buffer, &address, NULL, NULL); if (rc == RFC822_OK) { - debug((DEBUG_RFCPARSE, 3, "'%s' is a valid rfc address.", address)); - if (address) { + if (address) free(address); - } return TRUE; } - else { - debug((DEBUG_RFCPARSE, 4, "'%s' is not a valid rfc address", buffer)); + else return FALSE; - } } int @@ -82,8 +78,6 @@ sep_state.address_line = buffer; sep_state.group_nest = 0; - debug((DEBUG_RFCPARSE, 2, "Original address is \"%s\".", buffer)); - /* We want only the first address, if multiple are there. */ while ((p = rfc822_address_sep(&sep_state)) != NULL) { @@ -98,11 +92,8 @@ return -1; } - debug((DEBUG_RFCPARSE, 2, "First part is \"%s\".", p)); - rc = rfc822_parse_address(p, &address, NULL, NULL); if (rc == RFC822_OK && address != NULL) { - debug((DEBUG_RFCPARSE, 2, "Parsed address is: '%s'", address)); strcpy(buffer, address); free(address); return 0; @@ -128,8 +119,6 @@ { int rc; - debug((DEBUG_RFCPARSE, 2, "Unparsed Message-Id: '%s'", buffer)); - rc = ParseAddressLine(buffer); if (rc != 0) return rc; /* Error! */ @@ -138,8 +127,6 @@ buffer[0] = '<'; strcat(buffer, ">"); - debug((DEBUG_RFCPARSE, 2, "Parsed Message-Id: '%s'", buffer)); - return rc; } @@ -198,13 +185,9 @@ if (buffer == NULL || *buffer == NULL) return; - debug((DEBUG_RFCPARSE, 3, "Check whether \"%s\" is a canon address.", *buffer)); - rc = rfc822_parse_address(*buffer, NULL, &local, &host); if (rc == RFC822_OK) { if (local != NULL && host == NULL) { - debug((DEBUG_RFCPARSE, 3, "'%s' is a local address, appending my hostname.", - *buffer)); if (fqdn == NULL) { MasterConfig = getMasterConfig(); fqdn = MasterConfig->fqdn; @@ -213,10 +196,7 @@ sprintf(newbuf, "%s@%s", local, fqdn); free(local); *buffer = newbuf; - debug((DEBUG_RFCPARSE, 3, "Canonized address: '%s'.", *buffer)); } - else - debug((DEBUG_RFCPARSE, 3, "\"%s\" is a full address.", *buffer)); } } @@ -268,7 +248,6 @@ currLine++; *currLine = '\0'; CanonizeAddress(&(MailStruct->Envelope), fqdn); - debug((DEBUG_RFCPARSE, 5, "Envelope is \"%s\".", MailStruct->Envelope)); currLine = nextLine; } @@ -288,10 +267,6 @@ if (nextLine[-1] == '\n') nextLine[-1] = '\0'; - /* Log contents of current line. */ - - debug((DEBUG_RFCPARSE, 6, "Parsing line \"%s\".", currLine)); - /* Check whether it is a header we're interested in. */ if (strncasecmp("From:", currLine, strlen("From:")) == 0) { @@ -304,7 +279,6 @@ if (rc != 0) return rc; CanonizeAddress(&(MailStruct->From), fqdn); - debug((DEBUG_RFCPARSE, 5, "From: is \"%s\".", MailStruct->From)); } else if (strncasecmp("Reply-To:", currLine, strlen("Reply-To:")) == 0) { if (MailStruct->Reply_To != NULL) { syslog(LOG_NOTICE, "Received mail with multiple Reply-To: lines."); @@ -315,7 +289,6 @@ if (rc != 0) return rc; CanonizeAddress(&(MailStruct->Reply_To), fqdn); - debug((DEBUG_RFCPARSE, 5, "Reply-To: is \"%s\".", MailStruct->Reply_To)); } else if (strncasecmp("Message-Id:", currLine, strlen("Message-Id:")) == 0) { if (MailStruct->Message_Id != NULL) { syslog(LOG_NOTICE, "Received mail with multiple Message-Id: lines."); @@ -325,7 +298,6 @@ rc = ParseMessageIdLine(MailStruct->Message_Id); if (rc != 0) return rc; - debug((DEBUG_RFCPARSE, 5, "Message-Id: is \"%s\".", MailStruct->Message_Id)); } else if (strncasecmp("Approve:", currLine, strlen("Approve:")) == 0) { if (MailStruct->Approve != NULL) @@ -334,7 +306,6 @@ rc = ParseApproveLine(MailStruct->Approve); if (rc != 0) return rc; - debug((DEBUG_RFCPARSE, 5, "Approve: is \"%s\".", MailStruct->Approve)); } else if (strncasecmp("Approved:", currLine, strlen("Approved:")) == 0) { if (MailStruct->Approve != NULL) @@ -343,7 +314,6 @@ rc = ParseApproveLine(MailStruct->Approve); if (rc != 0) return rc; - debug((DEBUG_RFCPARSE, 5, "Approve: is \"%s\".", MailStruct->Approve)); } else if (strncasecmp("Subject:", currLine, strlen("Subject:")) == 0) { if (MailStruct->Subject != NULL) @@ -351,7 +321,6 @@ MailStruct->Subject = &currLine[strlen("Subject:")]; if (*MailStruct->Subject == ' ') MailStruct->Subject += 1; - debug((DEBUG_RFCPARSE, 5, "Subject: is \"%s\".", MailStruct->Subject)); } else if (strncasecmp("Sender:", currLine, strlen("Sender:")) == 0) { if (MailStruct->Envelope != NULL) @@ -359,7 +328,6 @@ MailStruct->Envelope = &currLine[strlen("Sender:")]; if (*MailStruct->Envelope == ' ') MailStruct->Envelope += 1; - debug((DEBUG_RFCPARSE, 5, "Sender: is \"%s\".", MailStruct->Envelope)); } else if (strncasecmp("Return-Path:", currLine, strlen("Return-Path:")) == 0 && MailStruct->Envelope == NULL) @@ -369,7 +337,6 @@ MailStruct->Envelope = &currLine[strlen("Return-Path:")]; if (*MailStruct->Envelope == ' ') MailStruct->Envelope += 1; - debug((DEBUG_RFCPARSE, 5, "Return-Path: is \"%s\".", MailStruct->Envelope)); } } Index: ossp-pkg/petidomo/subscribe.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/subscribe.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/subscribe.c,v' 2>/dev/null --- subscribe.c 2000/12/13 15:35:14 1.2 +++ subscribe.c 2000/12/15 15:48:00 1.3 @@ -38,9 +38,6 @@ char * originator; char * p; - debug((DEBUG_COMMAND, 3, "AddAddress(\"%s\", \"%s\") with default list \"%s\".", - param1, param2, defaultlist)); - /* Try to find out, which parameter is what. */ if (param1 != NULL) { @@ -75,17 +72,12 @@ sprintf(envelope, "%s-owner@%s", listname, ListConfig->fqdn); originator = (MailStruct->Reply_To) ? MailStruct->Reply_To : MailStruct->From; - debug((DEBUG_COMMAND, 1, "Subscribing \"%s\" to list \"%s\".", address, listname)); - /* Check whether the request is authorized at all. */ if (isValidAdminPassword(getPassword(), listname) == FALSE) { /* No valid password, check further. */ - debug((DEBUG_COMMAND, 5, "The mail didn't contain any admin password. " \ - "Checking for authorization...")); - if (ListConfig->allowpubsub == FALSE) { /* Access was unauthorized, notify the originator. */ @@ -215,8 +207,6 @@ /* Check whether the address is subscribed already. */ if (isSubscribed(listname, address, NULL, NULL, FALSE) == TRUE) { - debug((DEBUG_COMMAND, 2, "\"%s\" is already subscribed to list \"%s\".", - address, listname)); /* Notify the originator, that the address is already a member. */ @@ -310,8 +300,6 @@ if (p != NULL) { fh = vOpenMailer(envelope, address, NULL); if (fh != NULL) { - debug((DEBUG_COMMAND, 5, "Sending \"%s\" as welcome mail to the new " \ - "subscriber.", buffer)); fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n", listname, ListConfig->fqdn); fprintf(fh, "To: %s\n", address); Index: ossp-pkg/petidomo/tool.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/tool.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/tool.c,v' 2>/dev/null --- tool.c 2000/12/13 15:35:14 1.2 +++ tool.c 2000/12/15 15:48:00 1.3 @@ -43,9 +43,6 @@ if (list == NULL) return FALSE; - debug((DEBUG_COMMAND, 3, "Searching for subscriber \"%s\" in list \"%s\".", - address, listname)); - for (len = strlen(address), p = list; *p != '\0'; p = text_find_next_line(p)) { if (strncasecmp(p, address, len) == 0 && (p == list || p[-1] == '\n') && @@ -55,7 +52,6 @@ } if (*p == '\0' && dofuzzy == TRUE) { - debug((DEBUG_COMMAND, 3, "No success, trying fuzzy matching.")); address = buildFuzzyMatchAddress(address); if (address != NULL) { for (len = strlen(address), p = list; *p != '\0'; p = text_find_next_line(p)) { @@ -67,14 +63,6 @@ } } -#ifdef DEBUG - if (*p != '\0') { - debug((DEBUG_COMMAND, 3, "Found address: \"%s\".", p)); - } - else { - debug((DEBUG_COMMAND, 3, "Nope, couldn't find address.")); - } -#endif /* Save the returncode now, because p may be invalid in a few moments. */ @@ -102,8 +90,6 @@ char * fuzzyaddress; int rc; - debug((DEBUG_COMMAND, 5, "Turning \"%s\" into a fuzzy match address.", address)); - fuzzyaddress = xmalloc(strlen(address)+16); rc = text_transform_text(fuzzyaddress, address, "([^@]+)@[^\\.]+\\.([^\\.]+\\..*)", "\\1@([^\\\\.]+\\\\.)?\\2"); @@ -120,12 +106,10 @@ case TEXT_REGEX_TRANSFORM_DIDNT_MATCH: break; case TEXT_REGEX_OK: - debug((DEBUG_COMMAND, 4, "Fuzzy-match address is \"%s\".", fuzzyaddress)); return fuzzyaddress; default: syslog(LOG_CRIT, "Internal error: Unexpected returncode in ParseMessageIdLine()."); } - debug((DEBUG_COMMAND, 3, "No fuzzy match address could be built.")); free(fuzzyaddress); return NULL; } @@ -140,10 +124,8 @@ assert(listname != NULL); - if ((strchr(listname, '/') != NULL) || (strchr(listname, ':') != NULL)) { - debug((DEBUG_COMMAND, 1, "listname '%s' contains a slash or colon!", listname)); + if ((strchr(listname, '/') != NULL) || (strchr(listname, ':') != NULL)) return FALSE; - } buffer = text_easy_sprintf("lists/%s", listname); if (stat(buffer, &sb) != 0) Index: ossp-pkg/petidomo/unsubscribe.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/unsubscribe.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/petidomo/unsubscribe.c,v' 2>/dev/null --- unsubscribe.c 2000/12/13 15:35:14 1.2 +++ unsubscribe.c 2000/12/15 15:48:00 1.3 @@ -38,9 +38,6 @@ char * p; char * list; - debug((DEBUG_COMMAND, 3, "DeleteAddress(\"%s\", \"%s\") with default list \"%s\".", - param1, param2, defaultlist)); - /* Try to find out, which parameter is what. */ if (param1 != NULL) { @@ -75,8 +72,6 @@ sprintf(envelope, "%s-owner@%s", listname, ListConfig->fqdn); originator = (MailStruct->Reply_To) ? MailStruct->Reply_To : MailStruct->From; - debug((DEBUG_COMMAND, 1, "Unsubscribing \"%s\" to list \"%s\".", address, listname)); - /* Check whether the request is authorized at all. */ if (isValidAdminPassword(getPassword(), listname) == FALSE) { @@ -214,11 +209,6 @@ if (isSubscribed(listname, address, &list, &p, FALSE) == FALSE) { - /* Address is not subscribed. */ - - debug((DEBUG_COMMAND, 2, "\"%s\" is not subscribed to list \"%s\".", - address, listname)); - /* Notify the originator, that the address is not subscribed at all. */