You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-misc/rancid-git/files/rancid-2.3.8-mailprefix.patch

179 lines
5.7 KiB

--- rancid-2.3.8/bin/Makefile.am
+++ rancid-2.3.8/bin/Makefile.am
@@ -96,8 +96,6 @@
-e 's,@PERLV\@,$(PERLV),g' \
-e 's,@PERLV_PATH\@,$(PERLV_PATH),g' \
-e 's,@LG_PING_CMD\@,$(LG_PING_CMD),g' \
- -e 's,@ADMINMAILPLUS\@,$(ADMINMAILPLUS),g' \
- -e 's,@MAILPLUS\@,$(MAILPLUS),g' \
-e 's,@PACKAGE\@,$(PACKAGE),g' \
-e 's,@SVN_FSTYPE\@,$(SVN_FSTYPE),g' \
-e 's,@VERSION\@,$(VERSION),g' \
--- rancid-2.3.8/bin/control_rancid.in
+++ rancid-2.3.8/bin/control_rancid.in
@@ -118,8 +118,8 @@
fi
# the receipient(s) of diffs & mail options
-mailrcpt=${mailrcpt:-"@MAILPLUS@${GROUP}${MAILDOMAIN}"}; export mailrcpt
-adminmailrcpt=${adminmailrcpt:-"@ADMINMAILPLUS@${GROUP}${MAILDOMAIN}"};
+mailrcpt=${mailrcpt:-"${MAILPREFIX}${GROUP}${MAILDOMAIN}"}; export mailrcpt
+adminmailrcpt=${adminmailrcpt:-"${ADMINMAILPREFIX}${GROUP}${MAILDOMAIN}"};
export adminmailrcpt
set | grep MAILHEADERS= > /dev/null 2>&1
if [ $? -ne 0 ] ; then
--- rancid-2.3.8/bin/rancid-run.in
+++ rancid-2.3.8/bin/rancid-run.in
@@ -147,7 +147,7 @@
if [ -s $TMPDIR/.$GROUP.old ]
then
(
- echo "To: @ADMINMAILPLUS@${GROUP}${MAILDOMAIN}"
+ echo "To: ${ADMINMAILPREFIX}${GROUP}${MAILDOMAIN}"
echo "Subject: rancid hung - $GROUP"
echo "Precedence: bulk"
echo ""
--- rancid-2.3.8/configure.in
+++ rancid-2.3.8/configure.in
@@ -163,46 +163,6 @@
AC_SUBST(SVN_FSTYPE)
rd_cv_RCSSYS=$RCSSYS
-# Check for a preference for using mail addresses like rancid+group
-# instead of the standard rancid-group
-AC_MSG_CHECKING([whether mail addresses should be in the rancid+ form])
-AC_ARG_ENABLE(mail-plus,
- AS_HELP_STRING([--enable-mail-plus], [enable mail to rancid+ addresses, instead of rancid-]),
-[if test "$enable_mail_plus" = yes; then
- AC_MSG_RESULT(yes)
- MAILPLUS="rancid+"
- AC_SUBST(MAILPLUS)
-else
- AC_MSG_RESULT(no)
- MAILPLUS="rancid-"
- AC_SUBST(MAILPLUS)
-fi],
-[AC_MSG_RESULT(no)
- MAILPLUS="rancid-"
- AC_SUBST(MAILPLUS)
-])
-rd_cv_MAILPLUS=$MAILPLUS
-
-# Check for a preference for using mail addresses like rancid+admin-group
-# instead of the standard rancid-admin-group
-AC_MSG_CHECKING([whether admin mail addresses should be in the rancid-admin+ form])
-AC_ARG_ENABLE(adminmail-plus,
- AS_HELP_STRING([--enable-adminmail-plus], [enable mail to rancid-admin+ addresses, instead of rancid-admin-]),
-[if test "$enable_adminmail_plus" = yes; then
- AC_MSG_RESULT([rancid-admin+])
- ADMINMAILPLUS="rancid-admin+"
- AC_SUBST(ADMINMAILPLUS)
-else
- AC_MSG_RESULT([${MAILPLUS}admin-])
- ADMINMAILPLUS="${MAILPLUS}admin-"
- AC_SUBST(ADMINMAILPLUS)
-fi],
-[AC_MSG_RESULT([${MAILPLUS}admin-])
- ADMINMAILPLUS="${MAILPLUS}admin-"
- AC_SUBST(ADMINMAILPLUS)
-])
-rd_cv_ADMINMAILPLUS=$ADMINMAILPLUS
-
AC_PATH_PROG(DIRNAME,dirname,no)
# locate GNU diff (one supporting the -u option)
--- rancid-2.3.8/etc/rancid.conf.sample.in
+++ rancid-2.3.8/etc/rancid.conf.sample.in
@@ -71,6 +71,21 @@
# The number of devices to collect simultaneously.
#PAR_COUNT=5; export PAR_COUNT
#
+# Define the prefixes for regular and administrative email groups
+# configuration diffs will be emailed to {MAILPREFIX}{GROUPNAME}
+# eg. rancid-routers
+# problems/errors will be emailed to {ADMINMAILPREFIX}{GROUPNAME}
+# eg. rancid-admin-routers
+#
+MAILPREFIX="rancid-"; export MAILPREFIX
+ADMINMAILPREFIX="rancid-admin-"; export ADMINMAILPREFIX
+#
+# To use a delimiter-based system instead of email aliases,
+# comment the above 2 lines and uncomment the following two lines:
+#MAILPREFIX="rancid+"; export MAILPREFIX
+#ADMINMAILPREFIX="rancid-admin+"; export ADMINMAILPREFIX
+#
+#
# list of rancid groups
#LIST_OF_GROUPS="sl joebobisp"
# more groups...
--- rancid-2.3.8/man/Makefile.am
+++ rancid-2.3.8/man/Makefile.am
@@ -79,9 +79,7 @@
-e 's,@bindir\@,$(bindir),g' \
-e 's,@localstatedir\@,$(localstatedir),g' \
-e 's,@sysconfdir\@,$(sysconfdir),g' \
- -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
- -e 's,@ADMINMAILPLUS\@,$(ADMINMAILPLUS),g' \
- -e 's,@MAILPLUS\@,$(MAILPLUS),g'
+ -e 's,@pkgdatadir\@,$(pkgdatadir),g'
lg.conf.5: Makefile $(srcdir)/lg.conf.5.in
rm -f lg.conf.5 lg.conf.5.tmp; \
--- rancid-2.3.8/man/rancid.conf.5.in
+++ rancid-2.3.8/man/rancid.conf.5.in
@@ -81,6 +81,19 @@
are always filtered (e.g.: Alteon passwords).
.\"
.TP
+.B MAILPREFIX
+Sets the mail prefix that is used to generate group emails. Configuration
+diffs are emailed to an address of the form {MAILPREFIX}{GROUPNAME}
+eg. rancid-routers
+.sp
+Default: rancid-
+.B ADMINMAILPREFIX
+Sets the mail prefix that is used to generate admin group emails.
+problems/errors are emailed to an address of the form
+{ADMINMAILPREFIX}{GROUPNAME}
+eg. rancid-admin-routers
+.sp
+Default: rancid-admin-
.B LIST_OF_GROUPS
Defines a list of group names of routers separated by white-space. These
names become the directory names in $BASEDIR which contain the data
@@ -104,10 +117,10 @@
.sp
.in +1i
.nf
-@MAILPLUS@uofo: frank
-@ADMINMAILPLUS@uofo: joe,bob
-@MAILPLUS@usfs: frank
-@ADMINMAILPLUS@usfs: joe,bob
+rancid-uofo: frank
+rancid-admin-uofo: joe,bob
+randid-usfs: frank
+rancid-admin-usfs: joe,bob
.fi
.sp
.in -1i
@@ -129,7 +142,7 @@
.B MAILDOMAIN
Define the domain part of addresses for administrative and diff e-mail.
The value of this variable is simply appended to the normal mail addresses.
-For example @MAILPLUS@usfs@example.com, if
+For example rancid-usfs@example.com, if
.B MAILDOMAIN
had been set to "@example.com".
.\"
--- rancid-2.3.8/share/downreport.in
+++ rancid-2.3.8/share/downreport.in
@@ -73,7 +73,7 @@
for GROUP in $LIST_OF_GROUPS; do
(
- echo "To: @MAILPLUS@admin-$GROUP"
+ echo "To: ${ADMINMAILPREFIX}$GROUP"
echo "Subject: Down router report - $GROUP"
echo "$MAILHEADERS" | awk '{gsub(/\\n/,"\n");print;}'
echo ""