Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

How to log the generated outgoing message-id?

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


wferi at niif

Aug 22, 2008, 3:59 AM

Post #1 of 6 (695 views)
Permalink
How to log the generated outgoing message-id?

Hi,

For tracking email, I'd like to log the message-id generated by Exim
for mail submitted by a local process. How could I achieve this?
--
Thanks,
Feri.

--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


jgh at wizmail

Aug 22, 2008, 4:14 AM

Post #2 of 6 (648 views)
Permalink
Re: How to log the generated outgoing message-id? [In reply to]

Ferenc Wagner wrote:
> Hi,
>
> For tracking email, I'd like to log the message-id generated by Exim
> for mail submitted by a local process. How could I achieve this?

Look in the docs at http://exim.org for "log_message" and "$message_id"

- Jeremy


--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


wferi at niif

Aug 22, 2008, 7:05 AM

Post #3 of 6 (652 views)
Permalink
Re: How to log the generated outgoing message-id? [In reply to]

Nigel Metheringham <nigel.metheringham [at] dev> writes:

> On 22 Aug 2008, at 11:59, Ferenc Wagner wrote:
>
>> For tracking email, I'd like to log the message-id generated by Exim
>> for mail submitted by a local process. How could I achieve this?
>
> Do you mean you want the local submitting process to know the message
> id?

No, I just want it logged in mainlog.
--
Thanks,
Feri.

--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


wferi at niif

Aug 22, 2008, 7:10 AM

Post #4 of 6 (638 views)
Permalink
Re: How to log the generated outgoing message-id? [In reply to]

Jeremy Harris <jgh [at] wizmail> writes:

> Ferenc Wagner wrote:
>
>> For tracking email, I'd like to log the message-id generated by Exim
>> for mail submitted by a local process. How could I achieve this?
>
> Look in the docs at http://exim.org for "log_message" and "$message_id"

OK, I cooked up this:

acl_not_smtp = acl_log_message_id
begin acl
acl_log_message_id:
warn log_message = Generated message id: $message_id
accept

And mainlog says:

2008-08-22 15:53:12 1KWX4i-0002NF-0C U=wferi Warning: Generated message id: 1KWX4i-0002NF-0C
2008-08-22 15:53:12 1KWX4i-0002NF-0C <= wferi [at] mydomai U=wferi P=local S=341

Which makes me feel stupid. Apparently each log line is prefixed with
the message id, sort of. Because in the received mail I find:

Message-Id: <E1KWX4i-0002NF-0C [at] mydomai>

Where does the E prefix come from?
--
Thanks,
Feri.

--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


exim-users at spodhuis

Aug 22, 2008, 1:03 PM

Post #5 of 6 (633 views)
Permalink
Re: How to log the generated outgoing message-id? [In reply to]

On 2008-08-22 at 16:10 +0200, Ferenc Wagner wrote:
> Jeremy Harris <jgh [at] wizmail> writes:
>
> > Ferenc Wagner wrote:
> >
> >> For tracking email, I'd like to log the message-id generated by Exim
> >> for mail submitted by a local process. How could I achieve this?
> >
> > Look in the docs at http://exim.org for "log_message" and "$message_id"
>
> OK, I cooked up this:
>
> acl_not_smtp = acl_log_message_id
> begin acl
> acl_log_message_id:
> warn log_message = Generated message id: $message_id
> accept
>
> And mainlog says:
>
> 2008-08-22 15:53:12 1KWX4i-0002NF-0C U=wferi Warning: Generated message id: 1KWX4i-0002NF-0C
> 2008-08-22 15:53:12 1KWX4i-0002NF-0C <= wferi [at] mydomai U=wferi P=local S=341
>
> Which makes me feel stupid. Apparently each log line is prefixed with
> the message id, sort of. Because in the received mail I find:
>
> Message-Id: <E1KWX4i-0002NF-0C [at] mydomai>
>
> Where does the E prefix come from?

There are two different "message ids" here.

There's $message_exim_id, which used to be called $message_id;
$message_id still works, for backwards compatibility, but the name is
confusing, which is why it became $message_exim_id. And there's the
"Message-Id:" header value.

Exim always logs its internal $message_exim_id for mails. This is the
"handle" used to identify all mails passing through Exim; things like
files on the spool have names based on this value, it's put into the
"Received:" header, etc.

If there is not already a Message-Id: header, then Exim creates one. By
default it uses E${message_exim_id}@$primary_hostname to construct it.
You can change the "domain" part with message_id_header_domain and you
can add something extra just before the @ with message_id_header_text.

The 'E' prefix is there for the "external" form of the internal
$message_exim_id; I don't know why, but I'll guess that it's best if
the Message-Id *always* starts with a letter [*] and that it sometimes
helps to have a visual marker so you can tell, when people cut&paste
information, where the data is coming from. I've no idea if it stands
for 'Exim' or 'External' or both.

-Phil

[*] "best" not because any standard requires it but to minimise problems
with buggy software which puts in bogus checks. This is purely
hypothesis.

--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


wferi at niif

Aug 22, 2008, 1:39 PM

Post #6 of 6 (632 views)
Permalink
Re: How to log the generated outgoing message-id? [In reply to]

Phil Pennock <exim-users [at] spodhuis> writes:

> On 2008-08-22 at 16:10 +0200, Ferenc Wagner wrote:
>
>> Jeremy Harris <jgh [at] wizmail> writes:
>>
>>> Ferenc Wagner wrote:
>>>
>>>> For tracking email, I'd like to log the message-id generated by Exim
>>>> for mail submitted by a local process. How could I achieve this?
>>>
>>> Look in the docs at http://exim.org for "log_message" and "$message_id"
>>
>> OK, I cooked up this:
>>
>> acl_not_smtp = acl_log_message_id
>> begin acl
>> acl_log_message_id:
>> warn log_message = Generated message id: $message_id
>> accept
>>
>> And mainlog says:
>>
>> 2008-08-22 15:53:12 1KWX4i-0002NF-0C U=wferi Warning: Generated message id: 1KWX4i-0002NF-0C
>> 2008-08-22 15:53:12 1KWX4i-0002NF-0C <= wferi [at] mydomai U=wferi P=local S=341
>>
>> Which makes me feel stupid. Apparently each log line is prefixed with
>> the message id, sort of. Because in the received mail I find:
>>
>> Message-Id: <E1KWX4i-0002NF-0C [at] mydomai>
>>
>> Where does the E prefix come from?
>
> There are two different "message ids" here.
>
> There's $message_exim_id, which used to be called $message_id;
> $message_id still works, for backwards compatibility, but the name is
> confusing, which is why it became $message_exim_id. And there's the
> "Message-Id:" header value.
>
> Exim always logs its internal $message_exim_id for mails. This is the
> "handle" used to identify all mails passing through Exim; things like
> files on the spool have names based on this value, it's put into the
> "Received:" header, etc.
>
> If there is not already a Message-Id: header, then Exim creates one. By
> default it uses E${message_exim_id}@$primary_hostname to construct it.
> You can change the "domain" part with message_id_header_domain and you
> can add something extra just before the @ with message_id_header_text.
>
> The 'E' prefix is there for the "external" form of the internal
> $message_exim_id; I don't know why, but I'll guess that it's best if
> the Message-Id *always* starts with a letter [*] and that it sometimes
> helps to have a visual marker so you can tell, when people cut&paste
> information, where the data is coming from. I've no idea if it stands
> for 'Exim' or 'External' or both.
>
> -Phil
>
> [*] "best" not because any standard requires it but to minimise problems
> with buggy software which puts in bogus checks. This is purely
> hypothesis.

Hi Phil,

Thank you very much for the detailed explanation!
--
Regards,
Feri.

--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.