/**
+ ** check left to do:
+ - range scans on maildir
+ - see how replacing the links works in the resulting email via thunderbird etc..
+ - some checksum issues (see dupelicates?? suspect 0byte issues?) -- seems ok now?
+
+
+
+
needs to scan 2 things
a) our mailfort email database
point it at the top directory, containing YEAR/MONTH/DAY.... directories.
var oldest = new DateTime.now_local();
oldest = oldest.add_months(-1 * StripApplication.opt_age_oldest);
- var rtspan = oldest.difference(oldest) / GLib.TimeSpan.DAY;
-
- if (rtspan > 0) {
+ var rtspan = mailtime.difference(oldest) / GLib.TimeSpan.DAY;
+ GLib.debug("Checking oldest %d days difference", (int)rtspan );
+ if (rtspan < 0) {
GLib.debug("skip(2) file is %d days older than %d months", (int)rtspan, StripApplication.opt_age_oldest);
return;
}
var newest = new DateTime.now_local();
- newest = oldest.add_months(-1 * StripApplication.opt_age_newest);
+ newest = newest.add_months(-1 * StripApplication.opt_age_newest);
rtspan = mailtime.difference(newest) / GLib.TimeSpan.DAY;
- if (rtspan < 0) {
+ if (rtspan > 0) {
GLib.debug("skip(2) file is %d days newer than %d months : %s", (int)rtspan, StripApplication.opt_age_newest,
mailtime.format("%Y-%m-%d %H:%M:%S"));
return;
public void scan_dir(string basepath, string subpath)
{
+
// determine if path is to old to scan..
if (subpath.length > 0 && StripApplication.opt_scan_mailfort) {
var year = int.parse(subpath.substring(1,4)); // "/2000"
var oldest = new DateTime.now_local();
oldest = oldest.add_months(-1 * StripApplication.opt_age_oldest);
- GLib.debug("Checking directory %s is older than min: %d/%d/%d", subpath, oldest.get_year() , oldest.get_month(), oldest.get_day_of_month() );
+ //GLib.debug("Checking directory %s is older than min: %d/%d/%d", subpath, oldest.get_year() , oldest.get_month(), oldest.get_day_of_month() );
if (year < oldest.get_year()) {
GLib.debug("Skip directory %s is older than min year: %d", subpath, oldest.get_year());
return;
}
if (year == oldest.get_year() && month < oldest.get_month()) {
- GLib.debug("Skip directory %s is older than min year: %d/%d", subpath, oldest.get_year() , oldest.get_month() );
+ GLib.debug("Skip directory %s is older than min month: %d/%d", subpath, oldest.get_year() , oldest.get_month() );
return;
}
if (year == oldest.get_year() && month == oldest.get_month() && day < oldest.get_day_of_month()) {
- GLib.debug("Skip directory %s is older than min year: %d/%d/%d", subpath, oldest.get_year() , oldest.get_month(), oldest.get_day_of_month() );
+ GLib.debug("Skip directory %s is older than min day: %d/%d/%d", subpath, oldest.get_year() , oldest.get_month(), oldest.get_day_of_month() );
return;
}
-
+
var newest = new DateTime.now_local();
newest = newest.add_months(-1 * StripApplication.opt_age_newest);
- GLib.debug("Checking directory %s is newer than min: %d/%d/%d", subpath, newest.get_year() , newest.get_month(), newest.get_day_of_month() );
+ //GLib.debug("Checking directory %s is newer than max: %d/%d/%d", subpath, newest.get_year() , newest.get_month(), newest.get_day_of_month() );
if (year > newest.get_year()) {
- GLib.debug("Skip directory %s is newer than min year: %d", subpath, newest.get_year());
+ GLib.debug("Skip directory %s is newer than max year: %d", subpath, newest.get_year());
return;
}
- if (year == newest.get_year() && month < newest.get_month()) {
- GLib.debug("Skip directory %s is newer than min year: %d/%d", subpath, newest.get_year() , newest.get_month() );
+ if (year == newest.get_year() && month != 999 && month > newest.get_month()) {
+ GLib.debug("Skip directory %s is newer than max month: %d/%d", subpath, newest.get_year() , newest.get_month() );
return;
}
- if (year == newest.get_year() && month == newest.get_month() && day < newest.get_day_of_month()) {
- GLib.debug("Skip directory %s is newer than min year: %d/%d/%d", subpath, newest.get_year() , newest.get_month(), newest.get_day_of_month() );
+ if (year == newest.get_year() && month == newest.get_month() && day != 999 && day > newest.get_day_of_month()) {
+ GLib.debug("Skip directory %s is newer than max day: %d/%d/%d", subpath, newest.get_year() , newest.get_month(), newest.get_day_of_month() );
return;
}