Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with mailSend function in PHPMailer.php #2301

Closed
chadquilter opened this issue Mar 31, 2021 · 2 comments
Closed

Issue with mailSend function in PHPMailer.php #2301

chadquilter opened this issue Mar 31, 2021 · 2 comments

Comments

@chadquilter
Copy link

Hello, If I am missing anything apologies (maybe this is wordpress issue not adjusting to PHPMailer) but it looks like there might be an issue with a condition in the mailSend function on line 1864 (or there about's). The first condition to set the Sender attribute:

    if ('' === $this->Sender) {
        $this->Sender = $this->From;
    }

Will not trigger the below checks to add the "-f" flag to the start of the sender string, which will cause the mailer to fail should your MTA require a valid from sender. (copied logic below for context)...in fact it looks like the below will never run if Sender is empty and From is defined never adding the -f option.

    if (empty($this->Sender) && !empty(ini_get('sendmail_from'))) {
        //PHP config has a sender address we can use
        $this->Sender = ini_get('sendmail_from');
    }

    if (!empty($this->Sender) && static::validateAddress($this->Sender)) {
        if (self::isShellSafe($this->Sender)) {
            $params = sprintf('-f%s', $this->Sender);
        }
        $old_from = ini_get('sendmail_from');
        ini_set('sendmail_from', $this->Sender);
    }

Thanks, sorry again if I am missing something.

@Synchro
Copy link
Member

Synchro commented Mar 31, 2021

Are you referring to #2298? Most of that code is gone now.

@chadquilter
Copy link
Author

Yea, this was exactly my issue. Many thanks! I should have done a search in closed bugs!

@Synchro Synchro closed this as completed Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants