X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=mymail.c;h=a3da27a6687c4732cf817edb4842097c4c526e32;hb=41e5f965489cd5cf00f3451fbd34d51fd2a14b51;hp=a584e48a5bdbb544e622bb9537399701cc3e897a;hpb=953c4d5b2fe270d10ca826b8d448d36edbb49f68;p=mymail.git diff --git a/mymail.c b/mymail.c index a584e48..a3da27a 100644 --- a/mymail.c +++ b/mymail.c @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -48,7 +49,7 @@ #include #define MYMAIL_DB_MAGIC_TOKEN "mymail_index_file" -#define MYMAIL_VERSION "0.9.9" +#define MYMAIL_VERSION "0.9.10" #define MYMAIL_DB_FORMAT_VERSION 1 @@ -380,6 +381,7 @@ void extract_mail(const char *mail_filename, unsigned long int position_in_mail, /* printf("Extract\n"); */ mail_file = safe_fopen(mail_filename, "r", "mbox for mail extraction"); + /* fchmod(fileno(mail_file), 0x660); */ fseek(mail_file, position_in_mail, SEEK_SET); if(fgets(raw_mbox_line, BUFFER_SIZE, mail_file)) { @@ -834,12 +836,15 @@ struct time_criterion { static struct time_criterion time_criteria[] = { { "1h", 0, 1, -1, -1 }, + { "2h", 0, 2, -1, -1 }, + { "4h", 0, 4, -1, -1 }, { "8h", 0, 8, -1, -1 }, { "24h", 0, 24, -1, -1 }, { "48h", 0, 48, -1, -1 }, { "week", 0, 24 * 7, -1, -1 }, { "2weeks", 0, 24 * 14, -1, -1 }, { "month", 0, 24 * 31, -1, -1 }, + { "semester", 0, 24 * 185, -1, -1 }, { "trimester", 0, 24 * 92, -1, -1 }, { "year", 0, 24 * 365, -1, -1 }, @@ -1056,6 +1061,9 @@ int main(int argc, char **argv) { struct search_condition search_conditions[MAX_NB_SEARCH_CONDITIONS]; struct alias_node *a, *b; + /* Group and others have no access */ + umask(S_IRWXG | S_IRWXO); + if(regcomp(&global_leading_from_line_regexp, LEADING_FROM_LINE_REGEXP_STRING, 0)) { fprintf(stderr, "mymail: Cannot compile leading \"from\" line regexp. That is strange.\n");