mail() [function.mail]: Bad parameters to mail() function, mail not sent. in /home/content/t/z/s/tzsbadmin/html/dpsandbox/modules/backup_migrate/includes/destinations.email.inc on line 139.
Using my limited ability, I've been trying to troubleshoot the parameters passed to mail(). By creating a small simple backup, I was able to hard-code various mail() calls that worked more successfully than those generated by destinations.email.inc (although not perfect).
I've been using http://php.net/manual/en/function.mail.php as a guide. But after a few hours of trying, I'm giving up. To me, the issue seems to be that the module is passing a MIME encoding body plus additional headers into mail() entirely as the $additional_headers field. It seems the additional headers should be something like:
From: user@gmail.com
Errors-To: [EMAIL=user@gmail.com]user@gmail.com[/EMAIL]
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary = b6d4858f6fab1fd85e456f137ee189fc5
and the body should be something like:
This is a multi-part message in MIME format.
--b6d4858f6fab1fd85e456f137ee189fc5
Content-Type: text/plain Content-Transfer-Encoding: base64
Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=filename.mysql
--b6d4858f6fab1fd85e456f137ee189fc52
// chunk split data
--b6d4858f6fab1fd85e456f137ee189fc52--
Perhaps someone can help from this point?
Comment | File | Size | Author |
---|---|---|---|
#7 | destinations.email_.inc_.test | 5 KB | ontech |
Comments
Comment #1
ronan CreditAttribution: ronan commentedYeah, that makes sense, but it does work for me and I think it does for a lot of other people though. I'm not too familiar with this stuff either as this function was added as a patch by greggles who did all the heavy lifting here. Maybe somebody else familiar with this stuff can help shed some light on what's going on here.
Comment #2
Todd Zebert CreditAttribution: Todd Zebert commentedI'm using php 5.2.8 and my understanding is that mail() requires an MTA. That may be were the difference lies and why mail() sometimes reports an error. I'm using Godaddy linux hosting, but I was unable to determine what MTA they use.
Comment #3
ontech CreditAttribution: ontech commentedI too am using Godaddy linux hosting. I have solved the problem through removing some \n's.
1) open destinations.email.inc
2) line 121 should be this:
return "Content-Type: ". $part["ctype"] . ($part["name"] ? "; name = \"". $part["name"] ."\"" : "") ."\nContent-Transfer-Encoding: $encoding\n$disposition$message";
3) line 126 should be this:
$multipart = "Content-Type: multipart/mixed; boundary = $boundary\nThis is a MIME encoded message.\n--$boundary";
Comment #4
ontech CreditAttribution: ontech commentedinspired by here:
http://www.phpfreaks.com/forums/index.php/topic,238232.msg1110165.html#m...
Comment #5
Todd Zebert CreditAttribution: Todd Zebert commentedOntech - I just tried it, and although I don't get the error message anymore, I also don't get the email. Nothing shows in the log either. Hmmmmm.
Subsequently, I upgraded to Mime Mail 6.x-1.0-alpha3. Still same.
Comment #6
ontech CreditAttribution: ontech commentedTodd, let me send you my production destinations.email.inc file. PM me your email address...
Comment #7
ontech CreditAttribution: ontech commentedwait. I can attach it here :)
Comment #8
RafaelTorrales CreditAttribution: RafaelTorrales commentedworks for me!
Godaddy user with linux toom thanks
Comment #9
Todd Zebert CreditAttribution: Todd Zebert commented@Ontech thanks, and sorry I forgot about this patch.
I have Backup and Migrate 6.x-2.3 now which exhibited the same error.
I modified the .inc file as you did, and no error was reported, and I actually received the file!
THANKS!
Comment #10
couturier CreditAttribution: couturier as a volunteer commentedDrupal 6 and Backup and Migrate 6 are no longer supported.