smtp_library variable is not removed when mimemail has been disabled
kenorb - May 7, 2009 - 12:53
| Project: | Mime Mail |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
smtp_library is still set to mimemail.module path after uninstalling mimemail module.
So even mimemail module is disabled, all mails are send via mimemail causing conflict with other modules (htmlmail).
Related issues:
#236495: missing mimemail_uninstall() to remove all variables
#362531: sent emails are empty after changed from Mimemail
Solution:
In hook_uninstall there should be additional code similar to this one:
<?php
if (strpos(variable_get('smtp_library', ''), 'mimemail') !== FALSE) {
variable_del('smtp_library');
}
?>
#1
Related issues:
#345065: Had to delete Mimemail to return things to normal
#320465: Blank E-mail sent
http://drupal.org/node/243544#comment-1374474
#332326: Confirmation Emails are blank
#329958: White page only
http://drupal.org/node/320327#comment-1056666
#2
#3
Bless you kenorb. Really.
#4
Wow, just got bit hard by this bug, spent more time than I care to admit tracking this down!
It's actually worse than you think kenorb. There's also the case that the user had mimemail enabled (so smtp_library is set to mimemail), and then disables but does not uninstall mimemail. The variable still points to mimemail, and drupal (in mail.inc::drupal_mail_send()) just checks the smtp_library variable and to make sure the include file exists - it never checks to make sure the module is enabled.
So yeah, the upshot is, to remove the effects of this module, delete it. Or with kenorb's patch above completely uninstall it! Just disabling the module does not clean up enough.
#5
So in this case this code:
<?phpif (strpos(variable_get('smtp_library', ''), 'mimemail') !== FALSE) {
variable_del('smtp_library');
}
?>
should be as well copied into hook_disable()
#6
#7