aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-05-04 06:30:49 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-05-04 06:30:49 +0000
commit668377d11b47ce5b0b165dcca72bbff90a066f04 (patch)
tree013a3d0a29628ab0d5bf5e543eec320bdeecbe37
parent5663888746b3b5e15ab795a1e2bfaae7b2cf768a (diff)
downloadmailfromd-668377d11b47ce5b0b165dcca72bbff90a066f04.tar.gz
mailfromd-668377d11b47ce5b0b165dcca72bbff90a066f04.tar.bz2
Fixes
git-svn-id: file:///svnroot/mailfromd/trunk@1406 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r--ChangeLog7
-rw-r--r--doc/mailfromd.texi25
-rw-r--r--etc/Makefile.am2
-rw-r--r--src/gram.y3
-rw-r--r--src/main.c3
5 files changed, 25 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 74ac2830..1d3b74a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2007-05-04 Sergey Poznyakoff <gray@gnu.org.ua>
+ * src/gram.y (convert_rate): Bugfix.
+ * src/main.c: --predict implies --format=rate --list
+ Update copyright years
+ * doc/mailfromd.texi: Update
+ * etc/Makefile.am (.in.mailfromd): Set executable bit on the
+ target.
+
* src/mu_dbm.c [WITH_BDB] (mu_dbm_open): install errcall fn if
debug level >= 1
* src/engine.c (save_cmdline,sig_restart): New function
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi
index ffd1495c..553c3498 100644
--- a/doc/mailfromd.texi
+++ b/doc/mailfromd.texi
@@ -2321,11 +2321,11 @@ database is the prediction of @dfn{estimated time of sending},
i.e. the time when the user will be able to send mail if currently his
mail sending rate has exceeded the limit. This is done using
@option{--predict} option. The option takes an argument, specifying
-the mail sending rate limit, e.g.:
+the mail sending rate limit, e.g. (the second line is split for readability):
@smallexample
@group
-$ @kbd{mailfromd --list --format=rate --predict="180 per 1 minute"}
+$ @kbd{mailfromd --predict="180 per 1 minute"}
ed@@fae.net-21.10.1.2 Wed Sep 13 03:53:40 2006 0 1 N/A N/A; free to send
service@@19.netlay.com-69.44.129.19 Wed Sep 13 15:46:07 2006 7 2
0.286 0.0224; in 46 sec. on Wed Sep 13 15:49:00 2006
@@ -2333,7 +2333,8 @@ service@@19.netlay.com-69.44.129.19 Wed Sep 13 15:46:07 2006 7 2
@end smallexample
@noindent
-(the second line is split for readability)
+Notice, that there is no need to use @option{--list --format=rate}
+along with this option, although doing so is not an error.
@anchor{deleting from databases}
@xopindex{delete, introduced}
@@ -2371,15 +2372,15 @@ database.
@xopindex{compact, introduced}
This is done by running @kbd{mailfromd --compact} (and, optionally,
specifying the database to operate upon with @option{--format}
-option. Notice, that compacting a database needs roughly as
+option). Notice, that compacting a database needs roughly as
much disk space on the partition where the database resides as the
-database currently occupies. The simultaneous access prevention while
-compacting the database depends on the underlying @acronym{DBM}
-implementation. In general, it is locked, so the running copy
-of @command{mailfromd} is not able to write to it, but still can read
-the data from it. @FIXME{However, I need to verify the BerkeleyDB
-case, just to be sure. Although I have never experienced any problems
-while compacting BDBs.}
+database currently occupies. Database compaction runs in three phases.
+First, the database is scanned and all non-expired records are stored
+in the memory. Secondly, a temporary database is created in the state
+directory and all the cached entries are flushed into it. This
+database is named after the @acronym{PID} of the running
+@command{mailfromd} process. Finally, the temporary database is
+renamed to the source database.
@anchor{compact cronjob}
@xopindex{all, introduced}
@@ -9189,7 +9190,7 @@ are advised to use instead (@pxref{pragma pidfile}).
@item --predict=@var{rate-limit}
Used with @option{--list} enables printing of the estimated times of
sending along with the @samp{rate} database dump. Implies
-@option{--format=rate}. @xref{estimated time of sending}.
+@option{--list --format=rate}. @xref{estimated time of sending}.
@opsummary{relayed-domain-file}
@item --relayed-domain-file=@var{file}
diff --git a/etc/Makefile.am b/etc/Makefile.am
index 0c887035..31013cc6 100644
--- a/etc/Makefile.am
+++ b/etc/Makefile.am
@@ -24,7 +24,7 @@ CLEANFILES = rc.mailfromd
.in.mailfromd:
f=$(sbindir)/`echo "mailfromd" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- sed "s,<DEFAULT_PIDFILE>,$(DEFAULT_PIDFILE),;s,<DEFAULT_DAEMON>,$$f," $< > $@
+ sed "s,<DEFAULT_PIDFILE>,$(DEFAULT_PIDFILE),;s,<DEFAULT_DAEMON>,$$f," $< > $@ && chmod +x $@
install-data-local:
@test -z "$(sysconfdir)" || $(mkdir_p) "$(DESTDIR)$(sysconfdir)"
diff --git a/src/gram.y b/src/gram.y
index a4d6e28c..bacc586a 100644
--- a/src/gram.y
+++ b/src/gram.y
@@ -2976,7 +2976,8 @@ convert_rate(const char *arg, double *rate)
while (*p && isspace(*p))
p++;
if (isalpha(*p)) {
- if (strcmp(p, "per") == 0 && isspace(p[3]))
+ if (strlen(p) > 3
+ && memcmp(p, "per", 3) == 0 && isspace(p[3]))
p += 3;
} else if (ispunct(*p))
p++;
diff --git a/src/main.c b/src/main.c
index a954770a..f3e11e93 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1059,6 +1059,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
break;
case OPTION_PREDICT_NEXT:
+ format_option = db_format_lookup("rate");
if (convert_rate(arg, &predict_rate) == 0)
predict_next_option = 1;
mode = MAILFROMD_LIST;
@@ -1433,7 +1434,7 @@ switch_to_privs(uid_t uid, gid_t gid)
static char *license =
" This is mailfromd filter.\n"
- " Copyright (C) 2005, 2006 Sergey Poznyakoff\n"
+ " Copyright (C) 2005, 2006, 2007 Sergey Poznyakoff\n"
"\n"
" ls is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"

Return to:

Send suggestions and report system problems to the System administrator.