[Exim] Wish to hack Exim: quietly discarding a message via t…

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Juan Carlos Castro y Castro
日付:  
To: exim-users
題目: [Exim] Wish to hack Exim: quietly discarding a message via transport filter
I'd like a transport filter to be able to return a special value that
would instruct Exim to abort delivery of a mesage, no frezing, no
bouncing, no nothing.

I downloaded the sources for 4.34 and I believe it would be a few simple
changes in one file only -- src/transport.c .

My idea is creating a configuration option called
transport_filter_discard, which would be an integer value. If it is
nonzero and a transport filter process returns that as an exit code, the
message is discarded. Much like return code 99 works in filters called
from .qmail files.

I suppose I should be making changes around line 1090, where the code
below is. The question is, what exactly should I do here to discard the
message?

/* Wait for the filter process to complete. */

DEBUG(D_transport) debug_printf("waiting for filter process\n");
if (filter_pid > 0 && (rc = child_close(filter_pid, 30)) != 0 && yield)
{
yield = FALSE;
save_errno = ERRNO_FILTER_FAIL;
addr->more_errno = rc;
DEBUG(D_transport) debug_printf("filter process returned %d\n", rc);
}