|
@@ -11,7 +11,7 @@ MAILBOT="/usr/bin/mailbot"
|
|
SIGNUPRESP="/opt/cropswap/signup.eml"
|
|
SIGNUPRESP="/opt/cropswap/signup.eml"
|
|
SUBSCRIBERESP="/opt/cropswap/subunsub.eml"
|
|
SUBSCRIBERESP="/opt/cropswap/subunsub.eml"
|
|
FILTERDIR="/opt/cropswap/filters"
|
|
FILTERDIR="/opt/cropswap/filters"
|
|
-DEBUG=0
|
|
|
|
|
|
+DEBUG=1
|
|
if ($DEBUG)
|
|
if ($DEBUG)
|
|
{
|
|
{
|
|
MAILBOT="/opt/cropswap/debug.sh"
|
|
MAILBOT="/opt/cropswap/debug.sh"
|
|
@@ -45,7 +45,7 @@ FATAL=1
|
|
|
|
|
|
STAGE="/var/mail/maildrop/stage"
|
|
STAGE="/var/mail/maildrop/stage"
|
|
flock $STAGE {
|
|
flock $STAGE {
|
|
- if (gdbmopen($STAGE, "C"))
|
|
|
|
|
|
+ if (gdbmopen($STAGE, "W") != 0)
|
|
{
|
|
{
|
|
cc "|$DEBUGMAIL init-stages-fail"
|
|
cc "|$DEBUGMAIL init-stages-fail"
|
|
EXITCODE=$FATAL
|
|
EXITCODE=$FATAL
|
|
@@ -55,8 +55,19 @@ flock $STAGE {
|
|
gdbmstore("TOMEMBER", "NO")
|
|
gdbmstore("TOMEMBER", "NO")
|
|
gdbmstore("TOORGANIZER", "NO")
|
|
gdbmstore("TOORGANIZER", "NO")
|
|
gdbmstore("TOPOSTMASTER", "NO")
|
|
gdbmstore("TOPOSTMASTER", "NO")
|
|
- gdbmstore("MAILGROUP", "")
|
|
|
|
|
|
+ gdbmstore("MAILGROUP", "NONE")
|
|
|
|
+ cc "|$DEBUGMAIL 'init variables pre fetch'"
|
|
|
|
+ if (gdbmstore("TOALIAS", "NONE") !=0)
|
|
|
|
+{
|
|
|
|
+
|
|
|
|
+ cc "|$DEBUGMAIL 'init variables fail write'"
|
|
|
|
+EXITCODE=$FATAL
|
|
|
|
+exit
|
|
|
|
+}
|
|
|
|
+ gdbmstore("SUBJECT", "")
|
|
CONTINUE=(gdbmfetch("CONTINUE") eq "YES")
|
|
CONTINUE=(gdbmfetch("CONTINUE") eq "YES")
|
|
|
|
+ TOALIAS=gdbmfetch("TOALIAS")
|
|
|
|
+ cc "|$DEBUGMAIL 'init variables'"
|
|
gdbmclose
|
|
gdbmclose
|
|
}
|
|
}
|
|
|
|
|
|
@@ -65,7 +76,7 @@ foreach /^(To|Cc):.*/
|
|
ADDR=getaddr($MATCH)
|
|
ADDR=getaddr($MATCH)
|
|
foreach (tolower $ADDR) =~ /^$HANDLEDREGEX$/
|
|
foreach (tolower $ADDR) =~ /^$HANDLEDREGEX$/
|
|
{
|
|
{
|
|
- cc "|$DEBUGMAIL include match $MATCH"
|
|
|
|
|
|
+ cc "|$DEBUGMAIL 'include match $MATCH'"
|
|
include "$FILTERDIR/$MATCH"
|
|
include "$FILTERDIR/$MATCH"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -82,7 +93,9 @@ TOMEMBER=(gdbmfetch("TOMEMBER") eq "YES")
|
|
TOORGANIZER=(gdbmfetch("TOORGANIZER") eq "YES")
|
|
TOORGANIZER=(gdbmfetch("TOORGANIZER") eq "YES")
|
|
MAILGROUP=gdbmfetch("MAILGROUP")
|
|
MAILGROUP=gdbmfetch("MAILGROUP")
|
|
SUBJECT=gdbmfetch("SUBJECT")
|
|
SUBJECT=gdbmfetch("SUBJECT")
|
|
|
|
+ cc "|$DEBUGMAIL 'post variables pre fetch'"
|
|
TOALIAS=gdbmfetch("TOALIAS")
|
|
TOALIAS=gdbmfetch("TOALIAS")
|
|
|
|
+ cc "|$DEBUGMAIL 'post variables post fetch'"
|
|
gdbmclose
|
|
gdbmclose
|
|
|
|
|
|
if (!$CONTINUE)
|
|
if (!$CONTINUE)
|
|
@@ -162,6 +175,7 @@ if (!$FORWARD)
|
|
# SUBSCRIBED USERS
|
|
# SUBSCRIBED USERS
|
|
#
|
|
#
|
|
NOFORWARD=$FROM
|
|
NOFORWARD=$FROM
|
|
|
|
+cc "|$DEBUGMAIL forwarding"
|
|
include "$FILTERDIR/$MAILGROUP"
|
|
include "$FILTERDIR/$MAILGROUP"
|
|
|
|
|
|
cc "|$DEBUGMAIL unhandled"
|
|
cc "|$DEBUGMAIL unhandled"
|