enum {
ID_MAIL = 0,
+ ID_FIRST_LINE,
ID_FROM,
ID_TO,
ID_SUBJECT,
static char *field_names[] = {
"mail",
+ "first",
"from",
"to",
"subject",
};
static struct parsable_field fields_to_parse[] = {
+ {
+ ID_FIRST_LINE,
+ "^From ",
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+
{
ID_FROM,
- "^\\(From \\|[Ff][Rr][Oo][Mm]:\\|[R][r][E][e][P][p][L][l][Y][y]-[T][t][O][o]:\\)",
+ "^\\([Ff][Rr][Oo][Mm]:\\|[Rr][Ee][Pp][Ll][Yy]-[Tt][Oo]:\\|[Ss][Ee][Nn][Dd][Ee][Rr]:\\)",
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
},
int mbox_id, char *mbox_value) {
return
(condition->field_id == mbox_id ||
- (condition->field_id == ID_PARTICIPANT && (mbox_id == ID_FROM || mbox_id == ID_TO)))
+ (condition->field_id == ID_PARTICIPANT && (mbox_id == ID_FROM || mbox_id == ID_TO)) ||
+ (condition->field_id == ID_FROM && mbox_id == ID_FIRST_LINE))
&&
regexec(&condition->regexp, mbox_value, 0, 0, 0) == 0;
}