logging of x-headers
am 31.01.2008 01:28:52 von phillip.corchary
All - I need to find a way to log x-headers in my installation that
processes about 400k valid ('sent') mail per day. I'm very much a
neophyte at sendmail.
I see two options and I'd like feedback:
1) use milter : here are the challenges I see with that
- for my installation I have to recompile sendmail
- resources issues (CPU, I/O, disk storage). I guess most
milter scripts are in perl, right ... this will have some
overhead for sure
- files .. specifically this will create some arbitrary new log file
that I have to
then associate with the maillog entries
2) find a coder to patch sendmail for this feature
- from what I've read so far, this is actually fairly trivial
- have to maintain the patch going forward for new sendmail versions
- should solve most of the resource issues and the log file issues
Anyone ever done anything like this and can offer pointers.?
Re: logging of x-headers
am 31.01.2008 22:40:01 von jnemeth
Phil (phillip.corchary@gmail.com) wrote:
: All - I need to find a way to log x-headers in my installation that
: processes about 400k valid ('sent') mail per day. I'm very much a
: neophyte at sendmail.
: I see two options and I'd like feedback:
: 1) use milter : here are the challenges I see with that
: - for my installation I have to recompile sendmail
sendmail has MILTER by default these days.
: - resources issues (CPU, I/O, disk storage). I guess most
: milter scripts are in perl, right ... this will have some
: overhead for sure
If you want a milter to do just this, it would be relatively
simple to write one in C. Start with the example given in the docs,
strip out most of the body stuff, have it look for x-headers, and log
them.
: - files .. specifically this will create some arbitrary new log file
: that I have to
: then associate with the maillog entries
openlog(..., ..., LOG_MAIL);
...
syslog(..., ...);
Re: logging of x-headers
am 01.02.2008 01:59:56 von per
In article
<5a617100-df1c-4420-bb05-1d381630dade@s12g2000prg.googlegroups.com> Phil
writes:
>All - I need to find a way to log x-headers in my installation that
>processes about 400k valid ('sent') mail per day. I'm very much a
>neophyte at sendmail.
Specific "x-headers", or all headers that start with "X-"? (At least the
latter sounds pretty pointless.)
>I see two options and I'd like feedback:
3) Assuming you want to log specific headers, you can do it all in the
sendmail config. Something like this (untested) in your .mc:
LOCAL_CONFIG
Klog syslog
HX-Envelope-To: $+>LogHeader
HX-Spam-Status: $+>LogHeader
LOCAL_RULESETS
SLogHeader
R$* $: $(log "Got x-header: " ${hdr_name} ": " ${currHeader} $)
Note that there is a after the 'R$*'.
--Per Hedeland
per@hedeland.org