Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
6b02d3a4
Commit
6b02d3a4
authored
Mar 04, 2019
by
Carsten Rose
Browse files
Maillog: fixed trouble when logging mails with attachments.
parent
6ea7ab04
Pipeline
#1671
passed with stage
in 2 minutes and 8 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/Source/core/helper/OnArray.php
View file @
6b02d3a4
...
...
@@ -34,6 +34,7 @@ class OnArray {
* @return string
*/
public
static
function
toString
(
array
$dataArray
,
$keyValueGlue
=
'='
,
$rowGlue
=
'&'
,
$encloseValue
=
''
)
{
if
(
count
(
$dataArray
)
===
0
)
{
return
''
;
}
...
...
extension/Source/core/report/SendMail.php
View file @
6b02d3a4
...
...
@@ -69,10 +69,10 @@ class SendMail {
if
(
!
empty
(
$redirectAllMail
))
{
$addBody
=
"All QFQ outgoing mails are caught and redirected to you."
.
PHP_EOL
.
"Original receiver(s) are ..."
.
PHP_EOL
;
$addBody
.
=
'TO: '
.
(
$mailConfig
[
SENDMAIL_TOKEN_RECEIVER
]
??
''
)
.
PHP_EOL
;
$addBody
.
=
'CC: '
.
(
$mailConfig
[
SENDMAIL_TOKEN_RECEIVER_CC
]
??
''
)
.
PHP_EOL
;
$addBody
.
=
'BCC: '
.
(
$mailConfig
[
SENDMAIL_TOKEN_RECEIVER_BCC
]
??
''
)
.
PHP_EOL
;
$addBody
.
=
'SENDER: '
.
(
$mailConfig
[
SENDMAIL_TOKEN_SENDER
]
??
''
)
.
PHP_EOL
;
$addBody
.
=
'TO: '
.
(
$mailConfig
[
SENDMAIL_TOKEN_RECEIVER
]
??
''
)
.
PHP_EOL
;
$addBody
.
=
'CC: '
.
(
$mailConfig
[
SENDMAIL_TOKEN_RECEIVER_CC
]
??
''
)
.
PHP_EOL
;
$addBody
.
=
'BCC: '
.
(
$mailConfig
[
SENDMAIL_TOKEN_RECEIVER_BCC
]
??
''
)
.
PHP_EOL
;
$addBody
.
=
'SENDER: '
.
(
$mailConfig
[
SENDMAIL_TOKEN_SENDER
]
??
''
)
.
PHP_EOL
;
$addBody
.
=
PHP_EOL
.
"=========================================="
.
PHP_EOL
.
PHP_EOL
;
// Check if the given body is a HTML body.
...
...
@@ -238,13 +238,13 @@ class SendMail {
$output
=
Support
::
qfqExec
(
$cmd
,
$rc
);
if
(
$rc
!=
0
){
if
(
!
is_file
(
$sendEmail
)
||
!
is_readable
(
$sendEmail
)){
if
(
$rc
!=
0
)
{
if
(
!
is_file
(
$sendEmail
)
||
!
is_readable
(
$sendEmail
))
{
throw
new
UserFormException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
"Command 'sendEmail' not found."
,
ERROR_MESSAGE_SUPPORT
=>
$sendEmail
]),
ERROR_SENDMAIL
);
}
if
(
!
is_executable
(
$sendEmail
)){
if
(
!
is_executable
(
$sendEmail
))
{
throw
new
UserFormException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
"Command 'sendEmail' not executable."
,
ERROR_MESSAGE_SUPPORT
=>
$sendEmail
]),
ERROR_SENDMAIL
);
}
...
...
@@ -266,8 +266,8 @@ class SendMail {
* Creates a new MailLog Record based on $mailArr / $header.
*
* @param array $mailConfig
*
* @param string $attachmentsLine
*
* @throws CodeException
* @throws DbException
* @throws UserFormException
...
...
@@ -277,12 +277,17 @@ class SendMail {
$log
=
array
();
$attachments
=
''
;
if
(
!
empty
(
$mailConfig
[
SENDMAIL_TOKEN_ATTACHMENT
])
&&
is_array
(
$mailConfig
[
SENDMAIL_TOKEN_ATTACHMENT
]))
{
$attachments
=
OnArray
::
toString
(
$mailConfig
[
SENDMAIL_TOKEN_ATTACHMENT
]);
}
$header
=
'OoO:'
.
$mailConfig
[
SENDMAIL_TOKEN_FLAG_AUTO_SUBMIT
];
if
(
!
empty
(
$mailConfig
[
SENDMAIL_TOKEN_HEADER
]))
{
$header
.
=
PHP_EOL
.
'Custom: '
.
$mailConfig
[
SENDMAIL_TOKEN_HEADER
];
}
if
(
!
empty
(
$mailConfig
[
SENDMAIL_TOKEN_ATTACHMENT
]))
{
$header
.
=
PHP_EOL
.
'Attachment: '
.
$
mailConfig
[
SENDMAIL_TOKEN_ATTACHMENT
]
;
$header
.
=
PHP_EOL
.
'Attachment: '
.
$
attachments
;
}
// Log
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment