The backups are made successfully, but I have not gotten the email notification to work. I have successfully received email from my site using either the PHPmailer or the SMTP Authentication Support modules (I am using Gmail's SMTP server). Currently I am running my site at LocalHost (Mac OS 10.5.6, MAMP), and will eventually run it live from a Mac G5 with XAMPP (yes, I know using a dedicated server is better, but it is a small site and I don't have lots of $$)

Other information:
Drupal 6.13
Backup and Migrate 6.x-2.x-dev

<?php
<?php
<code><code><?php

?>


?>
?>
smtp-6.x-1.x-dev
OR
PHPMailer 6.x-2.1

Any help would be appreciated.

Comments

ronan’s picture

Status: Active » Postponed (maintainer needs more info)

Notifications use the drupal 'mail' function so if you're site is sending emails then you should be good. Are user signup emails working for example?

If all other emails are working except BandM notifications, let me know and I can look a little more into it.

toomanypets’s picture

Status: Postponed (maintainer needs more info) » Needs work

I'm having the same problem with 6.x-2.1. The notifications (line 70 and line 87 of filters.statusnotify.inc) are using the PHP mail() function, not drupal_mail():

mail($settings->filters['notify_success_email'], $subject, $body);

The PHP mail function must be loaded with a from address. See http://php.net/manual/en/function.mail.php...

Note: When sending mail, the mail must contain a From header. This can be set with the additional_headers parameter, or a default can be set in php.ini. Failing to do this will result in an error message similar to Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing. The From header sets also Return-Path under Windows.

vonn.new’s picture

I'm having a similar problem.
I have the destination set to an email address. This works great on all the sites I've done except one.
On one site, (my client is using an IIS server) I had a problem with smtp authentication errors not only with B&M but with other system generated emails. I installed the smtp module with phpmailer and have managed to get everything to work except B&M, which still gives me the same smtp authentication error:

mail() [function.mail]: SMTP server response: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server. in C:\Inetpub\vhosts\mosaicinitiative.org\httpdocs\sites\all\modules\backup_migrate\includes\destinations.email.inc on line 139.

Thanks,
Vonn

boobaa’s picture

Seems like BandM uses PHP mail() function instead of the drupal_mail() wrapper, so BandM will simply ignore anything that plugs into normal Drupal mail handling, which is used by other modules.

This has another issue, though: if you have some accented letters in your site name (eg. "Árvíztűrő tükörfúrógép"), mail() does not correctly encodes it (in the subject), so the mail client will show garbled letters (since it's not even informed about the character encoding Drupal uses). I would like to ask to use drupal_mail() instead of PHP mail() because all of this.

HAg’s picture

Version: 6.x-2.x-dev » 6.x-2.4

Stil not fixed

SBanducci’s picture

I'm having the same problem. BM wont email me anything, backup or notification.
PHPmailer can send but nothing from BandM.

artod4789’s picture

I'm having the same issue. The file is created fine as far as I can tell, but no mail comes out of it. But I can get test mail messages just fine using the SMTP module. It's showing that From is an undefined variable. I don't know PHP, so I'm not sure if I can just fix this in the php.ini file or within the filters.statusnotify.inc file.

Thoughts?

This is what I get...

Site was taken offline.
Site was taken online.
Default Database backed up successfully to EDAStaff-2011-10-12T15-24-04 in destination Manual Backups Directory in 671.93 ms. (download, restore, delete)

Error message

Notice: Undefined variable: from in backup_migrate_filter_statusnotify->backup_succeed() (line 70 of D:\DefaultWebSite\sites\all\modules\backup_migrate\includes\filters.statusnotify.inc).
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in backup_migrate_filter_statusnotify->backup_succeed() (line 70 of D:\DefaultWebSite\sites\all\modules\backup_migrate\includes\filters.statusnotify.inc).

themic8’s picture

Version: 6.x-2.4 » 7.x-2.2

Thank you this has helped.

I am using BandM 7.x-2.2.

I have added headers to the mail() and now it works.

Anonymous’s picture

Adding the SMTP module fixed this problem for me.

erickbj’s picture

I believe I might have something to add on this thread. Not sure if I should open another bug as this title is perfect, but maybe the use case is not the same. Anyway, here it goes...

I'm using BM 7.x-2.4. I've noticed that whenever I use the advanced backup feature and the destination is a file to be downloaded, success/failure email notifications will never be sent (considering those 2 checkboxes have been checked).

fwk_backup_perform_backup() calls fwk_backup_destination_save_file() (backup_migrate.module:693) and since the destination is a file to be downloaded it will call the backup_file->transfer() method. That method finally finishes Drupal execution itself by calling module_invoke_all('exit') and exit() (includes/files.inc:346). I believe that's necessary in order not to output any junk at the end of the file. However, because of that, the point where those emails should be sent is never reached.

Sorry I don't have a patch in place, I hope the description is good enough.

mfer’s picture

Version: 7.x-2.2 » 7.x-2.7

@afestein the SMTP module will not work. It assumes use of the drupal mail handling system. Backup and Migrate uses the built in PHP mail() function rather than the Drupal mail system. So, SMTP has no way to register itself as an option.

For me this is a problem since I want to use a mail system outside what is configured in sendmail (or by replacing it with Postfix and configuring it at that level).

Note, patch coming.

mfer’s picture

Status: Needs work » Needs review
StatusFileSize
new3.67 KB

Attached is a patch to pipe the notification emails through drupal_mail(). I've tested this with the SMTP module and it's working.

mfer’s picture

The previous patch was against 7.x-3.x branch. This is against the 7.x-2.x branch and applies to 7.x-2.7. It worked for me when I tested it.

interdruper’s picture

Status: Needs review » Reviewed & tested by the community

I have tested the #13 patch using SMTP module and works fine.

Finally this 3-years old issue is solved, at least partially, since #10 keeps unsolved
(mails are not sent when 'Download' destination is chosen)

May be a good idea to move #10 to a new issue and close this one...

ronan’s picture

Version: 7.x-2.7 » 7.x-2.x-dev
Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Looks good. Committed. Thanks!

Status: Fixed » Closed (fixed)

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

emanherz’s picture

Is it possible to get the same patch for the 3.0 recommended version?

thanks
eric

crystalgrafix’s picture

It would be great if this patch is committed for 3.0

Cheers

robertoperuzzo’s picture

I used patch in #12, but it doesn't work for 7.x-3.x version.

robertoperuzzo’s picture

Assigned: Unassigned » robertoperuzzo
robertoperuzzo’s picture

StatusFileSize
new13.34 KB

I rewrite #12 patch.

yzan’s picture

Issue summary: View changes
StatusFileSize
new53.98 KB

Hello ,
I'm trying to send a backup to an e-mail address., It does not work.
I do not receive the email.
The system displays two messages opposite.
Could someone help solve this problem?
Backup and Migrate 7.x-3.6
A screenshot attached ...

nairb’s picture

@yzan - This is a different issue from this thread and should be in a new issue.

You have two different messages because the backup succeeded but the email failed. Your site is trying to send the message but it isn't working. You need to look into the SMTP 530 error. That says that sending failed due to authentication problems. The error also references the STARTTLS not being used. Have you setup and tested email on your server before? It looks like you need to check your settings.

yzan’s picture

@nairb
Hello ,
yes I tried the email with the registration of a new user, then with the form of contact, and finally the sending of the test mail of the modules Smtp.
All work ...
After 4 days of research, I regret that I could not find a solution.
I will continue.
When I find, I will let him know.
Cordially ...

yzan’s picture

Hello,
@nairb
Using development version 7.x-3.x-dev updated 4 Dec 2019 at 12:18 UTC. The message disappears.
The backup is now well received by email.
The file download joins fails with this message "The archive is damaged or its format is unknown"
I read elsewhere that it worked for some users. For me it does not work.
I do not understand ... damage

ivnish’s picture

Assigned: robertoperuzzo » Unassigned