Mails quarantined with message “caused MailScanner to crash several times”

Mails are being quarantined by MailScanner without reason. The maillog shows messages like this;
Quarantined message 99AA4E0D5B.A6658 as it caused MailScanner to crash several times

When running mailscanner --debug it shows this;

In Debugging mode, not forking...
Trying to setlogsock(unix)
Building a message batch to scan...
Have a batch of 30 messages.
Insecure dependency in open while running with -T switch at /usr/lib64/perl5/IO/File.pm line 185.

This seems to be a problem with recent Perl versions. There is a “dirty” workaround; edit /usr/sbin/MailScanner and add -U at the first line;
!/usr/bin/perl -I/usr/lib/MailScanner -U