Ticket #5 (closed enhancement: fixed)

Opened 11 years ago

Last modified 10 years ago

Let emails pass when Greyfix dies

Reported by: kmkaplan Owned by: kmkaplan
Priority: major Version:
Keywords: Cc:

Description

When Greyfix detects a problem it should let emails pass (action=DUNNO) instead of dying.

Change History

Changed 11 years ago by kmkaplan

  • owner set to kmkaplan
  • status changed from new to assigned

Tentative patch (awaiting feedback)

diff -rN -u old-greyfix/greyfix.c new-greyfix/greyfix.c
--- old-greyfix/greyfix.c	2008-01-02 12:32:19.000000000 +0000
+++ new-greyfix/greyfix.c	2008-01-02 12:32:19.000000000 +0000
@@ -493,13 +493,14 @@
     }
 }
 
-static void
+static int
 put_grey_data()
 {
     int rc;
     rc = db->put(db, NULL, &dbkey, &dbdata, 0);
     if (rc)
 	log_db_error("put", rc);
+    return rc;
 }
 
 static void
@@ -542,7 +543,7 @@
     }
 }
 
-static void
+static int
 process_smtp_rcpt()
 {
     double delay;
@@ -553,7 +554,7 @@
 	}
 	else
 	    puts(STR_ACTION "WARN " PACKAGE_STRING " is not working properly");
-	return;
+	return 1;
     }
     get_grey_data();
     delay = difftime(triplet_data.access_time, triplet_data.create_time);
@@ -571,7 +572,7 @@
 	printf_action(greylisted_action_fmt, delay);
 	putchar('\n');
     }
-    put_grey_data();
+    return put_grey_data();
 }
 
 static void
@@ -816,7 +817,12 @@
 	    && (from = find_attribute("sender"))
 	    && (to = find_attribute("recipient"))) {
 	    build_triplet_key(ip, from, to);
-	    process_smtp_rcpt();
+	    if (process_smtp_rcpt()) {
+	      syslog(LOG_ERR, "error: cleaning up");
+	      cleanup();
+	      syslog(LOG_ERR, "error: exiting after cleanup");
+	      return 1;
+	    }
 	}
 	else {
 	    puts(STR_ACTION "DUNNO");

Changed 11 years ago by kmkaplan

  • status changed from assigned to closed
  • resolution set to fixed

Fix in 0.3.8.

Note: See TracTickets for help on using tickets.