summaryrefslogtreecommitdiffstats
path: root/lib/exilog_parse.pm
diff options
context:
space:
mode:
authorgrin@grin.hu <grin@grin.hu>2013-10-10 10:23:01 +0200
committerAndreas Unterkircher <unki@netshadow.at>2013-10-12 06:03:59 +0200
commit5c3848d4a7a512e19a4d3d3346c3f728cdc4532b (patch)
tree93222094204e27460bb4be8f52ef13428fc6c7fa /lib/exilog_parse.pm
parentd1477c29356188ce9bf9900020b4b0e3bfff2a0f (diff)
downloadexilog-5c3848d4a7a512e19a4d3d3346c3f728cdc4532b.zip
exilog-5c3848d4a7a512e19a4d3d3346c3f728cdc4532b.tar.gz
exilog-5c3848d4a7a512e19a4d3d3346c3f728cdc4532b.tar.bz2
Update parser to handle TLS data and subject. Fix syntactic sugar in agent.
Diffstat (limited to 'lib/exilog_parse.pm')
-rw-r--r--lib/exilog_parse.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/exilog_parse.pm b/lib/exilog_parse.pm
index f1d49df..93e0e3c 100644
--- a/lib/exilog_parse.pm
+++ b/lib/exilog_parse.pm
@@ -76,7 +76,7 @@ sub _parse_delivery {
# When +sender_on_delivery is set, cut away the F=<> part
- $subj =~ s/[PF]\=[^ ]+ //;
+ $subj =~ s/[PF]\=[^ :]+([ :])/$1/;
m/()/;
@@ -98,6 +98,16 @@ sub _parse_delivery {
$h->{rcpt} = $h->{rcpt_final};
};
+ # Catch TLS DN first because it may contain C= ST= L= patterns (we don't use it)
+ m/()/;
+ $subj =~ s/DN="[^"]*" //;
+ $h->{dn} = $1 if ($1);
+
+ # Catch subject lines
+ m/()/;
+ $subj =~ s/T="[^"]*" //;
+ $h->{subject} = $1 if ($1);
+
m/()/;
$subj =~ s/R\=([^ \:]+)//;
$h->{router} = $1 if ($1);