PacketFence - BTS - PacketFence
View Issue Details
0001662PacketFencecorepublic2013-07-08 07:212013-08-01 08:10
fmts 
fdurand 
normalminoralways
resolvedfixed 
4.0.1 
 
0001662: [Violation] Action "Send email" doesn't get executed if the violation is enabled
I created a violation with following settings:

--

[4000001]
priority=1
trigger=vendormac::2249
actions=autoreg,email,role
desc=Testgeraete
enabled=Y
template=generic
auto_enable=N
whitelisted_categories=isolation,default,guest
target_category=test
vclose=4000001

--

The violation gets executed, but the node only gets the status "registred". The role isn't set and a mail doesn't get sent.

As you can see in the attached log there is a warning about Perl ("insecure dependency") and the pfcmd command returns an error. Maybe it has something to do with it.

If i remove the "email"-Action, the violation works as it should.
Also if i set "enabled=N" and trigger it manually it works fine. Even with the "email"-action.
System: Debian Wheezy (up to date)
Repo: deb http://inverse.ca/downloads/PacketFence/debian-stable [^] wheezy wheezy
No tags attached.
txt violation.txt (4,004) 2013-07-08 07:21
https://www.packetfence.org/bugs/file_download.php?file_id=179&type=bug
Issue History
2013-07-08 07:21fmtsNew Issue
2013-07-08 07:21fmtsFile Added: violation.txt
2013-07-31 20:01fdurandNote Added: 0003355
2013-08-01 07:12fmtsNote Added: 0003363
2013-08-01 08:10fdurandNote Added: 0003364
2013-08-01 08:10fdurandStatusnew => resolved
2013-08-01 08:10fdurandResolutionopen => fixed
2013-08-01 08:10fdurandAssigned To => fdurand

Notes
(0003355)
fdurand   
2013-07-31 20:01   
Hello,
can you edit action.pm and comment the line pfmailer(%message);
You will not receive an email but it's just to see if if will have the "Insecure dependency in connect while running with -T switch at /usr/lib/perl/5.14/IO/Socket.pm line 114." error.
If it works (if the role is set) it mean that it's the pfmailer function the problem so edit the file util.pm and in the pfmailer sub use the untaint_chain on somes variables like:

my $smtpserver = untaint_chain($Config{'alerting'}{'smtpserver'});
....

Regards
Fabrice
(0003363)
fmts   
2013-08-01 07:12   
Hi Fabrice,

As you said, it's a pfmailer issue. With your "untaint_chain"-line it works like a charm.

Thanks,
Florian
(0003364)
fdurand   
2013-08-01 08:10   
Ok thanks, it has been fixed in devel.

Fabrice