summaryrefslogtreecommitdiff
path: root/popimapunit.pas
diff options
context:
space:
mode:
Diffstat (limited to 'popimapunit.pas')
-rw-r--r--popimapunit.pas37
1 files changed, 37 insertions, 0 deletions
diff --git a/popimapunit.pas b/popimapunit.pas
index 8d841b1..595eef6 100644
--- a/popimapunit.pas
+++ b/popimapunit.pas
@@ -12,14 +12,18 @@ type
tMarkenValiditaet = (mvKeine,mvGueltig,mvUngueltig);
tBefehlAusfuehrenErgebnis = (baeOk,baeError,baeTimeOut);
tMailProtocol = (mpPop, mpImap);
+ tSpamLevel = (slSpam,slHam,slUnbekannt);
tPopImapClient = class;
tNachricht = class(tMyStringList)
private
_marke: tMarkenValiditaet;
+ _spam: tSpamLevel;
procedure pruefeMarke;
+ procedure pruefeSpam;
function rMarke: tMarkenValiditaet;
+ function rSpam: tSpamLevel;
public
id,groesze: longint;
sdbName,gueltigerAdressat: string;
@@ -29,6 +33,8 @@ type
function istGleich(n: tNachricht): boolean;
property marke: tMarkenValiditaet
read rMarke;
+ property spam: tSpamLevel
+ read rSpam;
end;
tPopImapThread = class(tThread)
@@ -76,6 +82,7 @@ type
function von(n: longint): string;
function zeit(n: longint): string;
function marke(n: longint): tMarkenValiditaet;
+ function spam(n: longint): tSpamLevel;
procedure threadAnhalten;
procedure aufThreadWarten;
procedure loesche(n: longint);
@@ -295,12 +302,37 @@ begin
closeFile(f);
end;
+procedure tNachricht.pruefeSpam;
+var
+ s: string;
+begin
+ s:=grepFirst('^[Xx]-Spam-Status:\s');
+ if s='' then begin
+ _spam:=slUnbekannt;
+ exit;
+ end;
+
+ if _spam<>slUnbekannt then
+ exit;
+ erstesArgument(s,':');
+ if erstesArgument(s,',')='No' then
+ _spam:=slHam
+ else
+ _spam:=slSpam;
+end;
+
function tNachricht.rMarke: tMarkenValiditaet;
begin
pruefeMarke;
result:=_marke;
end;
+function tNachricht.rSpam: tSpamLevel;
+begin
+ pruefeSpam;
+ result:=_spam;
+end;
+
procedure tNachricht.kopiereVon(n: tNachricht);
begin
text:=n.text;
@@ -796,6 +828,11 @@ begin
result:=_nachrichten[n].marke;
end;
+function tPopImapClient.spam(n: longint): tSpamLevel;
+begin
+ result:=_nachrichten[n].spam;
+end;
+
procedure tPopImapClient.threadAnhalten;
begin
_thread.beenden:=true;