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

esskar
 2003-08-21 20:33
#72243 #72243
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
Code (perl): (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 &#36!;
@badwords = <BADWORDS>;
close(BADWORDS);

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

foreach my &#36msgnr (keys %{&#36phash}) 
{
    my &#36msg = &#36pop3->get(&#36msgnr);
    my &#36next = 0;
    foreach my &#36line (@{ &#36msg }) 
    {
        foreach(@badwords)
        {
            if(&#36line =~ /&#36_/si)
            {
                print "DELETE Mail Nr. &#36msgnr..\n";
                &#36pop3->delete(&#36msgnr);
                &#36next = 1;
                last;
            }
            else {}
        }
        last if &#36next;
    }
}
&#36pop3->quit();

print "Ready..";
\n\n

<!--EDIT|esskar|1061498940-->

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