Skip to main content


ec_get_message_received_via — Return the IP address that the message was received via




ec_get_message_received_via returns the IP address of the interface that the message was received on. It returns the address in dot-decimal notation, for example.

In the following script, the IP address returned by ec_get_message_received_via is checked against a specific value and the mail is permanently failed if it does not match.

$ip = ec_get_message_received_via;
if not ec_test :is "${ip}" "" {
  ec_action 550 "ec_get_message_received_via failed.  Expected, got ${ip}";
Was this page helpful?