this patch fixes the problem that binc clears up preserved flags when copying or moving messages.
although it might not be critical issue right now, i don't like binc to have such an easy issue to be pointed out.
-- Hiroshima
--- src/operator-copy.cc.orig Thu Apr 10 06:06:12 2003
+++ src/operator-copy.cc Fri May 30 12:42:28 2003
@@ -206,2 +206,2 @@
throw OperatorException(Operator::NO, strerror(err));
}
+ string newinfo = ":2,";
+ int flags = message.getStdFlags();
+ if (flags & Message::F_DRAFT) newinfo += "D";
+ if (flags & Message::F_FLAGGED) newinfo += "F";
+ if (flags & Message::F_ANSWERED) newinfo += "R";
+ if (flags & Message::F_SEEN) newinfo += "S";
+ if (flags & Message::F_DELETED) newinfo += "T";
+
bool copied = false;
- // loop trying to deliver into new/
+ // loop trying to deliver into cur/
for (int i = 0; i < 1000; ++i) {
BincStream ss;
if (i == 0)
- ss << maildir << "/new/" << fileid
- << "." << getpid() << "." << hostname;
+ ss << maildir << "/cur/" << fileid
+ << "." << getpid() << "." << hostname << newinfo;
else
- ss << maildir << "/new/" << fileid
- << "." << getpid() << "_" << i << "." << hostname;
+ ss << maildir << "/cur/" << fileid
+ << "." << getpid() << "_" << i << "." << hostname << newinfo;
filename = ss.str();

