Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
e30622cb
Commit
e30622cb
authored
8 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
FIX Bcc must not appears to recipient when using SMTPs lib
parent
c45c24f8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/core/class/CMailFile.class.php
+2
-2
2 additions, 2 deletions
htdocs/core/class/CMailFile.class.php
htdocs/core/class/smtps.class.php
+23
-9
23 additions, 9 deletions
htdocs/core/class/smtps.class.php
with
25 additions
and
11 deletions
htdocs/core/class/CMailFile.class.php
+
2
−
2
View file @
e30622cb
...
...
@@ -527,7 +527,7 @@ class CMailFile
if
(
!
empty
(
$conf
->
global
->
MAIN_MAIL_DEBUG
))
$this
->
dump_mail
();
if
(
!
empty
(
$bounce
))
$res
=
mail
(
$dest
,
$this
->
encodetorfc2822
(
$this
->
subject
),
$this
->
message
,
$this
->
headers
,
$bounce
);
else
$res
=
mail
(
$dest
,
$this
->
encodetorfc2822
(
$this
->
subject
),
$this
->
message
,
$this
->
headers
);
else
$res
=
mail
(
$dest
,
$this
->
encodetorfc2822
(
$this
->
subject
),
$this
->
message
,
$this
->
headers
);
if
(
!
$res
)
{
...
...
@@ -840,7 +840,7 @@ class CMailFile
// Receiver
if
(
isset
(
$this
->
addr_cc
)
&&
$this
->
addr_cc
)
$out
.
=
"Cc: "
.
$this
->
getValidAddress
(
$this
->
addr_cc
,
2
)
.
$this
->
eol2
;
if
(
isset
(
$this
->
addr_bcc
)
&&
$this
->
addr_bcc
)
$out
.
=
"Bcc: "
.
$this
->
getValidAddress
(
$this
->
addr_bcc
,
2
)
.
$this
->
eol2
;
if
(
isset
(
$this
->
addr_bcc
)
&&
$this
->
addr_bcc
)
$out
.
=
"Bcc: "
.
$this
->
getValidAddress
(
$this
->
addr_bcc
,
2
)
.
$this
->
eol2
;
// Question: bcc must not be into header, only into SMTP command "RCPT TO". Does php mail support this ?
// Delivery receipt
if
(
isset
(
$this
->
deliveryreceipt
)
&&
$this
->
deliveryreceipt
==
1
)
$out
.
=
"Disposition-Notification-To: "
.
$this
->
getValidAddress
(
$this
->
addr_from
,
2
)
.
$this
->
eol2
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/class/smtps.class.php
+
23
−
9
View file @
e30622cb
...
...
@@ -484,14 +484,20 @@ class SMTPs
// and send it out "single file"
foreach
(
$this
->
get_RCPT_list
()
as
$_address
)
{
/*
/* Note:
* BCC email addresses must be listed in the RCPT TO command list,
* but the BCC header should not be printed under the DATA command.
* http://stackoverflow.com/questions/2750211/sending-bcc-emails-using-a-smtp-server
*/
/*
* TODO
* After each 'RCPT TO:' is sent, we need to make sure it was kosher,
* if not, the whole message will fail
* If any email address fails, we will need to RESET the connection,
* mark the last address as "bad" and start the address loop over again.
* If any address fails, the entire message fails.
*/
* After each 'RCPT TO:' is sent, we need to make sure it was kosher,
* if not, the whole message will fail
* If any email address fails, we will need to RESET the connection,
* mark the last address as "bad" and start the address loop over again.
* If any address fails, the entire message fails.
*/
$this
->
socket_send_str
(
'RCPT TO: <'
.
$_address
.
'>'
,
'250'
);
}
...
...
@@ -1020,7 +1026,7 @@ class SMTPs
/**
* Returns an array of addresses for a specific type; TO, CC or BCC
*
* @param string $_which Which collection of adresses to return
* @param string
$_which
Which collection of ad
d
resses to return
('to', 'cc', 'bcc')
* @return string|false Array of emaill address
*/
function
get_email_list
(
$_which
=
null
)
...
...
@@ -1169,9 +1175,17 @@ class SMTPs
if
(
$this
->
getCC
()
)
$_header
.
=
'Cc: '
.
$this
->
getCC
()
.
"
\r\n
"
;
/* Note:
* BCC email addresses must be listed in the RCPT TO command list,
* but the BCC header should not be printed under the DATA command.
* So it is included into the function sendMsg() but not here.
* http://stackoverflow.com/questions/2750211/sending-bcc-emails-using-a-smtp-server
*/
/*
if ( $this->getBCC() )
$_header .= 'Bcc: ' . $this->getBCC() . "\r\n";
*/
$host
=
$this
->
getHost
();
$host
=
preg_replace
(
'@tcp://@i'
,
''
,
$host
);
// Remove prefix
$host
=
preg_replace
(
'@ssl://@i'
,
''
,
$host
);
// Remove prefix
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment