Re: [exim] Exim not always logging Message-ID

Top Page
Delete this message
Reply to this message
Author: Mike Brudenell
Date:  
To: Exim Users
Subject: Re: [exim] Exim not always logging Message-ID
Bingo! (Possibly!)

After yet more peering at the source code in receive.c I've at last located
the section that generates and outputs the incoming "<=" log line. This is
enclosed within

if (msgid_header != NULL)
  {
    …
  }



so only adds the "id *messageidvalue*" text to the string being built for
logging if the msgid_header variable has a value (ie, is not NULL).

Earlier in the same function there is a section that checks whether
msgid_header has a value (from a "Message-ID:" header being present in the
incoming message headers) and, if not, will generate one if and onlf either
the message is local with suppress_local_fixups false, or if submission
mode is set (which it is for me)…


if (msgid_header == NULL &&
      ((sender_host_address == NULL && !suppress_local_fixups)
        || submission_mode))
  {
    …
  }



This code section does indeed generate a value and then
calls header_add_at_position() to add the "Message-Id: *messageidvalue*" header
line to the message structure.

However it doesn't seem to store the generated value within the
msgid_header variable, meaning this is still NULL when it reaches the
logging code section later on. So the message has had a message-id
generated and added to its headers, but it doesn't get included in the log
line.

Checking the source code for the current 4.87 version of Exim shows the
same coding.

Does anyone know whether this is deliberate for some reason? Or if not
updating msgid_header when generating a message-id value is merely an
ovesight I'll send in a bug report.

With many thanks,
Mike B-)


On 1 June 2016 at 12:16, Mike Brudenell <mike.brudenell@???> wrote:

> Hi,
>
> I think I've uncovered an issue with Exim not logging a message's
> Message-ID in some circumstances and would appreciate people's thoughts…
>
> I'm running Exim 4.82 (distributed with Ubuntu 14.04 LTS) and have pretty
> much all logging enabled:
>
> log_selector = +all -retry_defer -skip_delivery -tls_peerdn
>
>
> When a message arrives over SMTP that *includes* a "Message-ID:" header
> its value is included in the "<=" incoming message line Exim logs to its
> mainlog as "id=*messageidvalue*"
>
> However if the message arriving over SMTP *does not include* a
> "Message-ID:" header then no value gets logged.
>
> OK, I can understand this if there genuinely is no message-id. However if
> the connection is accepted by an ACL with "control = submission" Exim fixes
> this up by generating a message-id, as described in Chapter 47 *Submission
> mode for non-local messages*
> <http://www.exim.org/exim-html-current/doc/html/spec_html/ch-message_processing.html#SECTsubmodnon>.
> The ACL in question in our configuration says:
>
> accept  hosts   = +relay_from_hosts
>         control = submission/sender_retain
>         control = dkim_disable_verify

>
>
> Exim should therefore be generating/fixing up the message-id and I'd
> expect this (generated) message-id to be logged somewhere: either in the
> "<=" incoming log line (ideally), or in a separate log line.
>
> But it isn't. Not anywhere. :-(
>
> (I've peered at the source code, in particular in receive.c, but haven't
> got very far sadly.)
>
> Is this a bug/oversight?
> Have I missed something?
> Is it a feature I could request, or are there technical reasons why it
> couldn't be logged?
>
> *Why do I want this?*
> This is making it a real pain to try and trace a message generated by an
> on-site system, sent out through Exim on our local gateways to an external
> host, which (I think, but am trying to prove) is relaying it back to our
> Google-hosted mailboxes. The message-id would be the information to link
> the outgoing entry in Exim's logs to the incoming messages in Google's logs
> whilst having no access to the logs of the intermediate server.
>
> Cheers,
> Mike B-)
>
> --
> Systems Administrator & Change Manager
> IT Services, University of York, Heslington, York YO10 5DD, UK
> Tel: +44-(0)1904-323811
>
> Web: www.york.ac.uk/it-services
> Disclaimer: www.york.ac.uk/docs/disclaimer/email.htm
>




--
Systems Administrator & Change Manager
IT Services, University of York, Heslington, York YO10 5DD, UK
Tel: +44-(0)1904-323811

Web: www.york.ac.uk/it-services
Disclaimer: www.york.ac.uk/docs/disclaimer/email.htm