da28b77a by Paweł Bogusławski

Merge IB#1099508 into master-ib

2 parents 8b32af21 a6e36877
#6.0.0.beta1 2017-??-??
- 2020-03-18 Auto response signing option added.
- 2018-12-31 Added option to limit number of active agent accounts.
- 2018-12-04 Fixed upload cache filename cleanup and filename cleanup optimization.
- 2018-12-03 Fixed infinite loop on filename generation.
......
......@@ -11002,6 +11002,17 @@ Thanks for your help!
</Option>
</Setting>
</ConfigItem>
<ConfigItem Name="AutoResponseSign" Required="0" Valid="0">
<Description Translatable="1">If this option is set to 'Yes' and S/MIME and/or PGP message signing is enabled, auto responses for tickets created in queues with default signing enabled will be signed if auto response sender address matches queue sender address.</Description>
<Group>Ticket</Group>
<SubGroup>Core::PostMaster</SubGroup>
<Setting>
<Option SelectedID="0">
<Item Key="0" Translatable="1">No</Item>
<Item Key="1" Translatable="1">Yes</Item>
</Option>
</Setting>
</ConfigItem>
<ConfigItem Name="LinkObject::PossibleLink###0200" Required="0" Valid="1">
<Description Translatable="1">Links 2 tickets with a "Normal" type link.</Description>
<Group>Ticket</Group>
......
......@@ -11089,6 +11089,13 @@ Thanks for your help!
<Item ValueType="Checkbox">1</Item>
</Value>
</Setting>
<Setting Name="AutoResponseSign" Required="0" Valid="0">
<Description Translatable="1">If this option is set to 'Yes' and S/MIME and/or PGP message signing is enabled, auto responses for tickets created in queues with default signing enabled will be signed if auto response sender address matches queue sender address.</Description>
<Navigation>Core::PostMaster</Navigation>
<Value>
<Item ValueType="Checkbox">0</Item>
</Value>
</Setting>
<Setting Name="LinkObject::PossibleLink###0200" Required="0" Valid="1">
<Description Translatable="1">Links 2 tickets with a "Normal" type link.</Description>
<Navigation>Core::LinkObject</Navigation>
......
......@@ -2184,7 +2184,9 @@ sub _Init {
}
# ensure that there is a random state file that we can write to (otherwise openssl will bail)
$ENV{RANDFILE} = $ConfigObject->Get('TempDir') . '/.rnd'; ## no critic
# openssl will create rnd file with 0600 so use separate file for otrs and www users
# (warning: tested in linux only)
$ENV{RANDFILE} = $ConfigObject->Get('TempDir') . '/.rnd.' . getpwuid($<);
# prepend RANDFILE declaration to openssl cmd
$Self->{Cmd} = "HOME=" . $ConfigObject->Get('Home') . " RANDFILE=$ENV{RANDFILE} $Self->{Cmd}";
......
......@@ -2777,6 +2777,17 @@ sub SendAutoResponse {
return;
}
# Sign auto response if queue has signing enabled by default and queue sender address is the same
# as auto response sender address.
my %ExParams;
my $ConfigObject = $Kernel::OM->Get('Kernel::Config');
if ( $ConfigObject->Get('AutoResponseSign') && ($ConfigObject->Get('PGP') || $ConfigObject->Get('SMIME') ) ) {
my %Queue = $Kernel::OM->Get('Kernel::System::Queue')->QueueGet( ID => $Ticket{QueueID} );
if ( $Queue{DefaultSignKey} && ( $Queue{Email} eq $AutoResponse{SenderAddress} ) ) {
( $ExParams{Sign}{Type}, $ExParams{Sign}{SubType}, $ExParams{Sign}{Key} ) = split /::/, $Queue{DefaultSignKey};
}
}
# send email
my $ArticleID = $Self->ArticleSend(
ArticleType => 'email-external',
......@@ -2794,6 +2805,7 @@ sub SendAutoResponse {
InReplyTo => $OrigHeader{'Message-ID'},
Loop => 1,
UserID => $Param{UserID},
%ExParams,
);
if ( $ArticleID ) {
......