summaryrefslogtreecommitdiffstats
path: root/maildrop/message.h
diff options
context:
space:
mode:
authorSam Varshavchik2013-08-25 20:54:43 -0400
committerSam Varshavchik2013-08-28 21:07:40 -0400
commit9bb1a8d85390653f702e8ad5556a2cd3793acbfe (patch)
tree2aafb33608ec6c69182e00364d324f845a3e7325 /maildrop/message.h
parent2ec3d0c52bff3e27242ae214571792c5f2d5299a (diff)
downloadcourier-libs-9bb1a8d85390653f702e8ad5556a2cd3793acbfe.tar.bz2
maildrop: rfc2045-parse message when reading it initially.
At startup MIME parse the message. maildrop no longer ignores leading blank lines, and From_ line. Use reformail -f0 to filter the message for maildrop, if that's the case. Get rid of msgoffset (starting offset of the message). rfc2045-parse the message as maildrop reads it.
Diffstat (limited to 'maildrop/message.h')
-rw-r--r--maildrop/message.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/maildrop/message.h b/maildrop/message.h
index 0f6a5ee..a539929 100644
--- a/maildrop/message.h
+++ b/maildrop/message.h
@@ -1,6 +1,7 @@
#ifndef message_h
#define message_h
+#include "rfc2045/rfc2045.h"
//////////////////////////////////////////////////////////////////////////////
//
@@ -75,7 +76,12 @@ public:
off_t MessageSize();
off_t MessageLines() { return (msglines); }
void setmsgsize();
- } ;
+
+ // API translator for rfc2045 functions
+
+ struct rfc2045src rfc2045src_parser;
+ struct rfc2045 *rfc2045p;
+} ;
#include "funcs.h"
#include "maildrop.h"
@@ -134,7 +140,7 @@ off_t pos;
pos=mio.tell();
if (pos == -1) seekerr();
}
- pos -= maildrop.msginfo.msgoffset;
+
if (extra_headersptr)
pos += extra_headersptr-extra_headers;
else
@@ -158,8 +164,6 @@ int l=0;
extra_headersptr=0;
n -= l;
}
- n += maildrop.msginfo.msgoffset;
-
if (mio.fd() >= 0)
{
if (mio.seek(n, SEEK_SET) < 0) seekerr();
@@ -174,7 +178,6 @@ int l=0;
inline off_t Message::MessageSize()
{
off_t s=msgsize;
- s -= maildrop.msginfo.msgoffset;
if (extra_headers)
s += strlen(extra_headers);