Milter xxfi_header()

Process a header All Milter versions

The message’s headers are sent first during the DATA phase of an SMTP transaction. They are followed by a blank line and then the message’s body. This xxfi_header() function handles each header and stops when there are no more headers to process. After that, the xxfi_eoh() function, if used, is called.

The xxfi_header() function is called like this:

sfsistat
xxfi_header(SMFICTX *ctx,  char *name,  char *value)

Here, ctx is the context pointer passed to all xxfi_ functions to maintain state in a multithreaded environment. The name is a pointer to a string that contains the name of the header (the part to the left of the colon), and value is the value of the header (the part to the right of the colon):

name: value

The name may be an empty string, but will never be NULL. The value may be an empty string, but will never be NULL. When a header occupies more than one line, the header is unfolded by sendmail and supplied to your Milter in unfolded form. For example, consider this value from a Received: header:

from example.com (mx.example.com [12.34.56.78])\r\n\tby your.domain with ESMTP id i08K
jvWt014695\r\n\tfor <bob@your.domain>; Fri, 14 Dec 2007 13:46:10 −0700

Here, the indentation character (a tab) is represented as \t, and a carriage-return/linefeed pair is represented as \r\n.

Before your Milter receives a header, sendmail has already reviewed that header for any values that are out of bounds or are illegal. If, for example, sendmail ...

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.