Skip to content

Commit 0e19bc1

Browse files
committed
win32/sendmail.c: remove mailBbc parameter that is always NULL
1 parent 6f28370 commit 0e19bc1

File tree

3 files changed

+7
-28
lines changed

3 files changed

+7
-28
lines changed

ext/standard/mail.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ PHPAPI bool php_mail(const char *to, const char *subject, const char *message, c
543543
char *tsm_errmsg = NULL;
544544

545545
/* handle old style win smtp sending */
546-
if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, hdr, subject, to, message, NULL, NULL) == FAILURE) {
546+
if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, hdr, subject, to, message, NULL) == FAILURE) {
547547
if (tsm_errmsg) {
548548
php_error_docref(NULL, E_WARNING, "%s", tsm_errmsg);
549549
efree(tsm_errmsg);

win32/sendmail.c

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static const char *ErrorMessages[] =
111111
#define PHP_WIN32_MAIL_DOT_PATTERN "\n."
112112
#define PHP_WIN32_MAIL_DOT_REPLACE "\n.."
113113

114-
static int SendText(char *RPath, const char *Subject, const char *mailTo, char *mailCc, char *mailBcc, const char *data,
114+
static int SendText(char *RPath, const char *Subject, const char *mailTo, char *mailCc, const char *data,
115115
const char *headers, char *headers_lc, char **error_message);
116116
static int MailConnect();
117117
static int PostHeader(char *RPath, const char *Subject, const char *mailTo, char *xheaders);
@@ -186,7 +186,7 @@ static zend_string *php_win32_mail_trim_header(const char *header)
186186
//*********************************************************************
187187
PHPAPI int TSendMail(const char *host, int *error, char **error_message,
188188
const char *headers, const char *Subject, const char *mailTo, const char *data,
189-
char *mailCc, char *mailBcc)
189+
char *mailCc)
190190
{
191191
int ret;
192192
char *RPath = NULL;
@@ -279,7 +279,7 @@ PHPAPI int TSendMail(const char *host, int *error, char **error_message,
279279
PW32G(mail_host), !INI_INT("smtp_port") ? 25 : INI_INT("smtp_port"));
280280
return FAILURE;
281281
} else {
282-
ret = SendText(RPath, Subject, mailTo, mailCc, mailBcc, data, headers ? ZSTR_VAL(headers_trim) : NULL, headers ? ZSTR_VAL(headers_lc) : NULL, error_message);
282+
ret = SendText(RPath, Subject, mailTo, mailCc, data, headers ? ZSTR_VAL(headers_trim) : NULL, headers ? ZSTR_VAL(headers_lc) : NULL, error_message);
283283
TSMClose();
284284
if (RPath) {
285285
efree(RPath);
@@ -387,7 +387,7 @@ static char *find_address(char *list, char **state)
387387
// Author/Date: jcar 20/9/96
388388
// History:
389389
//*********************************************************************
390-
static int SendText(char *RPath, const char *Subject, const char *mailTo, char *mailCc, char *mailBcc, const char *data,
390+
static int SendText(char *RPath, const char *Subject, const char *mailTo, char *mailCc, const char *data,
391391
const char *headers, char *headers_lc, char **error_message)
392392
{
393393
int res;
@@ -529,28 +529,7 @@ static int SendText(char *RPath, const char *Subject, const char *mailTo, char *
529529
/* Send mail to all Bcc rcpt's
530530
This is basically a rip of the Cc code above.
531531
Just don't forget to remove the Bcc: from the header afterwards. */
532-
if (mailBcc && *mailBcc) {
533-
tempMailTo = estrdup(mailBcc);
534-
/* Send mail to all rcpt's */
535-
token = find_address(tempMailTo, &token_state);
536-
while (token != NULL)
537-
{
538-
SMTP_SKIP_SPACE(token);
539-
FormatEmailAddress(PW32G(mail_buffer), token, "RCPT TO:<%s>\r\n");
540-
if (!Post(PW32G(mail_buffer))) {
541-
efree(tempMailTo);
542-
return (FAILED_TO_SEND);
543-
}
544-
if ((res = Ack(&server_response)) != SUCCESS) {
545-
SMTP_ERROR_RESPONSE(server_response);
546-
efree(tempMailTo);
547-
return (res);
548-
}
549-
token = find_address(NULL, &token_state);
550-
}
551-
efree(tempMailTo);
552-
}
553-
else if (headers) {
532+
if (headers) {
554533
if ((pos1 = strstr(headers_lc, "bcc:")) && (pos1 == headers_lc || *(pos1-1) == '\n')) {
555534
/* Real offset is memaddress from the original headers + difference of
556535
* string found in the lowercase headers + 4 characters to jump over

win32/sendmail.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
PHPAPI int TSendMail(const char *host, int *error, char **error_message,
3636
const char *headers, const char *Subject, const char *mailTo, const char *data,
37-
char *mailCc, char *mailBcc);
37+
char *mailCc);
3838
PHPAPI void TSMClose(void);
3939
PHPAPI const char *GetSMErrorText(int index);
4040
#endif /* sendmail_h */

0 commit comments

Comments
 (0)