Documentation update + little bugfix

This commit is contained in:
tonio
2009-11-04 18:05:45 +01:00
parent 8521a75a05
commit 363869a8c1
2 changed files with 8 additions and 10 deletions
+5 -7
View File
@@ -335,14 +335,14 @@ Then, you need to specify where is the database that contains the
quarantine. Inside settings.py, add a new connection to the
DB_CONNECTIONS variable like this::
DB_CONNECTIONS = (
{"amavis_quarantine" : {"driver" : "mysql",
DB_CONNECTIONS = {
"amavis_quarantine" : {"driver" : "mysql",
"host" : "<your_host>",
"dbname" : "<amavis_dbname>",
"login" : "<user>",
"password" : "<password>"}
}
)
}
Replace values between <> with yours.
@@ -455,9 +455,7 @@ To finish, you need to collect information periodically in order to
feed rrd files. To do so, just add the following lines into root's
crontab::
*/5 * * * * PYTHONPATH=<mailng_dir/..> \
DJANGO_SETTINGS_MODULE=mailng.settings \
<mailng_dir>/extensions/stats/logparser.py
*/5 * * * * PYTHONPATH=<mailng_dir/..> DJANGO_SETTINGS_MODULE=mailng.settings <mailng_dir>/extensions/stats/logparser.py
Replace mailng_dir with the installation path of MailNG.
+3 -3
View File
@@ -7,14 +7,14 @@ from django.conf import settings
if __name__ == "__main__":
conn = db.getconnection("amavis_quarantine")
try:
max_msg_days = getattr(settings, "MAX_MESSAGES_AGE")
max_messages_age = getattr(settings, "MAX_MESSAGES_AGE")
except AttributeError:
max_messages_age = 14
print "Deleting messages older than %d days..." % max_msg_days
print "Deleting messages older than %d days..." % max_messages_age
db.execute(conn, """
DELETE FROM msgs WHERE time_num < UNIX_TIMESTAMP()-%d*24*3600;
""" % max_msg_days)
""" % max_messages_age)
print "Deleting unreferenced e-mail addresses..."
db.execute(conn, """