Thread Spam abfangen..: ...funktioniert nicht so ganz.. (6 answers)
Opened by steinwolf at 2003-08-21 19:07

steinwolf
 2003-08-21 19:07
#72238 #72238
User since
2003-08-04
367 Artikel
BenutzerIn
[default_avatar]
Hi,
erstmal der Code:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use Net::Pop3;

open(BADWORDS, "E:/Dokumente/Windows_Scripting/badwords.txt") || die $!;
while(<BADWORDS>)
{
push @badwords, $_;
}
close(BADWORDS);

print "Try login..\n";
my $pop3 = Net::POP3->new('pop.gmx.net', Timeout => 60);
$pop3->login('blablubb@gmx.de', 'passwort');
print "Logged in..\n";
print "Check Mails..\n";
my $phash = $pop3->list();

foreach my $msgnr (keys %{$phash})
{
my $msg = $pop3->get($msgnr);
foreach my $line (@{ $msg })
{
foreach(@badwords)
{

if($line =~/$_/si)
{
print "DELETE Mail Nr. $msgnr..\n";
$pop3->delete($msgnr);
}
else {}
}
}
}
$pop3->quit();

print "Ready..";


sooo..der code ist syntaktisch soweit ich weiß korrekt..
allerdings scheint was mit dem regulären Ausdruck nicht zu stimmen..
in meiner liste badwords.txt steht zum beispiel das wort "fetish", steht in einer mail jedoch "http://super-fuck-fetischblablubb/" wird das wort nicht erkannt..

mfg
steinwolf
"Did you know? You can use your old motor oil to fertilize your lawn." - Blinkster - Professionelles EDV Forum

View full thread Spam abfangen..: ...funktioniert nicht so ganz..