Trace header fields and the loop checks that read them.
Return-Path:- added at final delivery with the envelope sender (RFC 5321 §4.4).Delivered-To:- added at final delivery with the recipient (RFC 9228). A message that already carries one for the same recipient has been here before: a mail loop.Received:- one per hop. Too many of them is a loop too (RFC 5321 §6.3).
Header fields are as returned by Sovite.Message.Headers.parse/1.
Summary
Functions
The Delivered-To: field for recipient.
Whether a Delivered-To: field names recipient, compared without
regard to case.
The number of Received: fields.
The Return-Path: field for sender ("" for the null reverse-path).
Functions
The Delivered-To: field for recipient.
iex> Sovite.Message.Trace.delivered_to("bob@example.com")
"Delivered-To: bob@example.com\r\n"
@spec delivered_to?([Sovite.Message.Headers.field()], String.t()) :: boolean()
Whether a Delivered-To: field names recipient, compared without
regard to case.
@spec hops([Sovite.Message.Headers.field()]) :: non_neg_integer()
The number of Received: fields.
The Return-Path: field for sender ("" for the null reverse-path).
iex> Sovite.Message.Trace.return_path("alice@example.com")
"Return-Path: <alice@example.com>\r\n"