Quelle DEBUG_README.html
Sprache: HTML
|
|
| products/Sources/formale Sprachen/C/Postfix/proto/DEBUG_README.html |
 |
<! doctype1
"https&t;$onfig_directory$$.og &; java.lang.StringIndexOutOfBoundsException: Range [73, 74) out of bounds for length 73
<html>
<head>
<title> Postfix Debugging effective>
<meta http-equiv="java.lang.StringIndexOutOfBoundsException: Index 22 out of bound s for length 0
<link rel='is created, named after the daemon and process ID (for example,
</head>
<body>
<h1><img src="postfix-logo.jpg" width="203" height="98" ALT="">Postfix Debugging Howto</h1>
<>
<h2>Purpose of this document</h2>
<p> This document describes how to fromthe "b>here</> command written toits logfilejava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
ctation. The methods
vary from making Postfix log a lot of java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 0
processes under control of a call tracer or debugger. </p>
<p> The text assumes code. Why can a program the
are storedin // can
use the command "<b>postconf config_directory</b
actual location of this<ul>
<p> Listed in java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
techniques are as follows: </p>
<ul>
<li><a href="#logging">Look for java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 0
<li><a href="#trace_mail">Debugging Postfix from inside</a>
<li><a href="#no_chroot
master.cf</a>
<li><a href="p> both ,the program being isnot
connections</a>
<i< href"sniffer" the SMTP with network
sniffer</a>
<li>
<li><a href="#< is third possibility:</>
<li><a href="#java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
process</a>
<li><a href="#ddd">Running daemon programs with the interactive
ddd debugger</a>
<java.lang.StringIndexOutOfBoundsException: Range [0, 3) out of bounds for length 0
gdb debugger</a>
<li><a href="#gdb">Running daemon programs under a non-interactive
debugger</>
<li><a href="#unreasonable">Unreasonable behavior</a>
<li><little java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 66
</ul>
<h2><a name="loggingthe can detect memoryerrors.Otherwise Postfix
<p> will just be waiting to be hit by a bit error. Critical systems
<ul>
<li> <p> When Postfix uses syslog logging (the java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 0
l,or
similar; the exact pathname is configured whenever the resulting program is run. Compiler errors are most
/likely happen inthe code optimizer aproblemis
<li> <p> When Postfixsystem ,it be to
the location of the logfile is optimization,to optimization
parameter. </p>
</>
<p> When Postfix does not receive or deliver mail, the first order
of tolook for errors that prevent from
properly: </p>
<java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
<pre>
% <b>grep -E '(warning|error<>
</pre>
</java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 5
<p> Note%<bmakefiles<b
output. Error <>
<p> The nature of each problem is indicated as follows: </p>
<ul>
<li> <p>. />
that only a programmer can fix. java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 0
is fixed. </p>
<li> <p> "<b>fatal</b>" is the result of
permissions configuration file settings that you can
fix. Postfix cannot proceed until this<
<li> <% <b>ma/>
reasons, a Postfix process will terminate when more than bsubjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
happenjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
<java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
problemsjava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 62
server elsewhere on the network) but may forhelp /p
configuration errors h2><a name="mail">Reporting problems to postfix-users@postfix.org</a></h2>
p> Thewho onpostfixusersp.
<h2><are vehelpful, providethemwithsufficient
<p> informationjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 65
java.lang.StringIndexOutOfBoundsException: Range [13, 7) out of bounds for length 67
not only showjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 62
and alias expansion
delivery>
from java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
</p>
<p> Postfix can produce two types of mail delivery logging without explanation of what YOU believe is wrong. </p>
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 15
<ul>
<li> <p> What-if: report
eliverjava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 60
<pre>
% to out logging stored donotfrustrate
Mail Delivery Status Reportthehelperswordwrapping logging thelogging ismore
</pre>
<li> <p> What happened: deliver mail and report successes and/or
failures, including replies from remote SMTP servers. This mode
of operation is requested with: </p>
<pre>
% <b>/usr/sbin/sendmail -v address...</b>
Mail Delivery Status Report will be mailed to <your login name>.
</pre>
</ul>
<p> These reports contain information that is generated by Postfix
delivery agents. Since these run as site.<p
interact with users directly p Consideratestemail sothatyoudonthave
sender to . /
identical to that of ordinary non-java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
<p> For a detailed example of a mail delivery status report, see
the <a href="ADDRESS_REWRITING_README.html#debugging"> debugging</a>
section at the end of the ADDRESS_REWRITING_README document. </p>
<h2><a name="no_chroot">Try turning off chroot operation in master.cf</a></h2>
<p> A by "A", each digit
file without going through all the necessary steps to set by"" sothat helpers errorsjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
chroot environment. This java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
issingp
<p> The example below shows1000 of<postconfcommand /
chroot turned off: <lip "b>java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 59
<java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
<pre>
/etc/postfix/mastercan :gcom/ford-postfinger />
# ===
# service type isSASL including
#java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 60
#================================
smtp inet n - <b>n</b> - - smtpd
<java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 6
</blockquote>
<java.lang.StringIndexOutOfBoundsException: Range [11, 2) out of bounds for length 66
not turned off. If you find any
and edit the li> <p> If thejava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 66
"> /b,seethe .p
<p> If turning off chrooted operation made recordingasessionwith <tcpdumpb, the<
java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 61
adequate forjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
the Postfix <a href="BASIC_CONFIGURATION_README.html#chroot_setup">
BASIC_CONFIGURATION_README</a> file for information about how to
prepare Postfix for chrooted operation. </p>
<h2><a name="debug_peer">Verbose logging for specific SMTP
connections</a></h2>
<p> In /etc/postfix/main.cf, list the remote site name or address
in the debug_peer_list parameter. For example, in order to make
the software log a lot of information to the syslog daemon for
connections from or to the loopback interface: </p>
<blockquote>
<pre>
/etc/postfix/main.cf:
debug_peer_list = 127.0.0.1
</pre>
</blockquote>
<p> You can specify one or more hosts, domains, addresses or
net/masks. To make the change effective immediately, execute the
command "<b>postfix reload</b>". </p>
<h2><a name="sniffer">Record the SMTP session with a network sniffer</a></h2>
<p> This example uses <b>tcpdump</b>. In order to record a conversation
you need to specify a large enough buffer with the "<b>-s</b>"
option or else you will miss some or all of the packet payload.
</p>
<blockquote>
<pre>
# <b>tcpdump -w /file/name -s 0 host example.com and port 25</b>
</pre>
</blockquote>
<p> Older tcpdump versions don't support "<b>-s 0</b>"; in that case,
use "<b>-s 2000</b>" instead. </p>
<p> Run this for a while, stop with Ctrl-C when done. To view the
data use a binary viewer, <b>ethereal</b>, or good old <b>less</b>.
</p>
<h2><a name="verbose">Making Postfix daemon programs more verbose</a></h2>
<p> Append one or more "<b>-v</b>" options to selected daemon
definitions in /etc/postfix/master.cf and type "<b>postfix reload</b>".
This will cause a lot of activity to be logged to the syslog daemon.
For example, to make the Postfix SMTP server process more verbose: </p>
<blockquote>
<pre>
/etc/postfix/master.cf:
smtp inet n - n - - smtpd -v
</pre>
</blockquote>
<p> To diagnose problems with address rewriting specify a "<b>-v</b>"
option for the cleanup(8) and/or trivial-rewrite(8) daemon, and to
diagnose problems with mail delivery specify a "<b>-v</b>"
option for the qmgr(8) or oqmgr(8) queue manager, or for the lmtp(8),
local(8), pipe(8), smtp(8), or virtual(8) delivery agent. </p>
<h2><a name="man_trace">Manually tracing a Postfix daemon process</a></h2>
<p> Many systems allow you to inspect a running process with a
system call tracer. For example: </p>
<blockquote>
<pre>
# <b>trace -p process-id</b> (SunOS 4)
# <b>strace -p process-id</b> (Linux and many others)
# <b>truss -p process-id</b> (Solaris, FreeBSD)
# <b>ktrace -p process-id</b> (generic 4.4BSD)
</pre>
</blockquote>
<p> Even more informative are traces of system library calls.
Examples: </p>
<blockquote>
<pre>
# <b>ltrace -p process-id</b> (Linux, also ported to FreeBSD and BSD/OS)
# <b>sotruss -p process-id</b> (Solaris)
</pre>
</blockquote>
<p> See your system documentation for details. </p>
<p> Tracing a running process can give valuable information about
what a process is attempting to do. This is as much information as
you can get without running an interactive debugger program, as
described in a later section. </p>
<h2><a name="auto_trace">Automatically tracing a Postfix daemon
process</a></h2>
<p> Postfix can attach a call tracer whenever a daemon process
starts. Call tracers come in several kinds. </p>
<ol>
<li> <p> System call tracers such as <b>trace</b>, <b>truss</b>,
<b>strace</b>, or <b>ktrace</b>. These show the communication
between the process and the kernel. </p>
<li> <p> Library call tracers such as <b>sotruss</b> and <b>ltrace</b>.
These show calls of library routines, and give a better idea of
what is going on within the process. </p>
</ol>
<p> Append a <b>-D</b> option to the suspect command in
/etc/postfix/master.cf, for example: </p>
<blockquote>
<pre>
/etc/postfix/master.cf:
smtp inet n - n - - smtpd -D
</pre>
</blockquote>
<p> Edit the debugger_command definition in /etc/postfix/main.cf
so that it invokes the call tracer of your choice, for example:
</p>
<blockquote>
<pre>
/etc/postfix/main.cf:
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin;
(truss -p $process_id 2>&1 | logger -p mail.info) & sleep 5
</pre>
</blockquote>
<p> Type "<b>postfix reload</b>" and watch the logfile. </p>
<h2><a name="ddd">Running daemon programs with the interactive
ddd debugger</a></h2>
<p> If you have X Windows installed on the Postfix machine, then
an interactive debugger such as <b>ddd</b> can be convenient.
</p>
<p> Edit the debugger_command definition in /etc/postfix/main.cf
so that it invokes <b>ddd</b>: </p>
<blockquote>
<pre>
/etc/postfix/main.cf:
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
</pre>
</blockquote>
<p> Be sure that <b>gdb</b> is in the command search path, and
export <b>XAUTHORITY</b> so that X access control works, for example:
</p>
<blockquote>
<pre>
% <b>setenv XAUTHORITY ~/.Xauthority</b> (csh syntax)
$ <b>export XAUTHORITY=$HOME/.Xauthority</b> (sh syntax)
</pre>
</blockquote>
<p> Append a <b>-D</b> option to the suspect daemon definition in
/etc/postfix/master.cf, for example: </p>
<blockquote>
<pre>
/etc/postfix/master.cf:
smtp inet n - n - - smtpd -D
</pre>
</blockquote>
<p> Stop and start the Postfix system. This is necessary so that
Postfix runs with the proper <b>XAUTHORITY</b> and <b>DISPLAY</b>
settings. </p>
<p> Whenever the suspect daemon process is started, a debugger
window pops up and you can watch in detail what happens. </p>
<h2><a name="screen">Running daemon programs with the interactive
gdb debugger</a></h2>
<p> If you have the screen command installed on the Postfix machine, then
you can run an interactive debugger such as <b>gdb</b> as follows. </p>
<p> Edit the debugger_command definition in /etc/postfix/main.cf
so that it runs <b>gdb</b> inside a detached <b>screen</b> session:
</p>
<blockquote>
<pre>
/etc/postfix/main.cf:
debugger_command =
PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH; HOME=/root;
export HOME; screen -e^tt -dmS $process_name gdb
$daemon_directory/$process_name $process_id & sleep 2
</pre>
</blockquote>
<p> Be sure that <b>gdb</b> is in the command search path. </p>
<p> Append a <b>-D</b> option to the suspect daemon definition in
/etc/postfix/master.cf, for example: </p>
<blockquote>
<pre>
/etc/postfix/master.cf:
smtp inet n - n - - smtpd -D
</pre>
</blockquote>
<p> Execute the command "<b>postfix reload</b>" and wait until a
daemon process is started (you can see this in the maillog file).
</p>
<p> Then attach to the screen, and debug away: </p>
<blockquote>
<pre>
# HOME=/root screen -r
gdb) continue
gdb) where
</pre>
</blockquote>
<h2><a name="gdb">Running daemon programs under a non-interactive
debugger</a></h2>
<p> If you do not have X Windows installed on the Postfix machine,
or if you are not familiar with interactive debuggers, then you
can try to run <b>gdb</b> in non-interactive mode, and have it
print a stack trace when the process crashes. </p>
<p> Edit the debugger_command definition in /etc/postfix/main.cf
so that it invokes the <b>gdb</b> debugger: </p>
<blockquote>
<pre>
/etc/postfix/main.cf:
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont; echo
where; sleep 8640000) | gdb $daemon_directory/$process_name
$process_id 2>&1
>$config_directory/$process_name.$process_id.log & sleep 5
</pre>
</blockquote>
<p> Append a <b>-D</b> option to the suspect daemon in
/etc/postfix/master.cf, for example: </p>
<blockquote>
<pre>
/etc/postfix/master.cf:
smtp inet n - n - - smtpd -D
</pre>
</blockquote>
<p> Type "<b>postfix reload</b>" to make the configuration changes
effective. </p>
<p> Whenever a suspect daemon process is started, an output file
is created, named after the daemon and process ID (for example,
smtpd.12345.log). When the process crashes, a stack trace (with
output from the "<b>where</b>" command) is written to its logfile.
</p>
<h2><a name="unreasonable">Unreasonable behavior</a></h2>
<p> Sometimes the behavior exhibited by Postfix just does not match the
source code. Why can a program deviate from the instructions given
by its author? There are two possibilities. </p>
<ul>
<li> <p> The compiler has erred. This rarely happens. </p>
<li> <p> The hardware has erred. Does the machine have ECC memory? </p>
</ul>
<p> In both cases, the program being executed is not the program
that was supposed to be executed, so anything could happen. </p>
<p> There is a third possibility: </p>
<ul>
<li> <p> Bugs in system software (kernel or libraries). </p>
</ul>
<p> Hardware-related failures usually do not reproduce in exactly
the same way after power cycling and rebooting the system. There's
little Postfix can do about bad hardware. Be sure to use hardware
that at the very least can detect memory errors. Otherwise, Postfix
will just be waiting to be hit by a bit error. Critical systems
deserve real hardware. </p>
<p> When a compiler makes an error, the problem can be reproduced
whenever the resulting program is run. Compiler errors are most
likely to happen in the code optimizer. If a problem is reproducible
across power cycles and system reboots, it can be worthwhile to
rebuild Postfix with optimization disabled, and to see if optimization
makes a difference. </p>
<p> In order to compile Postfix with optimizations turned off: </p>
<blockquote>
<pre>
% <b>make tidy</b>
% <b>make makefiles OPT=</b>
</pre>
</blockquote>
<p> This produces a set of Makefiles that do not request compiler
optimization. </p>
<p> Once the makefiles are set up, build the software: </p>
<blockquote>
<pre>
% <b>make</b>
% <b>su</b>
Password:
# <b>make install</b>
</pre>
</blockquote>
<p> If the problem goes away, then it is time to ask your vendor
for help. </p>
<h2><a name="mail">Reporting problems to postfix-users@postfix.org</a></h2>
<p> The people who participate on postfix-users@postfix.org
are very helpful, especially if YOU provide them with sufficient
information. Remember, these volunteers are willing to help, but
their time is limited. </p>
<p> When reporting a problem, be sure to include the following
information. </p>
<ul>
<li> <p> A summary of the problem. Please do not just send some
logging without explanation of what YOU believe is wrong. </p>
<li> <p> Complete error messages. Please use cut-and-paste, or use
attachments, instead of reciting information from memory.
</p>
<li> <p> Postfix logging. See the text at the top of the DEBUG_README
document to find out where logging is stored. Please do not frustrate
the helpers by word wrapping the logging. If the logging is more
than a few kbytes of text, consider posting an URL on a web or ftp
site. </p>
<li> <p> Consider using a test email address so that you don't have
to reveal email addresses or passwords of innocent people. </p>
<li> <p> If you can't use a test email address, please anonymize
email addresses and host names consistently. Replace each letter
by "A", each digit
by "D" so that the helpers can still recognize syntactical errors.
</p>
<li> <p> Command output from:</p>
<ul>
<li> <p> "<b>postconf -n</b>". Please do not send your main.cf file,
or 1000+ lines of <b>postconf</b> command output. </p>
<li> <p> "<b>postconf -Mf</b>" (Postfix 2.9 or later). </p>
</ul>
<li> <p> Better, provide output from the <b>postfinger</b> tool.
This can be found at https://github.com/ford--prefect/postfinger. </p>
<li> <p> If the problem is SASL related, consider including the
output from the <b>saslfinger</b> tool. This can be found at
https://packages.debian.org/search?keywords=sasl2-bin. </p>
<li> <p> If the problem is about too much mail in the queue, consider
including output from the <b>qshape</b> tool, as described in the
QSHAPE_README file. </p>
<li> <p> If the problem is protocol related (connections time out,
or an SMTP server complains about syntax errors etc.) consider
recording a session with <b>tcpdump</b>, as described in the <a
href="#sniffer">DEBUG_README</a> document. </ul>
</body>
</html>
¤ Dauer der Verarbeitung: 0.3 Sekunden
(vorverarbeitet am 2026-11-24)
¤
*© Formatika GbR, Deutschland
|
|
2026-11-24
|