The only legitimate API is to invoke qmail-queue via the exec() system
call. This is because qmail-queue is setuid qmailq. In other words, it
provides a security barrier to the queue. If you bypass qmail-queue all
your programs that call the API will need to be setuid qmailq thus
making your queue vulnerable to all those programs.

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?)

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

Note that the full cost of injecting a mail securely on the queue is
probably greater than the cost of a fork/exec of qmail-queue so an
API that bypasses qmail-queue may not gain you that much.


Regards.


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