On Fri, May 18, 2001 at 10:16:41AM -0500, dan . kelley wrote:
> 
> hi-
> 
> I've started to hack around with qmail-inject.c a bit. i'm trying to modify 
> the file to optionally look for a "control/addmessage" file, the contents of 
> which will be appended to every locally generated message.  

Right. So that won't catch messages submitted via SMTP from your local
(windows) clients. I presume that's ok? If you're not sure about where
qmail-inject and friends fit into the scheme of things, carefully read
and understand all of the PIC.* files in the qmail source before
proceeding.

I also assume you're aware of the MIME related issues in trying to do
this. It's been discussed many times on this list - the archives are
your friend.

> i'm having some difficulty tacking the addmessage onto the message as it 
> passes through qmail-inject, so i'm trying to insert some simple logging 
> messages so i can follow the execution of  qmail-inject.
> 
> one thing that i'm having a difficult time following:  it looks like Dan 
> Berenstein's logging architecture for qmail is broken down into 3 pretty 
> simple calls:

Well, qmail-inject doesn't log particularly. It's meant to be invoked
from a shell and thus informs you of results via stderr and the exit
code.

> (from qsutil.c)
> void log1(s1) char *s1; {
>  substdio_putsflush(&sserr,s1); }
> void log2(s1,s2) char *s1; char *s2; {
>  substdio_putsflush(&sserr,s1);
>  substdio_putsflush(&sserr,s2); }
> void log3(s1,s2,s3) char *s1; char *s2; char *s3; {
>  substdio_putsflush(&sserr,s1);
>  substdio_putsflush(&sserr,s2);
>  substdio_putsflush(&sserr,s3); }
> 
> from what i gather, all of these just write messages to stderr,
> and multilog/splogger are responsible for collecting them.

multilog is *nothing* like syslog. You just can't make a call to write
to stderr in one process such as qmail-inject and magically have it
show up with the output of some other process such as qmail-send.

> this line placed in void main(), before any other function.
> 
> log1("qmail-inject: started");

You might want to actually copy the way qmail-inject generates its
messages. Hint: search for the string "memory".


Regards.

Reply via email to