Title: RE: C API for queueing messages

Hi,

Replies to your questions below.

>I don't know how zmailer does it, but qmail, postfix and sendmail
>all use a set*id program to protect their queue. (Does anyone know
>whether zmailer does a fork/exec under the covers of the API?)

No, it does not do a fork/exec under the covers. From my understanding
of the zmailer code, mail_open() it opens a file under an intermediate
queue directory called router and returns a FILE pointer for us to write the
message. Then a seperate router process picks up the message
from there. The advantage here is that there is very little over head in
writing a file as opposed a popen("sendmail -i -t") call.

>Have you measured that execing qmail-queue is "not very efficient" in
>the full context of your system or are you surmising this?

Yes, we have done a lot of timing analysis and it was found that in excess
of 50% of the processing time is being spent in the code segment of the
application that invokes the sendmail exe thro popen(). We also explored
the possibilities of using fork(), which is faster. But we are afraid that
the system might run out of ulimit with all these small processes spawned.

So now I understand why qmail does not have an API because otherwise
the security is compromised. Thanks for your email.

Regards,
- Jay


On Wed, Sep 13, 2000 at 11:58:04AM -0500, Jay Balakrishna wrote:
> Hi All,
> We are trying to find out what is the most efficient way of queueing the
> message in qmail from our C Programs. So, would like to know if there are
> any C API's that are available for queuing messages. Basically I am looking
> for library routines that act as the native submission interface(API) for
> qmail. I would like to use the API's from my C Program that we currently
> have where we compose and build the messages and to queue the email message
> directly. Something similar to mail_open() and mail_close() provided by
> zmailer where you can submit messages composed in the MSG_RFC822 format.
> I can always call sendmail wrapper for queue-Inject or queue-inject itself
> from my C program thro a popen() or system() call, but I want to avoid the
> overhead of starting a new UNIX process for each and every email that we
> send and also popen() is not very efficient.
> Any help will be appreciated. Any other ideas are also most welcome
> Thanks and Regards,
> - Jay
>

Reply via email to