Mime Mail should not allow a configuration where the Sender e-mail address is empty and the E-mail engine is set to the default.

Comments

sgabe’s picture

Status: Active » Closed (works as designed)

If the sender e-mail address is not set the message will be sent with the site's mail address.

oadaeh’s picture

Component: User interface » Code
Status: Closed (works as designed) » Needs review
StatusFileSize
new516 bytes

No, actually, it will not. What it does is gets the variables 'mimemail_name' and 'mimemail_mail', and if they don't exist (not, if they are empty), uses $site_name and $site_mail, instead. The problem is that when the configuration page is saved and those fields are blank, the variables get saved as ''. So when the check is made, the variables exist but are empty, so $from gets set to array('name' => '', 'mail' => ''), not array('name' => $site_name , 'mail' => $site_mail). The attached patch should fix the problem.

sgabe’s picture

StatusFileSize
new922 bytes

Sorry, you are right, though your patch kills the feature to specify the sender's name and address.

oadaeh’s picture

StatusFileSize
new799 bytes

Sorry about that. For some reason, I was under the impression that $from was already being set to 'mimemail_mail' before it got to that point (thus, adding to my confusion). Upon reviewing the code, I see that assumption was totally unfounded.

I do believe, however, in the interest of unnecessarily using memory or CPU resources (however small that may be), the creation and assignment of the $mimemail_name and $mimemail_mail variables should be within the scope they are used.

sgabe’s picture

Status: Needs review » Fixed

Fair enough. Committed on both branches, thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.