Угу. Привет всем любителям пихать всякое говно в From и ставить вебсерверу права на запись в докрут и не отнимать права на исполнение кода там, где это не нужно.
escapeshellcmd() prevents command execution, but allows to add additional parameters. For security reasons, it is recommended for the user to sanitize this parameter to avoid adding unwanted parameters to the shell command.
В phpmailer-е с первой попытки тоже не пофиксили. Там весело:
The documentation for mail() mentions that escapeshellcmd() is applied internally to the command generated by mail(), and that 'dangerous' characters should be escaped. Unfortunately this clashes with what escapeshellarg() does, and the nested combination of escapeshellcmd(escapeshellarg($address)) can result in a crafted address breaking out of the escaping, resulting in an executable command again.
Проще было бы ввести strict/security level, где по умолчанию запрещать пробелы и комбинацию " -" напрочь в емейле, предназначенном для From, несмотря на RFC.
Ну и бросать соответствующий варнинг или исключение.