struct parsable_field {
int id;
+ int cflags;
char *regexp_string;
regex_t regexp;
};
static struct parsable_field fields_to_parse[] = {
{
ID_LEADING_LINE,
+ 0,
"^From ",
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
},
{
ID_FROM,
- "^\\([Ff][Rr][Oo][Mm]:\\|[Rr][Ee][Pp][Ll][Yy]-[Tt][Oo]:\\|[Ss][Ee][Nn][Dd][Ee][Rr]:\\)",
+ REG_ICASE,
+ "^\\(from:\\|reply-to:\\|sender:\\|return-path:\\)",
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
},
{
ID_TO,
- "^\\([Tt][Oo]\\|[Cc][Cc]\\|[Bb][Cc][Cc]\\): ",
+ REG_ICASE,
+ "^\\(to\\|cc\\|bcc\\): ",
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
},
{
ID_SUBJECT,
- "^[Ss][Uu][Bb][Jj][Ee][Cc][Tt]: ",
+ REG_ICASE,
+ "^subject: ",
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
},
{
ID_DATE,
- "^[Dd][Aa][Tt][Ee]: ",
+ REG_ICASE,
+ "^date: ",
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
},
for(f = 0; f < nb_fields_to_parse; f++) {
if(regcomp(&fields_to_parse[f].regexp,
fields_to_parse[f].regexp_string,
- REG_ICASE)) {
+ fields_to_parse[f].cflags)) {
fprintf(stderr,
"mymail: Syntax error in regexp \"%s\" for field \"%s\".\n",
fields_to_parse[f].regexp_string,