0

I'm using the smtp module to send mail from a drupal 7 installation throught gmail. In

 /admin/config/system/smtp

I set

 smtp server 'smtp.gmail.com' 
 smtp port '587' 
 use encryption 'use tls' 

and i set my valid mail '[email protected]'.

Now, it's working, but some days ago a lot of mail, on the account [email protected], began to arrive containing an error message:

 Delivery to the following recipient has been delayed:
 [email protected]
 Message will be retried for 2 more day(s)
 Technical details of temporary failure:
 The recipient server did not accept our requests to connect. Learn more at https://support.google.com/mail/answer/7720
 [(10) somemail.com. [someip]:25: 421 Too many concurrent SMTP connections; please try again later. ]

There were and there will always be on my drupal site people registering with fake unreachable mail, so assuming i can't solve this problem, what this message means? It began some days ago, out of the blue, so i think something is changed, but i do not know precisely what. And do not know precisely where. (gmail, my provider, my server...)

Anyway, what is the best way to send mail from drupal, excluding the idea of setting up my own mail server and excluding gmail, as it implies this problem?

3
  • Can you tell more about your site? How can users send mail? Do you have acces to the logs (/var/log)? Do you have SSH-acces to your server?
    – MatthijsG
    Commented Oct 22, 2015 at 11:30
  • Sending mail is linked to standard drupal behaviours like registering or requesting new password. I have access to the logs and to the server, which is an ubuntu 14.04 box entirely set up and administered by me (so i do have ssh access and so on). Commented Oct 22, 2015 at 12:08
  • When mailsending is only registering & requesting, i would look into user-registration indeed.
    – MatthijsG
    Commented Oct 23, 2015 at 8:03

2 Answers 2

1

Logically speaking I'd say you have a few options:

  1. Implement a mechanism to either stop fake users from signing up altogether, or to clear out the accounts in the time between them registering and the SMTP module doing its thing.
  2. Hook into drupal_mail and implement some logic to stop emails being sent to addresses you determine are 'bad'
  3. Convince Google to relax their parameters so you can send more mail (unlikely)
  4. Use a service other than GMail which allows more capacity.

The error message suggests you're looking at resource limits here, so the only fix is to either get your provider to increase that limit for you, or stop as many emails being sent from your site in the first place.

5
  • Yep. It's only a bit difficult to implement either solution... How to recognize fake users? How to determine bad addresses? And so on ^^ Commented Oct 22, 2015 at 12:03
  • 1
    Yeah that's the bit that's up to you @SashaGrievus - Drupal doesn't know what you consider to be a good or a bad email address, or what you consider to be a fake user, you need to decide that on a per-site basis. You might get some joy out of the Spambot module (integrates with stopforumspam), I've had good results with that in the past. Then there's Mollom and services like that which may be able to help. There isn't a single answer though, it depends on your specific business requirements - those aren't something Drupal can decide for you
    – Clive
    Commented Oct 22, 2015 at 12:19
  • You're totally right. Also, Mollom seems very interesting. Spambot too. Thank you :) Commented Oct 22, 2015 at 12:29
  • Fake users are spambots? I always use Captcha with the Riddle, like: "what color is a banana". 99.9% of the time this is enough
    – MatthijsG
    Commented Oct 23, 2015 at 8:03
  • It is very interesting the system adopted by spamicide. Inserting a field and hide it with css in form. If it is compiled, the compiler was a bot :) Commented Oct 23, 2015 at 11:45
1

Have you tried using the Mandrill module? https://www.drupal.org/project/mandrill

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.