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?

CommentFileSizeAuthor
#7 destinations.email_.inc_.test5 KBontech
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ronan’s picture

Status: Active » Postponed (maintainer needs more info)

Yeah, 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.

Todd Zebert’s picture

I'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.

ontech’s picture

I 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";

ontech’s picture

Todd Zebert’s picture

Ontech - 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.

ontech’s picture

Todd, let me send you my production destinations.email.inc file. PM me your email address...

ontech’s picture

wait. I can attach it here :)

RafaelTorrales’s picture

works for me!

Godaddy user with linux toom thanks

Todd Zebert’s picture

@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!

couturier’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Drupal 6 and Backup and Migrate 6 are no longer supported.