Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 277946 - mail-mta/netqmail-1.06: add LOGLEVEL env support
Summary: mail-mta/netqmail-1.06: add LOGLEVEL env support
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Qmail Team (OBSOLETE)
URL: http://www.nrg4u.com/qmail/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-15 14:40 UTC by Martin Mokrejš
Modified: 2009-07-15 18:47 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2009-07-15 14:40:56 UTC
The patch from http://www.nrg4u.com/qmail/qmail-ldap-1.03-20060201.patch.gz contains nice support the multiple LOGLEVELs for several qmail parts, including qmail-pop3d. I think even those of use NOT using LDAP would happily use this patch over netqmail-1.06 due to these improvements.

The new env variables should go into /var/qmail/control/conf-common or specifically into the service control files (e.g. /var/qmail/control/conf-common):

# http://www.nrg4u.com/qmail/QLDAPINSTALL
# 10. Debugging: as said befor you can compile qmail-lspawn and the auth modules
#    with a flexible debugging facility (option DEBUG).
#    The debug output gets logged through splogger or your favorite logging tool
#    connected to stderr for tcpserver-pop/imap chain.
#    To turn on debugging you need only to define the LOGLEVEL environment
#    variable (e.g. with env, env LOGLEVEL=3 qmail-start ...)
#    There are these LOGLEVEL:
#    LOGLEVEL=1   -> Errors
#    LOGLEVEL=2   -> Warnings
#    LOGLEVEL=4   -> Info
#    LOGLEVEL=8   -> Info^2
#    LOGLEVEL=16  -> Debug
#    LOGLEVEL=32  -> Debug^2
#    LOGLEVEL=64  -> LDAP Debug
#    LOGLEVEL=128 -> LDAP Debug^2
#    LOGLEVEL=256 -> PASSWD, this level is normaly off because it shows
#                    critical data (unencrypted and crypted passwords). To
#                    turn it on edit checkpassword.c and increase the level
#                    for init_debug(). 
#     WARNING: on production machines don't use levels higher 3 or you will get
#              incredible huge logfiles.
#     NOTE: too high debuglevels are reduced to the maximum allowed debug level
#           if the level parameter in init_debug() is smaler.
#           The LOGLEVEL is compare with a bit mask, so that
#           LOGLEVEL=3 will report warnings and errors but LOGLEVEL=2 will
#           only report warnings.
#           With the new log support the environment variable is LOGLEVEL but
#           the old DEBUGLEVEL is still supported.
#           The new log support will no longer add the log output to bounce
#           messages. 
LOGLEVEL="16"




Into /var/qmail/control/conf-pop3d coudl go:

# POP3_LOGLEVEL
#  Level of log verbosity in qmail-pop3d.
# Default: 0 (NULL)
# Affects: qmail-pop3d
# Example: 3
# Levels:
#      0 = no logging
#      1 = fatal errors
#      2 = login/logout accounting
#      3 = session errors
#      4 = verbose
# Note: integer value, everything will be logged through tcpserver
# Note2: this is a hack so that this log level does not interfere with the one
#         of auth_pop. 
POP3_LOGLEVEL=4


If you do not like to apply the whole patch, I propose picking up the changes for qmail-pop3d.sh, qmail-popup.c, qmail-pop3d.c, qmail-pop3d-ssl.sh, spawn.c, qmail-smtpd.c, qmail-smtpd.sh and forcing -DDEBUG in CFLAGS.

I haven't actually ripped the patch to test which parts of the patch can be left out. The above list of files to be patched I have just spotted down while glancing over the patch while searching for DEBUG and LOGLEVEL. As I have said, people not using LDAP do not care that the ldap stuff was patched for them and will happily take the advantage of the other improvements.
Comment 1 Benedikt Böhm (RETIRED) gentoo-dev 2009-07-15 18:47:54 UTC
we do not add tons of patches to qmail anymore, if you like to patch, have a look at portage autopatch support via bashrc