I normally configure E-mailRelay as an SMTP proxy using --as-proxy x.y.z:25 --filter="net:127.0.0.1:10101", where the filter performs content inspection via a network socket (returning results like ok, fail, or abandon).
I would like to utilize the new MX filter feature to configure email routing based on DNS MX lookups.
From the documentation and tickets I’ve reviewed, it appears that filter and client-filter (specifically split/MX filters) are often used together.
filter=split:
client-filter=mx:168.63.129.16
forward-to 127.0.0.1:9
Given my use case, how can I configure the system so that the mail content is first inspected via the socket filter before proceeding with the MX/split operation—ensuring the process continues if the result is "ok," but terminates if the result is "fail" or "abandon"?
Can two differentfilter client-filter configurations be used simultaneously?
Thank you for your advice.
In general you can have multiple filters and they operate in sequence. However, the "split:" filter should be last because any new messages that get split off will not have any of the later filters applied. That's the main reason that the "mx:" filter is run when forwarding (--client-filter), but it has the additional benefit that the IP address obtained from DNS is fully up-to-date. I don't see a problem in your case as long as your "net:" filter is specified first on the command-line or config file.
now got it.
--filter run when a mail message is stored. --client-filter run when a mail message is forwarded.
so, MX filter must be client-filter, split must be filter .
As you said network filter first, then the split filter, and finally the MX client filter;
Final cmd args ;
--filter="net:127.0.0.1:10101" --filter=split: --client-filter=mx: