Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bestpractical/rt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Sibley <trs@bestpractical.com>2013-06-14 03:11:25 +0400
committerThomas Sibley <trs@bestpractical.com>2013-06-14 03:11:25 +0400
commitce5f72fbdc8bf043d45a1c09fa1c2af807a08695 (patch)
treee610cf290f5782647ff4158763061178f0f43afa
parent34697a857b95154a39ae7b91f1a5c1b4cc753a4e (diff)
parentfa380654e2182145eb363b8b45f446579fd5e40d (diff)
Merge branch '4.0-trunk'rt-4.1.13
Conflicts: devel/tools/rt-apache "Alias" lines removed on master appeared in hunk context
-rwxr-xr-xdevel/tools/rt-apache7
-rw-r--r--docs/UPGRADING-4.016
-rwxr-xr-xetc/RT_Config.pm.in15
-rw-r--r--lib/RT/Classes.pm9
-rw-r--r--lib/RT/Interface/Email.pm15
-rw-r--r--lib/RT/Pod/HTML.pm4
-rw-r--r--lib/RT/Principals.pm1
-rw-r--r--lib/RT/URI.pm2
-rw-r--r--sbin/rt-setup-database.in7
9 files changed, 65 insertions, 11 deletions
diff --git a/devel/tools/rt-apache b/devel/tools/rt-apache
index 6c593a82ab..cd33246443 100755
--- a/devel/tools/rt-apache
+++ b/devel/tools/rt-apache
@@ -148,6 +148,7 @@ my @opts = ("-f", $conf, "-D" . uc($mod) );
push @opts, "-DSSL" if $opt{ssl};
push @opts, "-DRT3" if $opt{rt3};
push @opts, "-DSINGLE" if $opt{single};
+push @opts, "-DREDIRECT" if $path;
# Wait for a previous run to terminate
if ( open( PIDFILE, "<", "$opt{root}/var/apache2.pid") ) {
@@ -330,6 +331,12 @@ DocumentRoot $RTHOME/share/html
Allow from all
</Directory>
+<IfDefine REDIRECT>
+ LoadModule rewrite_module $MODULES/mod_rewrite.so
+ RewriteEngine on
+ RewriteRule ^(?!\Q$PATH\E) - [R=404]
+</IfDefine>
+
<IfDefine !RT3>
########## 4.0 mod_perl
<IfDefine PERL>
diff --git a/docs/UPGRADING-4.0 b/docs/UPGRADING-4.0
index 687dfbc611..9bca8f1de9 100644
--- a/docs/UPGRADING-4.0
+++ b/docs/UPGRADING-4.0
@@ -189,3 +189,19 @@ these types before insertion.
Site-specific custom types (anything but ticket, reminder or approval)
are not affected by these changes.
+
+=head1 UPGRADING FROM 4.0.13 AND EARLIER
+
+The "Default" key of the C<$OverrideOutgoingMailFrom> config option now,
+as previously documented, only applies when no ticket is involved.
+Previously it was also used when a ticket was involved but the
+associated queue had no specific correspond address. In such cases the
+global correspond address is now used.
+
+The config option C<$SetOutgoingMailFrom> now accepts an email address
+as a value which will act as a global default. This covers the simple
+case of sending all bounces to a specific address, without the previous
+solution of resorting to defining all queues in
+$OverrideOutgoingMailFrom. Any definitions in the Override option
+(including Default) still take precedence. See
+L<RT_Config/$SetOutgoingMailFrom> for more information.
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 6b74cb3758..345a747ae9 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -520,6 +520,15 @@ world, you can set C<$MailCommand> to 'testfile' which writes all mail
to a temporary file. RT will log the location of the temporary file
so you can extract mail from it afterward.
+On shutdown, RT will clean up the temporary file created when using
+the 'testfile' option. If testing while the RT server is still running,
+you can find the files in the location noted in the log file. If you run
+a tool like C<rt-crontool> however, or if you look after stopping the server,
+the files will have been deleted when the process completed. If you need to
+keep the files for development or debugging, you can manually set
+C<< UNLINK => 0 >> where the testfile config is processed in
+F<lib/RT/Interface/Email.pm>.
+
=cut
Set($MailCommand, "sendmailpipe");
@@ -532,6 +541,12 @@ Correspond mail address of the ticket's queue.
Warning: If you use this setting, bounced mails will appear to be
incoming mail to the system, thus creating new tickets.
+If the value contains an C<@>, it is assumed to be an email address and used as
+a global envelope sender. Expected usage in this case is to simply set the
+same envelope sender on all mail from RT, without defining
+C<$OverrideOutgoingMailFrom>. If you do define C<$OverrideOutgoingMailFrom>,
+anything specified there overrides the global value (including Default).
+
This option only works if C<$MailCommand> is set to 'sendmailpipe'.
=cut
diff --git a/lib/RT/Classes.pm b/lib/RT/Classes.pm
index 08bd47b3fe..606479c068 100644
--- a/lib/RT/Classes.pm
+++ b/lib/RT/Classes.pm
@@ -54,6 +54,15 @@ use base 'RT::SearchBuilder';
sub Table {'Classes'}
+=head2 _Init
+
+=cut
+
+ sub _Init {
+ my $self = shift;
+ $self->{'with_disabled_column'} = 1;
+ return ($self->SUPER::_Init(@_));
+ }
=head2 Next
diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
index 868f5dcee4..e74747a120 100644
--- a/lib/RT/Interface/Email.pm
+++ b/lib/RT/Interface/Email.pm
@@ -423,21 +423,24 @@ sub SendEmail {
# SetOutgoingMailFrom and bounces conflict, since they both want -f
if ( $args{'Bounce'} ) {
push @args, shellwords(RT->Config->Get('SendmailBounceArguments'));
- } elsif ( RT->Config->Get('SetOutgoingMailFrom') ) {
- my $OutgoingMailAddress;
+ } elsif ( my $MailFrom = RT->Config->Get('SetOutgoingMailFrom') ) {
+ my $OutgoingMailAddress = $MailFrom =~ /\@/ ? $MailFrom : undef;
+ my $Overrides = RT->Config->Get('OverrideOutgoingMailFrom') || {};
if ($TicketObj) {
my $QueueName = $TicketObj->QueueObj->Name;
- my $QueueAddressOverride = RT->Config->Get('OverrideOutgoingMailFrom')->{$QueueName};
+ my $QueueAddressOverride = $Overrides->{$QueueName};
if ($QueueAddressOverride) {
$OutgoingMailAddress = $QueueAddressOverride;
} else {
- $OutgoingMailAddress = $TicketObj->QueueObj->CorrespondAddress;
+ $OutgoingMailAddress ||= $TicketObj->QueueObj->CorrespondAddress
+ || RT->Config->Get('CorrespondAddress');
}
}
-
- $OutgoingMailAddress ||= RT->Config->Get('OverrideOutgoingMailFrom')->{'Default'};
+ elsif ($Overrides->{'Default'}) {
+ $OutgoingMailAddress = $Overrides->{'Default'};
+ }
push @args, "-f", $OutgoingMailAddress
if $OutgoingMailAddress;
diff --git a/lib/RT/Pod/HTML.pm b/lib/RT/Pod/HTML.pm
index 6896063239..d22050936a 100644
--- a/lib/RT/Pod/HTML.pm
+++ b/lib/RT/Pod/HTML.pm
@@ -123,12 +123,12 @@ sub resolve_local_link {
: '';
my $local;
- if ($name =~ /^RT::/) {
+ if ($name =~ /^RT(::|$)/) {
$local = join "/",
map { $self->encode_entities($_) }
split /::/, $name;
}
- elsif ($name =~ /^rt[-_]/) {
+ elsif ($name =~ /^rt([-_]|$)/) {
$local = $self->encode_entities($name);
}
elsif ($name eq "RT_Config" or $name eq "RT_Config.pm") {
diff --git a/lib/RT/Principals.pm b/lib/RT/Principals.pm
index 68f7e13759..064b2e683e 100644
--- a/lib/RT/Principals.pm
+++ b/lib/RT/Principals.pm
@@ -78,6 +78,7 @@ sub Table { 'Principals'}
sub _Init {
my $self = shift;
+ $self->{'with_disabled_column'} = 1;
return ( $self->SUPER::_Init(@_) );
}
diff --git a/lib/RT/URI.pm b/lib/RT/URI.pm
index 32b19274ed..00508ac6f2 100644
--- a/lib/RT/URI.pm
+++ b/lib/RT/URI.pm
@@ -199,6 +199,8 @@ sub _GetResolver {
if ($resolver) {
$self->{'resolver'} = $resolver;
} else {
+ RT->Logger->warning("Failed to create new resolver object for scheme '$scheme': $@")
+ if $@ !~ m{Can't locate RT/URI/\Q$scheme\E};
$self->{'resolver'} = RT::URI::base->new($self->CurrentUser);
}
diff --git a/sbin/rt-setup-database.in b/sbin/rt-setup-database.in
index cacd7bdcb9..585a88fb57 100644
--- a/sbin/rt-setup-database.in
+++ b/sbin/rt-setup-database.in
@@ -155,6 +155,7 @@ foreach my $key(qw(Type Host Name User Password)) {
my $db_type = RT->Config->Get('DatabaseType') || '';
my $db_host = RT->Config->Get('DatabaseHost') || '';
+my $db_port = RT->Config->Get('DatabasePort') || '';
my $db_name = RT->Config->Get('DatabaseName') || '';
my $db_user = RT->Config->Get('DatabaseUser') || '';
my $db_pass = RT->Config->Get('DatabasePassword') || '';
@@ -181,7 +182,7 @@ if ($args{'skip-create'}) {
}
print "Working with:\n"
- ."Type:\t$db_type\nHost:\t$db_host\nName:\t$db_name\n"
+ ."Type:\t$db_type\nHost:\t$db_host\nPort:\t$db_port\nName:\t$db_name\n"
."User:\t$db_user\nDBA:\t$dba_user" . ($args{'skip-create'} ? ' (No DBA)' : '') . "\n";
my $package = $args{'package'} || 'RT';
@@ -212,7 +213,7 @@ sub action_drop {
unless ( $args{'force'} ) {
print <<END;
-About to drop $db_type database $db_name on $db_host.
+About to drop $db_type database $db_name on $db_host (port '$db_port').
WARNING: This will erase all data in $db_name.
END
@@ -490,7 +491,7 @@ sub error {
sub get_dba_password {
print "In order to create or update your RT database,"
. " this script needs to connect to your "
- . " $db_type instance on $db_host as $dba_user\n";
+ . " $db_type instance on $db_host (port '$db_port') as $dba_user\n";
print "Please specify that user's database password below. If the user has no database\n";
print "password, just press return.\n\n";
print "Password: ";