Comment 7 for bug 331042

Revision history for this message
Chris Rossi (chris-archimedeanco) wrote : Re: [Bug 331042] Re: Send mail using repoze.sendmail for Invite New User

On Tue, Feb 24, 2009 at 8:25 PM, Paul Everitt <email address hidden> wrote:

>
> 1) Can we get a command line flag for qp that puts it in verbose mode?
> It is a bit scary to run it and see nothing happen. [wink]
>

Sure.

>
> 2) Related to that...what is the story for integration with Python
> logging, which is our story for logging?
>

It uses Python logging. The logger name is "QueueProcessor" if you wind up
manipulating it from Python code. Smtp errors are logged. There is also
one call to log.info to verify sending of a message but it looks like the
output is extraordinarily minimal: "Mail from %s to %s sent." I can
probably make that more informative. The zope.sendmail author has a comment
in there about adding message id. We could even go crazy and log the whole
message, I suppose. Disk is cheap, right? When the queue processor is run
as a console script, there is only a call to logging.basicConfig(), so I
think that means errors and warnings are sent to standard error and that's
about it. I can, of course, add options to kick up the verbosity (ie
include info level messages) and route the output to a file somewhere.

> 3) Can you explain how daemon mode works? Is it as simple as it sounds?
> And, does daemon have a story related to logging?
>

Daemon mode is a fancy name for infintite loop. It polls the queue, sends
emails, sleeps for interval seconds and then does it all over again. There
is not currently an init.d style start/stop/etc style command for
manipulating the process, although I suppose there could be. The logging
story for daemon mode is the same as the logging story for non-daemon (hit
it and quit?) mode. The couple of tweaks mentioned above would probably get
you what you want in terms of logging. I also found it helpful during
testing to monitor the log of my smtp daemon.

Chris