improved parsing of subscription log files
This commit is contained in:
parent
69f270bd54
commit
7e208f7c1a
9
TODO
9
TODO
|
@ -1,7 +1,3 @@
|
||||||
add translators to "contribute"
|
|
||||||
|
|
||||||
check the content of the Log file for automatic subscription
|
|
||||||
|
|
||||||
Infos fuer Massen-Hosting:
|
Infos fuer Massen-Hosting:
|
||||||
http://www.fbis.ch/index-de.php?page=14&frameset=4
|
http://www.fbis.ch/index-de.php?page=14&frameset=4
|
||||||
|
|
||||||
|
@ -9,3 +5,8 @@ add "only for plain text mails" to the TrailerText string
|
||||||
|
|
||||||
check version history of Mail::Ezmlm
|
check version history of Mail::Ezmlm
|
||||||
|
|
||||||
|
main page title should be a link to the domain/list selection
|
||||||
|
-> text configurable?
|
||||||
|
|
||||||
|
listname (incl. domain name) below the main title?
|
||||||
|
|
||||||
|
|
|
@ -1304,7 +1304,8 @@ sub set_pagedata_subscription_log {
|
||||||
|
|
||||||
my ($listname) = @_;
|
my ($listname) = @_;
|
||||||
|
|
||||||
my ($log_file, @event, $i, $datetext, $epoch_seconds, $note, $address);
|
my ($log_file, $i, $line);
|
||||||
|
my ($datetext, $epoch_seconds, $action, $action_details, $address);
|
||||||
$log_file = "$LIST_DIR/" . $q->param('list') . "/Log";
|
$log_file = "$LIST_DIR/" . $q->param('list') . "/Log";
|
||||||
|
|
||||||
# break if there is no log_file
|
# break if there is no log_file
|
||||||
|
@ -1319,18 +1320,22 @@ sub set_pagedata_subscription_log {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while (<LOG_FILE>) {
|
while (<LOG_FILE>) {
|
||||||
chomp;
|
chomp;
|
||||||
@event = split;
|
$line = $_;
|
||||||
if ($#event eq 2) {
|
# a line of the log file could look like the following:
|
||||||
$epoch_seconds = $event[0];
|
# 748392136 +manual foo@bar.org Foo Bar <foo@bar.org>
|
||||||
|
$line =~ m/^(\d+) ([+-])(\w*) ([^ ]*) ?(.*)$/;
|
||||||
|
if (defined($5)) {
|
||||||
|
$epoch_seconds = $1;
|
||||||
|
$action = $2;
|
||||||
|
$action_details = $3;
|
||||||
|
$address = $5 ? $5 : $4;
|
||||||
$datetext = localtime($epoch_seconds);
|
$datetext = localtime($epoch_seconds);
|
||||||
$note = $event[1];
|
|
||||||
$address = $event[2];
|
|
||||||
# the date in gmt format - this should be sufficient
|
# the date in gmt format - this should be sufficient
|
||||||
$pagedata->setValue("Data.List.SubscribeLog.$i.date", $datetext);
|
$pagedata->setValue("Data.List.SubscribeLog.$i.date", $datetext);
|
||||||
# the first letter of 'note' should be +/-
|
# the the action should be +/-
|
||||||
$pagedata->setValue("Data.List.SubscribeLog.$i.action", substr($note,0,1));
|
$pagedata->setValue("Data.List.SubscribeLog.$i.action", $action);
|
||||||
# manual/auto/mod - TODO: verify "auto"
|
# manual/auto/mod/probe - TODO: verify "auto"
|
||||||
$pagedata->setValue("Data.List.SubscribeLog.$i.details", substr($note,1));
|
$pagedata->setValue("Data.List.SubscribeLog.$i.details", $action_details);
|
||||||
$pagedata->setValue("Data.List.SubscribeLog.$i.address", $address);
|
$pagedata->setValue("Data.List.SubscribeLog.$i.address", $address);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -290,6 +290,7 @@ Lang {
|
||||||
add = added
|
add = added
|
||||||
mod = moderated
|
mod = moderated
|
||||||
manual = manual
|
manual = manual
|
||||||
|
probe = delivery failed
|
||||||
auto = automatical
|
auto = automatical
|
||||||
unknown = unknown
|
unknown = unknown
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
var:html_escape(Lang.Misc.SubscribeActions.manual) ?><?cs
|
var:html_escape(Lang.Misc.SubscribeActions.manual) ?><?cs
|
||||||
elif:Data.List.SubscribeLog[x].details == 'mod' ?><?cs
|
elif:Data.List.SubscribeLog[x].details == 'mod' ?><?cs
|
||||||
var:html_escape(Lang.Misc.SubscribeActions.mod) ?><?cs
|
var:html_escape(Lang.Misc.SubscribeActions.mod) ?><?cs
|
||||||
|
elif:Data.List.SubscribeLog[x].details == 'probe' ?><?cs
|
||||||
|
var:html_escape(Lang.Misc.SubscribeActions.probe) ?><?cs
|
||||||
elif:Data.List.SubscribeLog[x].details == '' ?><?cs
|
elif:Data.List.SubscribeLog[x].details == '' ?><?cs
|
||||||
var:html_escape(Lang.Misc.SubscribeActions.auto) ?><?cs
|
var:html_escape(Lang.Misc.SubscribeActions.auto) ?><?cs
|
||||||
else ?><?cs var:html_escape(Lang.Misc.SubscribeActions.unknown)
|
else ?><?cs var:html_escape(Lang.Misc.SubscribeActions.unknown)
|
||||||
|
|
Loading…
Reference in a new issue