ec_get_message_protocol

March 26, 2020 Contributors

Name

ec_get_message_protocol — Return the protocol of the current message.

Synopsis

ec_get_message_protocol

Description

ec_get_message_protocol returns the protocol that the message was received via. It takes the form of ESMTP, ECSTREAM, LMTP, INTERNAL, POP3, IMAP, or CLUSTER.

In the following script, the protocol is checked against a specific value and the mail is permanently failed if it does not match.

$p = ec_get_message_protocol;
if not ec_test :is "${p}" "ESMTP" {
 ec_action 550 "ec_get_message_protocol.  Expected ESMTP, got ${p}";
}