mirror of https://github.com/adamdruppe/arsd.git
ketmar patch for non mbox format
This commit is contained in:
parent
d9f6d9e497
commit
06e3d82803
21
email.d
21
email.d
|
@ -506,7 +506,12 @@ class MimeContainer {
|
||||||
|
|
||||||
import std.algorithm : startsWith;
|
import std.algorithm : startsWith;
|
||||||
class IncomingEmailMessage {
|
class IncomingEmailMessage {
|
||||||
this(ref immutable(ubyte)[][] mboxLines) {
|
this(string[] lines) {
|
||||||
|
auto lns = cast(immutable(ubyte)[][])lines;
|
||||||
|
this(lns, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
this(ref immutable(ubyte)[][] mboxLines, bool asmbox=true) {
|
||||||
|
|
||||||
enum ParseState {
|
enum ParseState {
|
||||||
lookingForFrom,
|
lookingForFrom,
|
||||||
|
@ -514,7 +519,7 @@ class IncomingEmailMessage {
|
||||||
readingBody
|
readingBody
|
||||||
}
|
}
|
||||||
|
|
||||||
auto state = ParseState.lookingForFrom;
|
auto state = (asmbox ? ParseState.lookingForFrom : ParseState.readingHeaders);
|
||||||
string contentType;
|
string contentType;
|
||||||
|
|
||||||
bool isMultipart;
|
bool isMultipart;
|
||||||
|
@ -606,11 +611,13 @@ class IncomingEmailMessage {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ParseState.readingBody:
|
case ParseState.readingBody:
|
||||||
if(line.startsWith("From ")) {
|
if (asmbox) {
|
||||||
break lineLoop; // we're at the beginning of the next messsage
|
if(line.startsWith("From ")) {
|
||||||
}
|
break lineLoop; // we're at the beginning of the next messsage
|
||||||
if(line.startsWith(">>From") || line.startsWith(">From")) {
|
}
|
||||||
line = line[1 .. $];
|
if(line.startsWith(">>From") || line.startsWith(">From")) {
|
||||||
|
line = line[1 .. $];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isMultipart) {
|
if(isMultipart) {
|
||||||
|
|
Loading…
Reference in New Issue