1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
|
#!/bin/sh
#
# File a bug against the Mutt mail user agent.
#
#
# $Id$
#
#
# Copyright (c) 2000 Thomas Roessler <roessler@does-not-exist.org>
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
SUBMIT="fleas@mutt.org"
DEBIAN_SUBMIT="submit@bugs.debian.org"
prefix=@prefix@
DEBUGGER=@DEBUGGER@
SENDMAIL=@SENDMAIL@
sysconfdir=@sysconfdir@
pkgdatadir=@pkgdatadir@
include_file ()
{
echo
echo "--- Begin $1"
sed -e '/^[ ]*#/d; /^[ ]*$/d; s/^-/- -/' $1
echo "--- End $1"
echo
}
debug_gdb ()
{
cat << EOF > $SCRATCH/gdb.rc
bt
list
quit
EOF
$DEBUGGER -n -x $SCRATCH/gdb.rc -c $CORE mutt
}
debug_dbx ()
{
cat << EOF > $SCRATCH/dbx.rc
where
list
quit
EOF
$DEBUGGER -s $SCRATCH/dbx.rc mutt $CORE
}
debug_sdb ()
{
cat << EOF > $SCRATCH/sdb.rc
t
w
q
EOF
$DEBUGGER mutt $CORE < $SCRATCH/sdb.rc
}
case `echo -n` in
"") n=-n; c= ;;
*) n=; c='\c' ;;
esac
exec > /dev/tty
exec < /dev/tty
SCRATCH=${TMPDIR-/tmp}/`basename $0`.`hostname`.$$
mkdir ${SCRATCH} || \
{
echo "`basename $0`: Can't create temporary directory." >& 2 ;
exit 1 ;
}
trap "rm -r -f ${SCRATCH} ; trap '' 0 ; exit" 0 1 2
TEMPLATE=${SCRATCH}/template.txt
if test -z "$EMAIL" ; then
EMAIL="`mutt -Q from 2> /dev/null | sed -e 's/^from=.\(.*\).$/\1/'`"
fi
EMAILTMP=''
while test -z "$EMAILTMP"
do
echo "Please enter your e-mail address [$EMAIL]:"
echo $n "> $c"
read EMAILTMP
if test -z "$EMAILTMP"; then EMAILTMP="$EMAIL"; fi
if ! echo "$EMAILTMP" | grep -q @
then
echo "$EMAILTMP does not appear to be a valid email address"
EMAILTMP=''
continue
fi
EMAIL="$EMAILTMP"
done
echo "Please enter a one-line description of the problem you experience:"
echo $n "> $c"
read SUBJECT
cat <<EOF
What should the severity for this bug report be?
0) Feature request, or maybe a bug which is very difficult to
fix due to major design considerations.
1) The package fails to perform correctly in some conditions,
or on some systems, or fails to comply with current policy
documents. Most bugs are in this category.
2) This bug makes this version of the package unsuitable for
a stable release.
3) Dangerous bug. Makes the package in question unusable by
anyone or mostly so, or causes data loss, or introduces a
security hole allowing access to the accounts of users who
use the package.
4) Critical bug. Makes unrelated software on the system (or
the whole system) break, or causes serious data loss, or
introduces a security hole on systems where you install the
package.
EOF
echo $n "Severity? [01234] $c"
read severity
case "$severity" in
0|[Ww]) severity=wishlist ;;
2|[Ii]) severity=important ;;
3|[Gg]) severity=grave ;;
4|[Cc]) severity=critical ;;
*) severity=normal ;;
esac
if test -x $DEBUGGER ; then
test -f core && CORE=core
echo "If mutt has crashed, it may have saved some program state in"
echo "a file named core. We can include this information with the bug"
echo "report if you wish so."
echo "Do you want to include information gathered from a core file?"
echo "If yes, please enter the path - otherwise just say no: [$CORE]"
echo $n "> $c"
read _CORE
test "$_CORE" && CORE="$_CORE"
fi
echo $n "Do you want to include your personal mutt configuration files? [Y|n] $c"
read personal
case "$personal" in
[nN]*) personal=no ;;
*) personal=yes ;;
esac
echo $n "Do you want to include your system's global mutt configuration file? [Y|n] $c"
read global
case "$global" in
[nN]*) global=no ;;
*) global=yes ;;
esac
if test -f /etc/debian_version ; then
DEBIAN=yes
echo $n "Checking whether mutt has been installed as a package... $c"
DEBIANVERSION="`dpkg -l mutt | grep '^[ih]' | awk '{print $3}'`" 2> /dev/null
if test "$DEBIANVERSION" ; then
DPKG=yes
else
DPKG=no
unset DEBIANVERSION
fi
echo "$DPKG"
echo $n "File this bug with Debian? [Y|n] $c"
read DPKG
case "$DPKG" in
[nN]) DPKG=no ;;
*) DPKG=yes ;;
esac
else
DEBIAN=no
DPKG=no
fi
if rpm -q mutt > /dev/null 2> /dev/null ; then
echo "Mutt seems to come from an RPM package."
RPMVERSION="`rpm -q mutt`"
RPMPACKAGER="`rpm -q -i mutt | sed -n -e 's/^Packager *: *//p'`"
fi
MUTTVERSION="`mutt -v | awk '{print $2; exit; }'`"
test "$DPKG" = "yes" && SUBMIT="$SUBMIT, $DEBIAN_SUBMIT"
exec > ${TEMPLATE}
test "$EMAIL" && echo "From: $EMAIL"
test "$REPLYTO" && echo "Reply-To: $REPLYTO"
test "$ORGANIZATION" && echo "Organization: $ORGANIZATION"
echo "Subject: mutt-$MUTTVERSION: $SUBJECT"
echo "To: $SUBMIT"
test "$EMAIL" && echo "Bcc: ${EMAIL}"
echo
echo "Package: mutt"
echo "Version: ${DEBIANVERSION-${RPMVERSION-$MUTTVERSION}}"
echo "Severity: $severity"
echo
echo "-- Please type your report below this line"
echo
echo
echo
if test "$DEBIAN" = "yes" ; then
echo "Obtaining Debian-specific information..." > /dev/tty
bug -p -s dummy mutt < /dev/null 2> /dev/null | \
sed -n -e "/^-- System Information/,/^---/p" | \
grep -v '^---'
else
echo "-- System Information"
echo "System Version: `uname -a`"
test -z "$RPMPACKAGER" || echo "RPM Packager: $RPMPACKAGER";
test -f /etc/redhat-release && echo "RedHat Release: `cat /etc/redhat-release`"
test -f /etc/SuSE-release && echo "SuSE Release: `sed 1q /etc/SuSE-release`"
# Please provide more of these if you have any.
fi
echo
echo "-- Build environment information"
echo
echo "(Note: This is the build environment installed on the system"
echo "muttbug is run on. Information may or may not match the environment"
echo "used to build mutt.)"
echo
echo "- gcc version information"
echo "@CC@"
@CC@ -v 2>&1
echo
echo "- CFLAGS"
echo @CFLAGS@
echo
echo "-- Mutt Version Information"
echo
LC_ALL=C mutt -v
if test "$CORE" && test -f "$CORE" ; then
echo
echo "-- Core Dump Analysis Output"
echo
case "$DEBUGGER" in
*sdb) debug_sdb $CORE ;;
*dbx) debug_dbx $CORE ;;
*gdb) debug_gdb $CORE ;;
esac
echo
fi
if test "$personal" = "yes" ; then
CANDIDATES=".muttrc-${MUTTVERSION} .muttrc .mutt/muttrc-${MUTTVERSION} .mutt/muttrc"
MATCHED="none"
for f in $CANDIDATES; do
if test -f "${HOME}/$f" ; then
MATCHED="${HOME}/$f"
break
fi
done
if test "$MATCHED" = "none" ; then
echo "Warning: Can't find your personal .muttrc." >&2
else
include_file $MATCHED
fi
fi
if test "$global" = "yes" ; then
CANDIDATES="Muttrc-${MUTTVERSION} Muttrc"
DIRECTORIES="$sysconfdir $pkgdatadir"
MATCHED="none"
for d in $DIRECTORIES ; do
for f in $CANDIDATES; do
if test -f $d/$f ; then
MATCHED="$d/$f"
break
fi
done
test "$MATCHED" = "none" || break
done
if test "$MATCHED" = "none" ; then
echo "Warning: Can't find global Muttrc." >&2
else
include_file $MATCHED
fi
fi
exec > /dev/tty
cp $TEMPLATE $SCRATCH/mutt-bug.txt
input="e"
while : ; do
if test "$input" = "e" ; then
${VISUAL-${EDITOR-vi}} $SCRATCH/mutt-bug.txt
if cmp $SCRATCH/mutt-bug.txt ${TEMPLATE} > /dev/null ; then
echo "Warning: Bug report was not modified!"
fi
fi
echo $n "Submit, Edit, View, Quit? [S|e|v|q] $c"
read _input
input="`echo $_input | tr EVSQ evsq`"
case $input in
e*) ;;
v*) ${PAGER-more} $SCRATCH/mutt-bug.txt ;;
s*|"") $SENDMAIL -t < $SCRATCH/mutt-bug.txt ; exit ;;
q*) exit
esac
done
|