Our automated test suite naively assumed setting "smtp_on" to zero would mean emails wouldn't be sent (or at least, they'd default to using the default mail system which would have been fine). Instead, the SMTP module just ignores this variable completely for outgoing mail? It only appears to use it for setting "smtp_library" which isn't used in Drupal core anymore.
As a suggestion, how about we simply just return at the top of the mail method in SmtpMailSystem until this module can work with the new Drupal mail system in a better way?
public function mail(array $message) {
// If SMTP is set to be off, then don't send a mail at all.
if (!variable_get('smtp_on')) {
return TRUE;
}
This isn't a patch as it's a suggestion, obviously fixing the codebase is better... I just don't have time for that right now.
Pobster
Comments
Comment #1
simon georges commentedCross-referencing #1889278: Remove smtp_library variable from 7.x-version.
Comment #2
simon georges commentedClosing #1693186: SMTP still active despite being set to 'off' as a duplicate of this one.
Comment #3
jennyOlsen commentedThis was fixed in #2193183: SMTP On/Off flag does not work