Unix Technical Forum

sendbug(1) patch

This is a discussion on sendbug(1) patch within the mailing.openbsd.tech forums, part of the OpenBSD category; --> Hi, I found some people suffer from the failure of sendbug(1). Because most of them did not (or had ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-15-2008, 08:30 PM
Dasn
 
Posts: n/a
Default sendbug(1) patch

Hi,

I found some people suffer from the failure of sendbug(1). Because most
of them did not (or had no permission to) configure their sendmail(1)
properly, I suppose.

The following patch in order to solve this problem by adding a new
environment variable, PR_AGENT, which allows users to specify their own
MTA instead of the default sendmail(1). For example:

$ export PR_AGENT="/usr/local/bin/msmtp -a my_obsd_account -t"
$ sendbug


diff -u /usr/src/gnu/usr.bin/sendbug/sendbug.1 sendbug/sendbug.1
--- /usr/src/gnu/usr.bin/sendbug/sendbug.1 Tue Aug 1 18:10:33 2006
+++ sendbug/sendbug.1 Sun Apr 13 10:12:21 2008
@@ -123,7 +123,7 @@
.Ox
bugs database.
.Sh ENVIRONMENT
-.Bl -tag -width "PR_FORM"
+.Bl -tag -width "PR_AGENT"
.It Ev EDITOR
Specifies the editor to invoke on the template.
The default editor is
@@ -132,6 +132,9 @@
Used as the file name of the template for your problem-report editing session.
You can use this to start with a partially completed form (for example,
a form with the identification fields already completed).
+.It Ev PR_AGENT
+The absolute path to the program which override the default Mail Transfer Agent
+to send the PR.
.El
.Sh HOW TO FILL OUT A PROBLEM REPORT

diff -u /usr/src/gnu/usr.bin/sendbug/sendbug.sh sendbug/sendbug.sh
--- /usr/src/gnu/usr.bin/sendbug/sendbug.sh Tue Nov 30 05:57:45 2004
+++ sendbug/sendbug.sh Sun Apr 13 09:54:21 2008
@@ -57,11 +57,17 @@

# What mailer to use. This must come after the config file, since it is
# host-dependent.
-if [ -f /usr/sbin/sendmail ]; then
- MAIL_AGENT="/usr/sbin/sendmail -oi -t"
+if [ X"$PR_AGENT" = X"" ]; then
+ if [ -f /usr/sbin/sendmail ]; then
+ MAIL_AGENT="/usr/sbin/sendmail -oi -t"
+ else
+ MAIL_AGENT="/usr/lib/sendmail -oi -t"
+ fi
else
- MAIL_AGENT="/usr/lib/sendmail -oi -t"
+ # A user defined mail transfer agent.
+ MAIL_AGENT="$PR_AGENT"
fi
+
MAILER=`echo $MAIL_AGENT | sed -e 's, .*,,'`
if [ ! -f "$MAILER" ]; then
echo "$COMMAND: Cannot find mail program \"$MAILER\"."
--
Dasn

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:13 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com