Hello,
my Drupal site use simplenews + mimemail to send newsletter. After updating Simplenews to 6.x-1.1 and Mimemail to 6.x-1.0-alpha2 the newsletter can't send to test address.
I've debugged the prepare-sending process and found the problem. Overriding the test e-mail address, the mimemail_address function (in mimemail.inc) get the $address object (and not as array). If it gets array its checked is $address['name'] is not empty, but if this variable is an object it is unchecked.
So in line 576 it needs an if conditional:
// it's a user object
if (is_object($address) && isset($address->mail)) {
if ($address->name != " ") {
return $address->mail;
}
else {
return '"'. addslashes(mime_header_encode($address->name)) .'" <'. $address->mail .'>';
}
}
Please check it and in next update please implement this.
Thanx a lot,
DanyG
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | mimemail.768794_01.patch | 754 bytes | sgabe |
Comments
Comment #1
sgabe commentedI can't reproduce this and can't see any changes in Simplenews 6.x-1.1 or Mime Mail 6.x-1.0-alpha2 which could be connected with this issue and could cause such like error just now. I see that
mimemail_address()gets the address as an object, but I can't see any error when the$address->nameis empty, the test e-mail arrives just fine. Can you give some more details?Comment #2
danyg commentedHi,
at the end of mimemail_prepare() function, just before send the mail to mail engine, the $message variable looks like this:
The address element of the array doesn't contain my name, just my mail address, but it stars with quotation marks.
The maillog of the server says:
I've debugged the mimemail_address() function and print_r($address) and it gives the information below.
The name is empty and it returns with empty-quoted string.
ps. domain string is replaced beacuse of robots :P
Thanks,
DanyG
Comment #3
sgabe commentedI do not understand your description now, how this can be related with just the latest version of Mime Mail and/or Simplenews. If an issue comes up after updating, the problem should be in the changes according to the previous version, but there is no such changes. It's confusing...
However, I couldn't reproduce this error entirely (the e-mails arrive fine for me), but I can confirm this can cause problems. The
Toheader in the message with e. g. SMTP module looks like"\"\"" <example@{domain}>this is as least ugly but rather totally bad.Please, test the attached patch and if it works, mark the issue as RTBC.
Comment #4
danyg commentedThanks,
I've tried the patch and it works. Early I've tried the if condition with empty() but it didn't send the letter, and now the empty() condition in patch it works. I don't understand :)
Thank You once again. Kösz Gábor, mégegyszer.
Comment #5
sgabe commentedChanging version to HEAD.
Comment #6
sgabe commentedCommitted to HEAD.