*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "defs.h"
{"X-Mailing-list:", NULL, TRUE},
{"List-Id:", NULL, TRUE},
{"X-Sequence:", NULL, TRUE},
+ {"Sender:", NULL, TRUE},
+ {"List-Post:", NULL, TRUE},
{NULL, NULL, FALSE}};
enum
{
H_X_LIST = 2,
H_X_MAILING_LIST = 3,
H_LIST_ID = 4,
- H_X_SEQUENCE = 5
+ H_X_SEQUENCE = 5,
+ H_SENDER = 6,
+ H_LIST_POST = 7
};
FILE *fp;
}
}
g_strstrip(*key);
+ } else if (hentry[H_SENDER].body != NULL) {
+ SET_FILTER_KEY("header \"Sender\"", H_SENDER);
+ } else if (hentry[H_LIST_POST].body != NULL) {
+ SET_FILTER_KEY("header \"Sender\"", H_LIST_POST);
+ } else if (msginfo->to) {
+ *header = g_strdup("to");
+ *key = g_strdup(msginfo->to);
} else if (msginfo->subject) {
*header = g_strdup("subject");
*key = g_strdup(msginfo->subject);
hentry[H_X_MAILING_LIST].body = NULL;
g_free(hentry[H_LIST_ID].body);
hentry[H_LIST_ID].body = NULL;
+ g_free(hentry[H_SENDER].body);
+ hentry[H_SENDER].body = NULL;
+ g_free(hentry[H_LIST_POST].body);
+ hentry[H_LIST_POST].body = NULL;
break;
case FILTER_BY_FROM:
newmsginfo->references = g_slist_reverse(newmsginfo->references);
MEMBCOPY(score);
- MEMBCOPY(threadscore);
MEMBDUP(plaintext_file);
return newmsginfo;
MailFilteringData mail_filtering_data;
mail_filtering_data.msginfo = msginfo;
- if (hooks_invoke(MAIL_FILTERING_HOOKLIST, &mail_filtering_data))
+ if (hooks_invoke(MAIL_FILTERING_HOOKLIST, &mail_filtering_data)) {
+ hooks_invoke(MAIL_POSTFILTERING_HOOKLIST, msginfo);
return TRUE;
+ }
/* filter if enabled in prefs or move to inbox if not */
if((filtering_rules != NULL) &&
- filter_message_by_msginfo(filtering_rules, msginfo))
+ filter_message_by_msginfo(filtering_rules, msginfo)) {
+ hooks_invoke(MAIL_POSTFILTERING_HOOKLIST, msginfo);
return TRUE;
+ }
hooks_invoke(MAIL_POSTFILTERING_HOOKLIST, msginfo);
-
return FALSE;
}