commit 1b7cca1924c5b34ea08cd8f51ef152d985b34aff
parent 761544f70f379dd18c2d452128c76fe3d5dc1d2e
Author: andreaha <andreaha@b31fe1f4-c0d1-0310-8000-a34f4ae90293>
Date: Thu, 4 Mar 2004 20:18:10 +0000
- Refined the algorithm for moving messages from new/ a tad; messages
created by Binc IMAP now get the string BincIMAP in their name.
Messages with BincIMAP in their name are always moved from new/
immediately, otherwise the timestamp is checked.
git-svn-id: file:///home/cwright/convert/bincimap/trunk@56 b31fe1f4-c0d1-0310-8000-a34f4ae90293
Diffstat:
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/maildir-scan.cc b/src/maildir-scan.cc
@@ -257,7 +257,7 @@ Maildir::ScanResult Maildir::scan(bool forceScan)
// introduces a special case: we can not cache the old st_ctime
// and st_mtime. the next time the mailbox is scanned, it must not
// simply be skipped. :-)
- if (!forceScan && ::time(0) <= mystat.st_mtime) {
+ if (filename.find("BincIMAP") == string::npos && ::time(0) <= mystat.st_mtime) {
old_cur_st_mtime = (time_t) 0;
old_cur_st_ctime = (time_t) 0;
old_new_st_mtime = (time_t) 0;
diff --git a/src/maildir.cc b/src/maildir.cc
@@ -527,8 +527,8 @@ bool Maildir::commitNewMessages(const string &mbox)
ssid << (int) tv.tv_sec
<< "." << (int) session.getPid()
<< (attempt == 0 ? "" : ("_" + toString(attempt)))
- << "_" << (int) tv.tv_usec
- << (rand() % 0xffff) << "." << session.getHostname();
+ << "_" << (int) tv.tv_usec
+ << (rand() % 0xffff) << "_BincIMAP." << session.getHostname();
BincStream ss;
ss << mbox << "/new/" << ssid.str();
@@ -683,7 +683,7 @@ bool Maildir::fastCopy(Message &m, Mailbox &desttype,
<< "." << (int) session.getPid()
<< (attempt == 0 ? "" : ("_" + toString(attempt)))
<< "_" << (int) tv.tv_usec
- << (rand() % 0xffff) << "." << session.getHostname();
+ << (rand() % 0xffff) << "_BincIMAP." << session.getHostname();
BincStream ss;
ss << destname << "/tmp/" << ssid.str();