On Tue, Oct 31, 2000 at 08:06:12PM +0100, Magnus Bodin wrote:
> Anyone had any success in logging Message-ID:s for (mostly) outgoing
> messages and their corresponding send-log-lines? 

I have tried in the past and gave up :(
I tried it at qmail-queue, but only got success if the message is
injected via smtp (otherwise it logs to stdout/stderr and the record is
lost :((.

> I'm very interested in such a patch - and the solution is not to use
> QUEUE_EXTRA. What I want to have is of course a mapping between a given
> Message-ID and the delivery status lines from the log. 

We currently use the QUEUE_EXTRA approach.
The extra delivery logs the Received line (for the IP address of the
sender) and the Message-Id (switched from awk to C recently for speedup).

I have hacked a perl script that groups lines like

Oct 31 23:59:48 mail qmail: 973033188.470903 new msg 376662
Oct 31 23:59:48 mail qmail: 973033188.471639 info msg 376662: bytes 5459
  from <[EMAIL PROTECTED]> qp 15925 uid 101
Oct 31 23:59:48 mail qmail: 973033188.850856 starting delivery 2947822:
    msg 376662 to local [EMAIL PROTECTED]
Oct 31 23:59:48 mail qmail: 973033188.852772 starting delivery 2947823:
    msg 376662 to remote [EMAIL PROTECTED]
Oct 31 23:59:48 mail qmail: 973033188.852772 starting delivery 2947824:
    msg 376662 to remote [EMAIL PROTECTED]
Oct 31 23:59:49 mail qmail: 973033189.495688 delivery 2947823: success:
    195.30.0.14_accepted_message./Remote_host_said:_250_ok_973033189_qp_80774/
Oct 31 23:59:49 mail qmail: 973033189.496798 delivery 2947824: success:
    195.30.0.14_accepted_message./Remote_host_said:_250_ok_973033189_qp_80775/
Oct 31 23:59:49 mail qmail: 973033189.755214 delivery 2947822: success:
    
Received:_from_mailhost.example.com_(1.2.3.4)/Message-ID:_<[EMAIL PROTECTED]>/did_0+0+1/
Oct 31 23:59:49 mail qmail: 973033189.810611 end msg 376662

and writes records (format: tstamp from to size ip message-id)

973033188 <[EMAIL PROTECTED]> [EMAIL PROTECTED] 5459 1.2.3.4 
[EMAIL PROTECTED]
973033188 <[EMAIL PROTECTED]> [EMAIL PROTECTED] 5459 1.2.3.4 
[EMAIL PROTECTED]

We need this for accounting, but I'm not happy with it at all, as it
slows down qmail alot (IMHO).

So if anyone has a better solution, I'd be really happy.

        \Maex

-- 
SpaceNet GmbH             |   http://www.Space.Net/   | Stress is when you wake
Research & Development    | mailto:[EMAIL PROTECTED] | up screaming and you
Joseph-Dollinger-Bogen 14 |  Tel: +49 (89) 32356-0    | realize you haven't
D-80807 Muenchen          |  Fax: +49 (89) 32356-299  | fallen asleep yet.

Reply via email to