On Tue, Dec 23, 2014 at 03:34:41PM -0700, Fred Newtz wrote:

> We have a development server where we want to simply log the
> entire header to a file and discard the email.  I realize with the
> smtp_header_checks you cannot discard the message and I am unsure
> if you could log the entire header to a log file.  I was thinking
> about building a custom filter service that would take an email
> and dump the header to a file then discard the message body.
> 
> This seems like such a simple request, but obviously not many people are
> wanting this functionality.  I just found smtpprox and maybe I  can do
> something with that filter.  I will dig more, but if anyone has any
> suggestions or ideas on how to pull this off I am all ears.

Why so complex?  A pipe(8) transport or a pipe in a local aliases(5)
file will do nicely.

The Morris worm had:

    #define MAIL_FROM "mail from:</dev/null>\n"
    #define MAIL_RCPT "rcpt to:<\"| sed \'1,/^$/d\' | /bin/sh ; exit 0\">\n"

to delete the header and execute the body, you can surely do the converse.

    aliases:
        logheader: "|sed -ne 'p;/^$/q'>>/some/logfile"

--
        Viktor.

Reply via email to