Autor Beitrag
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Sa 25.09.04 14:43 
Hallo,
ich möchte eine Maildatei von Linux parsen. Das Programmtechnische ist dabei gar nicht das Problem! Aber ich finde kein Merkmal um zu erkennen, wo eine Mail endet und eine andere beginnt. Das ganze wird für einen POP3 Server benötigt. Kann mir da jemand helfen?

Danke schonmal,
maxk

Hier noch der Inhalt der Maildatei:
ausblenden volle Höhe /var/mail/maxk
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:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
From maxk@TestServer  Sat Sep 25 15:35:34 2004
Return-Path: <maxk@TestServer>
Received: from Max1 (Max1 [192.168.0.9])
  by TestServer (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) with ESMTP id i8PDZYQ01264
  for <maxk@TestServer>; Sat, 25 Sep 2004 15:35:34 +0200
Message-ID: <00b701c4a304$c09407e0$09c8a8c0@Max1>
From: "Max Kanzler" <maxk@TestServer>
To: <maxk@TestServer>
Subject: Test A
Date: Sat, 25 Sep 2004 15:37:07 +0200
MIME-Version: 1.0
Content-Type: multipart/alternative;
  boundary="----=_NextPart_000_00B4_01C4A315.8405CD70"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180

This is a multi-part message in MIME format.

------=_NextPart_000_00B4_01C4A315.8405CD70
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Das ist der erste Test!

------=_NextPart_000_00B4_01C4A315.8405CD70
Content-Type: text/html;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2180" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<P>Das ist der erste Test!</P></FONT></DIV></BODY></HTML>

------=_NextPart_000_00B4_01C4A315.8405CD70--

From maxk@TestServer  Sat Sep 25 15:35:55 2004
Return-Path: <maxk@TestServer>
Received: from Max1 (Max1 [192.168.0.9])
  by TestServer (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) with ESMTP id i8PDZtQ01268
  for <maxk@TestServer>; Sat, 25 Sep 2004 15:35:55 +0200
Message-ID: <00be01c4a304$cd1245e0$09c8a8c0@Max1>
From: "Max Kanzler" <maxk@TestServer>
To: <maxk@TestServer>
Subject: Test B
Date: Sat, 25 Sep 2004 15:37:28 +0200
MIME-Version: 1.0
Content-Type: multipart/alternative;
  boundary="----=_NextPart_000_00BB_01C4A315.9088C660"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180

This is a multi-part message in MIME format.

------=_NextPart_000_00BB_01C4A315.9088C660
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Und das ist der Zweite!
------=_NextPart_000_00BB_01C4A315.9088C660
Content-Type: text/html;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2180" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Und das ist der =
Zweite!</FONT></DIV></BODY></HTML>

------=_NextPart_000_00BB_01C4A315.9088C660--

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Di 28.09.04 12:26 
Hallo!

Warum nimmst du nicht die idPop3-Komponente? Die bröselt dir doch die Mails dann in ihre Bestandteile auf.

Cu,
Udontknow
maxk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Di 28.09.04 15:40 
Das geht ? Wie kann ich denn den Text der Mails in die Komponente laden? imo, kann man damit doch nur vom Server laden - oder irr ich mich :gruebel: Eigentlich wollte ich das auch ohne Zusatzkomponenten schreiben (wird ne Plugin-DLL).

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Di 28.09.04 15:50 
Äh... Also irgendwie ... hast du recht. :nut:

Aber was ich meinte: Versuche doch, den Indy-Mechanismus zu benutzen. Schau mal, ob die Klasse TIDMessage vielleicht irgendeine Funktionalität bietet, vielleicht geht´s einfach per LoadFromStream/LoadFromFile.
midan23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 48

Win XP, Mac OS X, Linux
D6 Pers, XCode 2.1, Python
BeitragVerfasst: Di 28.09.04 19:07 
Vieleicht könnte folgendes helfen :
Zitat:

. unix This is the traditional UNIX mailbox format, in use for nearly
30 years. It uses a line starting with "From " to indicate
start of message, and stores the message status inside the
RFC822 message header.

unix is not particularly efficient; the entire mailbox file
must be read when the mailbox is open, and when reading message
texts it is necessary to convert the newline convention to
Internet standard CR LF form. unix preserves UIDs, and allows
the creation of keywords.

Only one process may have a unix-format mailbox open
read/write at a time.


Hier auch noch was auf deutsch : www.informatik.uni-h...z/mail/formate.shtml

Hoffe es hilft ein wenig ...
maxk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Di 28.09.04 19:55 
:autsch: Und ich habe nach Sonderzeichen gesucht. Manchmal ist die Lösung so einfach, dass man es nicht glauben kann :lol:
Also dann Danke für die Recherche, dann kann's ja endlich mit dem Projekt weitergehen ;)

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.