msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- fieldptr = rfc822_fetch_field(msg->cm_fields['M'], "Bcc");
- if (fieldptr != NULL) {
- if (bmstrcasestr(fieldptr, itemlist[pos+1])) {
- match = 1;
+ if (msg != NULL) {
+ fieldptr = rfc822_fetch_field(msg->cm_fields['M'], "Bcc");
+ if (fieldptr != NULL) {
+ if (bmstrcasestr(fieldptr, itemlist[pos+1])) {
+ match = 1;
+ }
+ free(fieldptr);
}
- free(fieldptr);
}
pos += 2;
}
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (msg->cm_fields['T'] != NULL) {
- if (imap_datecmp(itemlist[pos+1],
- atol(msg->cm_fields['T'])) < 0) {
- match = 1;
+ if (msg != NULL) {
+ if (msg->cm_fields['T'] != NULL) {
+ if (imap_datecmp(itemlist[pos+1],
+ atol(msg->cm_fields['T'])) < 0) {
+ match = 1;
+ }
}
}
pos += 2;
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (bmstrcasestr(msg->cm_fields['M'], itemlist[pos+1])) {
- match = 1;
+ if (msg != NULL) {
+ if (bmstrcasestr(msg->cm_fields['M'], itemlist[pos+1])) {
+ match = 1;
+ }
}
}
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- fieldptr = msg->cm_fields['Y'];
- if (fieldptr != NULL) {
- if (bmstrcasestr(fieldptr, itemlist[pos+1])) {
- match = 1;
- }
- }
- else {
- fieldptr = rfc822_fetch_field(msg->cm_fields['M'], "Cc");
+ if (msg != NULL) {
+ fieldptr = msg->cm_fields['Y'];
if (fieldptr != NULL) {
if (bmstrcasestr(fieldptr, itemlist[pos+1])) {
match = 1;
}
- free(fieldptr);
+ }
+ else {
+ fieldptr = rfc822_fetch_field(msg->cm_fields['M'], "Cc");
+ if (fieldptr != NULL) {
+ if (bmstrcasestr(fieldptr, itemlist[pos+1])) {
+ match = 1;
+ }
+ free(fieldptr);
+ }
}
}
pos += 2;
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (bmstrcasestr(msg->cm_fields['A'], itemlist[pos+1])) {
- match = 1;
- }
- if (bmstrcasestr(msg->cm_fields['F'], itemlist[pos+1])) {
- match = 1;
+ if (msg != NULL) {
+ if (bmstrcasestr(msg->cm_fields['A'], itemlist[pos+1])) {
+ match = 1;
+ }
+ if (bmstrcasestr(msg->cm_fields['F'], itemlist[pos+1])) {
+ match = 1;
+ }
}
pos += 2;
}
need_to_free_msg = 1;
}
- CC->redirect_buffer = malloc(SIZ);
- CC->redirect_len = 0;
- CC->redirect_alloc = SIZ;
- CtdlOutputPreLoadedMsg(msg, MT_RFC822, HEADERS_ONLY, 0, 1);
-
- fieldptr = rfc822_fetch_field(CC->redirect_buffer, itemlist[pos+1]);
- if (fieldptr != NULL) {
- if (bmstrcasestr(fieldptr, itemlist[pos+2])) {
- match = 1;
+ if (msg != NULL) {
+
+ CC->redirect_buffer = malloc(SIZ);
+ CC->redirect_len = 0;
+ CC->redirect_alloc = SIZ;
+ CtdlOutputPreLoadedMsg(msg, MT_RFC822, HEADERS_ONLY, 0, 1);
+
+ fieldptr = rfc822_fetch_field(CC->redirect_buffer, itemlist[pos+1]);
+ if (fieldptr != NULL) {
+ if (bmstrcasestr(fieldptr, itemlist[pos+2])) {
+ match = 1;
+ }
+ free(fieldptr);
}
- free(fieldptr);
+
+ free(CC->redirect_buffer);
+ CC->redirect_buffer = NULL;
+ CC->redirect_len = 0;
+ CC->redirect_alloc = 0;
}
- free(CC->redirect_buffer);
- CC->redirect_buffer = NULL;
- CC->redirect_len = 0;
- CC->redirect_alloc = 0;
-
pos += 3; /* Yes, three */
}
else if (!strcasecmp(itemlist[pos], "KEYWORD")) {
- /* FIXME */
+ /* not implemented */
pos += 2;
}
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (strlen(msg->cm_fields['M']) > atoi(itemlist[pos+1])) {
- match = 1;
+ if (msg != NULL) {
+ if (strlen(msg->cm_fields['M']) > atoi(itemlist[pos+1])) {
+ match = 1;
+ }
}
pos += 2;
}
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (msg->cm_fields['T'] != NULL) {
- if (imap_datecmp(itemlist[pos+1],
- atol(msg->cm_fields['T'])) == 0) {
- match = 1;
+ if (msg != NULL) {
+ if (msg->cm_fields['T'] != NULL) {
+ if (imap_datecmp(itemlist[pos+1],
+ atol(msg->cm_fields['T'])) == 0) {
+ match = 1;
+ }
}
}
pos += 2;
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (msg->cm_fields['T'] != NULL) {
- if (imap_datecmp(itemlist[pos+1],
- atol(msg->cm_fields['T'])) < 0) {
- match = 1;
+ if (msg != NULL) {
+ if (msg->cm_fields['T'] != NULL) {
+ if (imap_datecmp(itemlist[pos+1],
+ atol(msg->cm_fields['T'])) < 0) {
+ match = 1;
+ }
}
}
pos += 2;
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (msg->cm_fields['T'] != NULL) {
- if (imap_datecmp(itemlist[pos+1],
- atol(msg->cm_fields['T'])) == 0) {
- match = 1;
+ if (msg != NULL) {
+ if (msg->cm_fields['T'] != NULL) {
+ if (imap_datecmp(itemlist[pos+1],
+ atol(msg->cm_fields['T'])) == 0) {
+ match = 1;
+ }
}
}
pos += 2;
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (msg->cm_fields['T'] != NULL) {
- if (imap_datecmp(itemlist[pos+1],
- atol(msg->cm_fields['T'])) >= 0) {
- match = 1;
+ if (msg != NULL) {
+ if (msg->cm_fields['T'] != NULL) {
+ if (imap_datecmp(itemlist[pos+1],
+ atol(msg->cm_fields['T'])) >= 0) {
+ match = 1;
+ }
}
}
pos += 2;
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (msg->cm_fields['T'] != NULL) {
- if (imap_datecmp(itemlist[pos+1],
- atol(msg->cm_fields['T'])) >= 0) {
- match = 1;
+ if (msg != NULL) {
+ if (msg->cm_fields['T'] != NULL) {
+ if (imap_datecmp(itemlist[pos+1],
+ atol(msg->cm_fields['T'])) >= 0) {
+ match = 1;
+ }
}
}
pos += 2;
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (strlen(msg->cm_fields['M']) < atoi(itemlist[pos+1])) {
- match = 1;
+ if (msg != NULL) {
+ if (strlen(msg->cm_fields['M']) < atoi(itemlist[pos+1])) {
+ match = 1;
+ }
}
pos += 2;
}
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (bmstrcasestr(msg->cm_fields['U'], itemlist[pos+1])) {
- match = 1;
+ if (msg != NULL) {
+ if (bmstrcasestr(msg->cm_fields['U'], itemlist[pos+1])) {
+ match = 1;
+ }
}
pos += 2;
}
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- for (i='A'; i<='Z'; ++i) {
- if (bmstrcasestr(msg->cm_fields[i], itemlist[pos+1])) {
- match = 1;
+ if (msg != NULL) {
+ for (i='A'; i<='Z'; ++i) {
+ if (bmstrcasestr(msg->cm_fields[i], itemlist[pos+1])) {
+ match = 1;
+ }
}
}
pos += 2;
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (bmstrcasestr(msg->cm_fields['R'], itemlist[pos+1])) {
- match = 1;
+ if (msg != NULL) {
+ if (bmstrcasestr(msg->cm_fields['R'], itemlist[pos+1])) {
+ match = 1;
+ }
}
pos += 2;
}