Author: paul.mcilfatrick Date: To: exim-users Subject: [exim] FW: Some help with getting 'log_message' to write e-mail
header linefeeds to the log file
> > paul.mcilfatrick@??? wrote: > > > Does anyone know if there is a way to get 'log_message' to
> > write e-mail
> > > header linefeeds to the log file or is there another way to achieve > > > this?
> >
> > Check out ${sg{<subject>}{<regex>}{<replacement>}} in the manual. It
> > operates like perl string replace so you should be able to replace all > > the new lines with spaces or empty string and get the whole
> > line out to
> > the log file. > Is Paul aware that if a message is rejected at the end of the DATA phase, > the messages headers are written to the rejectlog file? Does he need
> the headers when messages are not rejected?
Looked at this and the rejectlog file does have the problem header
formatted as I want it. However, we run a local whitelist for trusted
domains on our Exim system (had to be introduced over a year ago as the
amount of SPAM was killing our system and SpamAssassin) and use a 'deny'
to reject e-mails not from one of the trusted domains. Our daily rotated
rejectlog file is > 25 Mbytes in size and editing this size of file to
find the header I am looking for is a bit of a bind and so I think that
I will concentrate on the mainlog file.
On reflection using 'logwrite' is probably better as it keeps the
problem recorded on one line in the mainlog file. I can grep the mainlog
file for the message and use awk/sed to turn the two '\n' characters
into a linefeed so output is formatted to the screen.
Any of you UNIX gurus know how to use awk/sed on a Solaris 9 system to
take the two '\n' characters and output a linefeed?