I'm upgrading a drupal website. There are thousands of users and it is using messaging and notifications. By accident I have sent out loads of notifications to users. Is th开发者_JAVA技巧ere any way I can prevent the emails going out to users and still carry out my upgrades? I don't want to disable the modules as I need them enabled to do the upgrades.
Any help appreciated
If you mean to temporarily disable/reroute mails on a test/staging instance of your site, take a look at the various options provided in this post.
If you are talking about a live site, be careful - those methods mostly apply to all mails send by Drupal, so you would also disable other mails like e.g. a 'reset password' request.
Usually in Drupal, mail is sent out instantaneously to the mailserver. In some situations, people setup queues in Drupal to send mail. These mails are then sent out from the queue (maybe 50 to 100 at a time for example) when the cron.php
runs.
Are you using any of these modules (or similar ones)?
http://drupal.org/project/queue_mail
http://drupal.org/project/mailq
If you are, then you might be able to "empty" the queue for any pending emails.
In general, you can make sure that mails are not sent by blocking the smtp port (usually port 25) on your computer while you are doing an upgrade. You can easily block the port by making a temporary firewall rule.
There might be also be a queue on your mailserver. So you might be able to go to the webserver and delete any pending emails that have not been sent out yet.
精彩评论