Re: [exim] Transport / Router Comprehension Difficulty

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Phil Pennock
Data:  
Para: Always Learning
CC: exim-users
Assunto: Re: [exim] Transport / Router Comprehension Difficulty
On 2010-11-06 at 18:38 +0000, Always Learning wrote:
> I have the book and I have the manual. I have also Googled extensively but am unable to comprehend the logic / technique of:
>
> (1) sending data to an external text file
>
> (2) sending data to a web process
>
> Please will someone assist me by suggesting an illustrative and information source of sought information ?


Routers establish policy and say what, in general terms, should be done
with a particular mail. Each Router is tested in turn, the first to
accept the mail does so.

Transports define mechanism and say *how* to do that. The definitions
of Transports are unordered -- they're a set, or pool, of available
mechanisms.

Your pre-conditions and conditions on a Router decide whether or not it
is invoked. If you want to add more logging, that can be done with an
"unseen" Router, with the "unseen" modifier, which lets delivery
continue on.

A better approach for more configurable logging is to try Axel Rau's
patches in:
http://bugs.exim.org/show_bug.cgi?id=1031
Those patches are documented for use with SQL logging, but the mechanism
should be generic enough to support appending to a file.

Most people just post-process the normal Exim mainlog, though. All of
the information you want, except the emails' own date/time, can be put
into mainlog with "log_selector" in the main configuration section. See
The Exim Specification, §49.15 "Reducing or increasing what is logged":
http://www.exim.org/exim-html-current/doc/html/spec_html/ch49.html#SECTlogselector

Joining together the delivery lines, based on the Exim msgid, with the
received line gives you all the data you want there.


For sending data to a web process, you'd use a "pipe" Transport, where
the "command" option points to a wrapper script that manages taking the
email and uploading it to the web-server.

Pipe Transport documentation:
http://www.exim.org/exim-html-current/doc/html/spec_html/ch29.html

So you might write a "web_upload:" Router, using the "accept" driver,
which means this Router accepts the address and nothing further happens.
The "domains", "local_parts", "condition" and other restrictions make
sure this Router only accepts the correct mails. Remember that order
matters. You'd then have "transport = web_upload_t" on that Router.

Then the "web_upload_t:" Transport will declare "driver = pipe" and have
a "command = /path/to/my/uploader" option on it.

-Phil