17 messages in net.sourceforge.lists.courier-maildrop[maildropl] Working on patch to autoc...
FromSent OnAttachments
Rob HuttonAug 22, 2003 1:51 pm 
Andreas StollarAug 22, 2003 4:06 pm 
Sam VarshavchikAug 22, 2003 7:46 pm 
Martin List-PetersenAug 23, 2003 6:17 am 
Rob HuttonAug 23, 2003 8:26 am 
Rob HuttonAug 23, 2003 9:57 am 
Sam VarshavchikAug 23, 2003 5:36 pm 
Rob HuttonAug 23, 2003 8:17 pm 
Rob HuttonAug 24, 2003 12:27 pm 
Sam VarshavchikAug 24, 2003 1:40 pm 
Rob HuttonAug 24, 2003 2:30 pm 
Rob HuttonAug 24, 2003 6:44 pm 
Rob HuttonAug 25, 2003 6:42 pm 
Matthias AndreeAug 25, 2003 8:04 pm 
Sam VarshavchikAug 26, 2003 6:10 am 
Peter MannAug 26, 2003 7:18 am 
Matthias AndreeAug 26, 2003 5:31 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[maildropl] Working on patch to autocreate maildirs/off topicActions...
From:Rob Hutton (rob.@comcast.net)
Date:Aug 22, 2003 1:51:50 pm
List:net.sourceforge.lists.courier-maildrop

********DISCLAIMER******************* I AM NOT A C/C++ PROGRAMER!!!!!!!!!!! *************************************

I am working on a patch to autocreate maildirs. When I run maildrop, the maildirs are created, but I get a signal 0x0B. I am told that this means that there is an invalid pointer being referenced. How do I figure out what is causing it?

Thanks, Rob

diff -u maildrop/maildrop.h ../maildrop-1.5.3/maildrop/maildrop.h --- maildrop/maildrop.h 2003-08-02 19:49:55.000000000 -0400 +++ ../maildrop-1.5.3/maildrop/maildrop.h 1999-09-09 22:10:05.000000000 -0400 @@ -40,7 +40,6 @@ Buffer init_shell; // Initial SHELL Buffer init_default; // Initial DEFAULT Buffer init_quota; // Initial MAILDIRQUOTA - int auto_create_maildir; // Create the Maildir if it does not exist

Mio logfile; // Log file. GlobalTimer global_timer; // Watchdog timeout. diff -u maildrop/main.C ../maildrop-1.5.3/maildrop/main.C --- maildrop/main.C 2003-08-13 03:44:51.000000000 -0400 +++ ../maildrop-1.5.3/maildrop/main.C 2003-04-09 20:21:57.000000000 -0400 @@ -2,13 +2,7 @@ ** Copyright 1998 - 2003 Double Precision, Inc. ** See COPYING for distribution information. */ -#include <ctype.h> -#include <errno.h>

-#include "../maildir/maildirmisc.h" -#include "../maildir/maildirquota.h" - -#include "log.h" #include "lexer.h" #include "recipe.h" #include "varlist.h" @@ -50,13 +44,6 @@ #include "mdmysql.h" #endif

-#if HAVE_FCNTL_H -#include <fcntl.h> -#endif -#if HAVE_UNISTD_H -#include <unistd.h> -#endif - static const char rcsid[]="$Id: main.C,v 1.42 2003/04/10 00:21:57 mrsam Exp $"; #if HAS_GETHOSTNAME #else @@ -170,7 +157,7 @@

static void copyright() { -static const char msg[]="maildrop " VERSION "-new Copyright 1998-2003 Double Precision, Inc." +static const char msg[]="maildrop " VERSION " Copyright 1998-2003 Double Precision, Inc."

#if CRLF_TERM "\r\n" @@ -430,8 +417,6 @@

static int run(int argc, char **argv) { -int perm=0770; -int subdirperm=0770; int argn; const char *deliverymode=0; char *embedded_filter=0; @@ -461,9 +446,6 @@ ++argn; switch (optc) {

- case 'c': - maildrop.auto_create_maildir=1; - break; #if HAVE_COURIER #if RESTRICT_TRUSTED case 'D': @@ -768,79 +750,21 @@ if (deliverymode) { struct stat buf; - Buffer b, m; - + Buffer b;

b=maildrop.init_home; b += '\0'; - m=maildrop.init_default; - m += '\0';

- const char *h=b; - const char *md=m; - const char *fullpath=strcat(strdup(h),strdup(md)); + const char *h=b;

if (VerboseLevel() > 1) merr << "maildrop: Changing to " << h << "\n";

if (chdir(h) < 0) { - merr << "maildrop: Unable to change to home directory."; errexit=EX_TEMPFAIL; throw "Unable to change to home directory."; } - - if (VerboseLevel() > 1) - merr << "maildrop: Changing to " << fullpath << "\n"; - - if ((chdir(fullpath) < 0) && (maildrop.auto_create_maildir)) - { - - umask(0); - if (VerboseLevel() > 1) - merr << "maildrop: Fullpath " << fullpath << "\n"; - if (mkdir(fullpath, perm) < 0) - { - merr << "maildrop: Unable to autocreate maildir directory.\n"; - errexit=EX_TEMPFAIL; - throw "maildrop: Unable to autocreate maildir directory.\n"; - } - if (chdir(fullpath) < 0) - { - merr << "maildrop: Unable to access newly created maildir directory. Permissions?\n"; - errexit=EX_TEMPFAIL; - throw "maildrop: Unable to access newly created maildir directory. Permissions\n"; - } - if (mkdir("tmp", subdirperm) < 0 || chmod("tmp", subdirperm) < 0) - { - merr << "maildrop: Unable to autocreate maildir tmp directory.\n"; - errexit=EX_TEMPFAIL; - throw "maildrop: Unable to autocreate maildir tmp directory.\n"; - } - if (mkdir("new", subdirperm) < 0 || chmod("new", subdirperm) < 0) - { - merr << "maildrop: Unable to autocreate maildir new directory.\n"; - errexit=EX_TEMPFAIL; - throw "maildrop: Unable to autocreate maildir new directory.\n"; - } - if (mkdir("cur", subdirperm) < 0 || chmod("cur", subdirperm) < 0 ) - { - merr << "maildrop: Unable to autocreate maildir cur directory."; - errexit=EX_TEMPFAIL; - throw "maildrop: Unable to autocreate maildir cur directory."; - } - if ((const char*) maildrop.init_quota != "") - { - if (VerboseLevel() > 1) - merr << "maildrop: Setting Maildir quota to: " << maildrop.init_quota << "\n"; - maildir_quota_set(fullpath, (const char*) maildrop.init_quota); - } - chdir(h); - } - - if (VerboseLevel() > 1) - merr << "maildrop: Finished with home directory and maildir check\n"; - recipe=".mailfilter";

if ( stat(".", &buf) < 0 || @@ -855,12 +779,8 @@ // Quietly terminate if the sticky bit is set on the homedir

if ( buf.st_mode & S_ISVTX) - { - errexit=EX_TEMPFAIL; - throw "Sticky bit set on home directory."; -// return (EX_TEMPFAIL); - } - + return (EX_TEMPFAIL); + if (embedded_filter) { i=stat(".mailfilters", &buf);