Przeglądaj źródła

fix CanonicalizeEmailAddress, configure MTA aliases, make apache listen on localhost only

Michael van Elst 22 lat temu
rodzic
commit
1b30e69090
3 zmienionych plików z 43 dodań i 1 usunięć
  1. 11 0
      rt/rt.patch
  2. 31 1
      rt/rt.spec
  3. 1 0
      rt/rtapache.conf

+ 11 - 0
rt/rt.patch

@@ -0,0 +1,11 @@
+--- lib/RT/User_Overlay.pm.dist	Wed Apr  2 14:44:58 2003
++++ lib/RT/User_Overlay.pm	Wed Apr  2 14:45:17 2003
+@@ -541,7 +541,7 @@
+     # coming from a subdomain as coming from second level domain
+     # foo.com
+     if ($RT::CanonicalizeEmailAddressMatch && $RT::CanonicalizeEmailAddressReplace ) {
+-        $email =~ s/\$RT::CanonicalizeEmailAddressMatch/$RT::CanonicalizeEmailAddressReplace/gi;
++        $email =~ s/$RT::CanonicalizeEmailAddressMatch/$RT::CanonicalizeEmailAddressReplace/gi;
+     }
+     return ($email);
+ }

+ 31 - 1
rt/rt.spec

@@ -47,7 +47,7 @@ Distribution: OpenPKG [EVAL]
 Group:        Database
 License:      GPL
 Version:      %{V_here}
-Release:      20030401
+Release:      20030402
 
 #   list of sources
 Source0:      http://www.cpan.org/modules/by-module/Log/Log-Dispatch-%{V_log_dispatch}.tar.gz
@@ -69,6 +69,7 @@ Source15:     rtapachectl
 Source16:     rtapache.conf
 Source17:     config.layout
 Source18:     rt-mailgate.sh
+Patch0:       rt.patch
 
 #   build information
 Prefix:       %{l_prefix}
@@ -105,6 +106,9 @@ AutoReqProv:  no
     %setup -q -T -D -a 8
     %setup -q -T -D -a 9
     %setup -q -T -D -a 10
+    ( cd rt-%{V_real}
+      %patch0 -p0
+    ) || exit $?
     %{l_shtool} install -c -m 0644 \
         -e 's;@l_prefix@;%{l_prefix};' \
         %{SOURCE config.layout} rt-%{V_real}/.
@@ -390,6 +394,20 @@ AutoReqProv:  no
     rm -rf $RPM_BUILD_ROOT
 
 %post
+    if [ $1 -eq 1 ]; then
+        #   activate in MTA configuration
+        mta_aliases_file=`%{l_prefix}/etc/rc --query mta_aliases_file`
+        mta_aliases_update=`%{l_prefix}/etc/rc --query mta_aliases_update`
+        if [ ".$mta_aliases_file" != . ]; then
+            (
+              echo "rt:              \"|%{l_prefix}/bin/rt-mailgate --action correspond --queue general --url http://127.0.0.1:8380/\""
+              echo "rt-comment:      \"|%{l_prefix}/bin/rt-mailgate --action comment --queue general --url http://127.0.0.1:8380/\""
+            ) | %{l_rpmtool} config -a -i "%{l_prefix}:%{name}" $mta_aliases_file
+        fi
+        if [ ".$mta_aliases_update" != . ]; then
+            eval $mta_aliases_update
+        fi
+    fi
     ( echo "To complete installation of the RT package please check the"
       echo "file '$RPM_INSTALL_PREFIX/etc/rt/RT_SiteConfig.pm'. In particular"
       echo "you have to assign a password to the RT database user."
@@ -406,7 +424,19 @@ AutoReqProv:  no
 
 %preun
     if [ $1 -eq 0 ]; then
+        #   stop perhaps still running server
         $RPM_INSTALL_PREFIX/etc/rc rt stop
+
+        #   deactivate in MTA configuration
+        mta_aliases_file=`%{l_prefix}/etc/rc --query mta_aliases_file`
+        mta_aliases_update=`%{l_prefix}/etc/rc --query mta_aliases_update`
+        if [ ".$mta_aliases_file" != . ]; then
+            %{l_rpmtool} config -r -i "%{l_prefix}:%{name}" $mta_aliases_file
+        fi
+        if [ ".$mta_aliases_update" != . ]; then
+            eval $mta_aliases_update
+        fi
+
         rm -f $RPM_INSTALL_PREFIX/var/rt/mason-session/*
         rm -rf $RPM_INSTALL_PREFIX/var/rt/mason-data/*/*
         rm -f $RPM_INSTALL_PREFIX/var/rt/log/*

+ 1 - 0
rt/rtapache.conf

@@ -11,6 +11,7 @@ ServerTokens           Prod
 User                   @l_rusr@
 Group                  @l_rgrp@
 Port                   8380
+Listen                 127.0.0.1:8380
 
 #   runtime files
 PidFile           @l_prefix@/var/rt/run/apache.pid