]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Add a "DebugLeaveTmp" config which makes faxmail leave it's temporary files around
authorAidan Van Dyk <aidan@ifax.com>
Tue, 23 Oct 2007 13:58:19 +0000 (13:58 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Tue, 23 Oct 2007 13:58:19 +0000 (13:58 +0000)
faxmail/faxmail.c++

index 178d6de438e9ccdc168b406dc0a0e397e83ef2d8..7d7658ac5f006eab2bc09f4b0f885f5a11cedff2 100644 (file)
@@ -69,6 +69,7 @@ private:
     bool       markDiscarded;          // mark MIME parts not handled
     bool       withinFile;             // between beginFile() & endFile()
     bool       empty;                  // No acutall formated output
+    bool       debugLeaveTmp;          // Leave tmp files alone for debuging
     fxStr      mimeConverters;         // pathname to MIME converter scripts
     fxStr      mailProlog;             // site-specific prologue definitions
     fxStr      clientProlog;           // client-specific prologue info
@@ -134,9 +135,12 @@ faxMailApp::faxMailApp()
 faxMailApp::~faxMailApp()
 {
     delete client;
-    for (u_int i = 0, n = tmps.length(); i < n; i++)
-       Sys::unlink(tmps[i]);
-    Sys::rmdir(tmpDir);
+    if (debugLeaveTmp)
+    {
+       for (u_int i = 0, n = tmps.length(); i < n; i++)
+           Sys::unlink(tmps[i]);
+       Sys::rmdir(tmpDir);
+    }
 }
 
 void
@@ -775,6 +779,7 @@ faxMailApp::setupConfig()
     markDiscarded = true;
     mimeConverters = FAX_LIBEXEC "/faxmail";
     mailProlog = FAX_LIBDATA "/faxmail.ps";
+    debugLeaveTmp = false;
     msgDivider = "";
     pageSize = "";
     mailUser = "";                     // default to real uid
@@ -822,6 +827,8 @@ faxMailApp::setConfigItem(const char* tag, const char* value)
        msgDivider = value;
     else if (streq(tag, "mailuser"))
        mailUser = value;
+    else if (streq(tag, "debugleavetmp"))
+       debugLeaveTmp = getBoolean(value);
     else if (MsgFmt::setConfigItem(tag, value))
        ;
     else if (TextFormat::setConfigItem(tag, value))