From 589f7e2b986d274920b23ddf7e42078abbea88c2 Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Tue, 12 Dec 2017 21:02:58 +0100 Subject: [PATCH] added archive_only_mydomains support for epoll version of piler Signed-off-by: Janos SUTO --- src/piler.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/piler.c b/src/piler.c index 617c6053..dd1e9de4 100644 --- a/src/piler.c +++ b/src/piler.c @@ -130,6 +130,13 @@ int process_email(char *filename, struct session_data *sdata, struct data *data, parser_state = parse_message(sdata, 1, data, cfg); post_parse(sdata, &parser_state, cfg); + + if(cfg->archive_only_mydomains == 1 && sdata->internal_sender == 0 && sdata->internal_recipient == 0){ + syslog(LOG_PRIORITY, "%s: discarding: not on mydomains, message-id=%s", sdata->ttmpfile, parser_state.message_id); + return ERR_DISCARDED; + } + + if(cfg->syslog_recipients == 1){ rcpt = parser_state.b_to; do {