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

Mailing List Archive: exim: users

Trying build a logging system into mysql for the routers.

 

 

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


isolderj at hotmail

Oct 5, 2009, 12:07 AM

Post #1 of 3 (667 views)
Permalink
Trying build a logging system into mysql for the routers.

Hi,

I know I can get the info from other places in the dat acl section but I would like to know if it is possible for me to extract the info that is returned from the routers and put it into a mysql DB. The log line looks something like this. so is the DT= and the R= or the T= referencable inside of exim somewhere...

Oct 5 08:51:08 <hostname> exim[PID]: 2009-10-05 08:51:08 <$message_id> => <from_email_address> R=<router_name> T=<transport_name> S=<size> H=<hostname> [<ip number of hostname] C="250 OK id=1MuhPY-00056Z-Pg" DT=<delivery time>

Thanks For any assistance

_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141665/direct/01/
--
## 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/


wbh at conducive

Oct 5, 2009, 12:40 AM

Post #2 of 3 (609 views)
Permalink
Re: Trying build a logging system into mysql for the routers. [In reply to]

isolderj [at] hotmail wrote:
> Hi,
>
> I know I can get the info from other places in the dat acl section but I
> would like to know if it is possible for me to extract the info that is
> returned from the routers and put it into a mysql DB. The log line looks
> something like this. so is the DT= and the R= or the T= referencable inside
> of exim somewhere...

Those log strings are built, (if asked for), and selection of where to log made in:

~ /src/deliver.c

Which is quit readable even for a non-programmer.

AFAICS, the variables are not 'exposed' - Exim just builds string(s) and appends
them to the log file(s), so you would need to either use exigrep or eximstats or
such to extract the info from the logs after-the-fact, ELSE code-in a tool to
[also | exclusively] pass a copy to an SQL insert clause.

Unless you have a near-real-time need to *act* on the information, parsing the
log after the fact and/or 'Tee' ing it for quasi-on-the-fly checking would seem
more sustainable / less hazardous - and less likely to interfere with the
daemon - than altering deliver.c

YMMV,

Bill Hacker

>
> Oct 5 08:51:08 <hostname> exim[PID]: 2009-10-05 08:51:08 <$message_id> =>
> <from_email_address> R=<router_name> T=<transport_name> S=<size> H=<hostname>
> [<ip number of hostname] C="250 OK id=1MuhPY-00056Z-Pg" DT=<delivery time>
>
> Thanks For any assistance
> _________________________________________________________________ Hotmail:
> Trusted email with powerful SPAM protection.
> http://clk.atdmt.com/GBL/go/177141665/direct/01/


--
## 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/


warren at decoy

Oct 5, 2009, 12:44 AM

Post #3 of 3 (608 views)
Permalink
Re: Trying build a logging system into mysql for the routers. [In reply to]

2009/10/5 <isolderj [at] hotmail>

>
> Hi,
>
> I know I can get the info from other places in the dat acl section but I
> would like to know if it is possible for me to extract the info that is
> returned from the routers and put it into a mysql DB. The log line looks
> something like this. so is the DT= and the R= or the T= referencable inside
> of exim somewhere...
>
> Oct 5 08:51:08 <hostname> exim[PID]: 2009-10-05 08:51:08 <$message_id> =>
> <from_email_address> R=<router_name> T=<transport_name> S=<size>
> H=<hostname> [<ip number of hostname] C="250 OK id=1MuhPY-00056Z-Pg"
> DT=<delivery time>
>
>

Since Exim does not expose these logging strings, you can make use of
message_suffix and local_part_suffix to match your requirements.
So for example, the following setup on a transport:

appendfile_transport:
driver = appendfile
...
..
. (various other appendfile options)
message_suffix = ${lookup mysql{SOME_MYSQL_INSERT}{}{}}

A better option would be to use a log file tailer, like Exilog, and adapt it
to suit your needs and not rely on Exim directly.


.warren
--
## 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.