Martin Stjernholm, Roxen IS @ Pike developers forum wrote:
Nice! What is LMTP?
Quoting RFC 2033 (Local Mail Transfert Protocol):
" SMTP [SMTP] [HOST-REQ] and its service extensions [ESMTP] provide a mechanism for transferring mail reliably and efficiently. The design of the SMTP protocol effectively requires the server to manage a mail delivery queue.
In some limited circumstances, outside the area of mail exchange between independent hosts on public networks, it is desirable to implement a system where a mail receiver does not manage a queue. This document describes the LMTP protocol for transporting mail into such systems.
Although LMTP is an alternative protocol to ESMTP, it uses (with a few changes) the syntax and semantics of ESMTP. This design permits LMTP to utilize the extensions defined for ESMTP. LMTP should be used only by specific prior arrangement and configuration, and it MUST NOT be used on TCP port 25."
So basicaly it's ESMTP. LMTP is between the output of the SMTP receiving server and the mail spool. The good thing is that you get better performances writing mail with Postfix for example (you don't need to start a process each time you receive a mail). And with this API you have a total control of where to write the mail, you can even write your own mail storage system and route the emails on each user's directory as you want.
Regarding create_nbprocess:
o Have considered passing the extra arguments through the mapping instead? To me it seems cleaner now when Process.create_process already has left position-based argument passing in favor of a mapping.
Good idea.
o I also note that create_nbprocess bluntly overrides the "stdin" and "stdout" arguments. Preferably it shouldn't, but if it has to then it must be mentioned.
Then it has to be mentioned.
Btw, what's the reason for supplying an stdin pipe at all?
I guessed some programs need a stdin.
o Ideally I'd like to see this functionality directly in Process.create_process, but I guess it's a bit too much for you to integrate it on the C level. Maybe we could rename the current Process.create_process to something like Process._create_process and then add a Pike level wrapper with this and other goodies?
Indeed I won't modify the C code.
o You don't need to do remove_call_out of the call out itself inside it; they are one-shot.
Yep, thanks.
o Avoid storing a reference to the object inside itself (i.e. the "process" variable). That makes a circular reference which means more work for the gc. (In 7.5 there's a special hack that avoids counting such references to itself, but it's good practice to try to avoid it anyway since it's not always that hack can discover a cyclic reference.)
Yes, my mistake, it's here from an old version and I forgot to remove it.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-09-19 23:50: Subject: Contribution
Hi there,
I'd like to contribute the following modules to Pike:
. A non blocking SMTP/LMTP server API. I borrowed some code from a SMTP server for Roxen copyright Mike Knott, David Hedbor and On The Verge these parts are protected under the GPL version 2. I'd like to know if the Pike team and them agree or not for the addition. For now I did not really test the SMTP server facing the real Internet world. However I use the LMTP server (which inherit the SMTP server) for some months now on a production server behind a Postfix server.
. A non blocking process starter with the features of Process.create_process without the need to use the wait() of Process.spawn (it works with callback functions).
-- David Gourdelier
/ Brevbäraren