aboutsummaryrefslogtreecommitdiff
path: root/src/bi_db.m4
diff options
context:
space:
mode:
Diffstat (limited to 'src/bi_db.m4')
-rw-r--r--src/bi_db.m415
1 files changed, 8 insertions, 7 deletions
diff --git a/src/bi_db.m4 b/src/bi_db.m4
index bb0b9f48..f366008f 100644
--- a/src/bi_db.m4
+++ b/src/bi_db.m4
@@ -1,8 +1,8 @@
1/* This file is part of mailfromd. -*- c -*- 1/* This file is part of Mailfromd. -*- c -*-
2 Copyright (C) 2006, 2007 Sergey Poznyakoff 2 Copyright (C) 2006, 2007, 2008 Sergey Poznyakoff
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3, or (at your option) 6 the Free Software Foundation; either version 3, or (at your option)
7 any later version. 7 any later version.
8 8
@@ -134,13 +134,13 @@ MF_DEFUN(dbdel, VOID, STRING dbname, STRING keystr, OPTIONAL, NUMBER null)
134 MU_DATUM_SIZE(key)++; 134 MU_DATUM_SIZE(key)++;
135 rc = mu_dbm_delete(&db, key); 135 rc = mu_dbm_delete(&db, key);
136 mu_dbm_close(&db); 136 mu_dbm_close(&db);
137 MF_ASSERT(rc == 0, 137 MF_ASSERT(rc == 0,
138 mf_dbfailure, 138 mf_dbfailure,
139 _("Failed to delete data `%s' from `%s': %s"), 139 _("Failed to delete data `%s' from `%s': %s"),
140 key, 140 keystr,
141 dbname, 141 dbname,
142 mu_dbm_strerror()); 142 mu_dbm_strerror());
143} 143}
144END 144END
145 145
146 146
@@ -235,15 +235,16 @@ MF_DEFUN(greylist, NUMBER, STRING email, NUMBER interval)
235 debug1(20, "greylist record for %s expired", 235 debug1(20, "greylist record for %s expired",
236 email); 236 email);
237 if (!readonly) { 237 if (!readonly) {
238 memcpy(MU_DATUM_PTR(contents), 238 memcpy(MU_DATUM_PTR(contents),
239 &now, sizeof now); 239 &now, sizeof now);
240 if (mu_dbm_insert(&db, key, contents, 1)) 240 if (mu_dbm_insert(&db, key, contents, 1))
241 mu_error(_("Cannot insert datum `%s' in " 241 mu_error(_("Cannot insert datum `%-.*s' in "
242 "greylist database %s: %s"), 242 "greylist database %s: %s"),
243 key, 243 MU_DATUM_SIZE(key),
244 (char*)MU_DATUM_PTR(key),
244 greylist_format->dbname, 245 greylist_format->dbname,
245 mu_dbm_strerror()); 246 mu_dbm_strerror());
246 } else 247 } else
247 debug(20, "database opened in readonly mode: " 248 debug(20, "database opened in readonly mode: "
248 "not updating"); 249 "not updating");
249 rc = 1; 250 rc = 1;
@@ -256,15 +257,15 @@ MF_DEFUN(greylist, NUMBER, STRING email, NUMBER interval)
256 } else if (!readonly) { 257 } else if (!readonly) {
257 debug1(20, "greylisting %s", email); 258 debug1(20, "greylisting %s", email);
258 MF_VAR_REF(greylist_seconds_left, interval); 259 MF_VAR_REF(greylist_seconds_left, interval);
259 MU_DATUM_PTR(contents) = (void*)&now; 260 MU_DATUM_PTR(contents) = (void*)&now;
260 MU_DATUM_SIZE(contents) = sizeof now; 261 MU_DATUM_SIZE(contents) = sizeof now;
261 if (mu_dbm_insert(&db, key, contents, 1)) 262 if (mu_dbm_insert(&db, key, contents, 1))
262 mu_error(_("Cannot insert datum `%s' in greylist " 263 mu_error(_("Cannot insert datum `%-.*s' in greylist "
263 "database %s: %s"), 264 "database %s: %s"),
264 key, 265 MU_DATUM_SIZE(key), (char*)MU_DATUM_PTR(key),
265 greylist_format->dbname, 266 greylist_format->dbname,
266 mu_dbm_strerror()); 267 mu_dbm_strerror());
267 rc = 1; 268 rc = 1;
268 } else 269 } else
269 rc = 0; 270 rc = 0;
270 271

Return to:

Send suggestions and report system problems to the System administrator.