5

My mails are not being sent, even when I choose to send immediately.

My domain uses Gmail servers to handle our email accounts.

I'm assuming my settings at /civicrm/admin/mailSettings?action=update&id=1&reset=1 are not correct but I can't find any good tutorials. The documentation is not helpful to me.

5

It's possible to use Google Apps or GMail SMTP directly, but you will have to deal both with limitations of remote SMTP and with any resource limits enforced on your account (esp if using an @gmail.com or similar address).

If you have control of your server, I recommend using Postfix as a local MTA and configuring it to smarthost via Google Apps.

  • You'll see much better performance from CiviCRM if it can hand mails off rapidly to a local MTA, and
  • Postfix is far better at conversing with Google SMTP than CiviCRM.

See How do I configure SMTP with STARTTLS? (related question/answer) for why that is.

How to do this via Postfix relay instead

(This requires control of your hosting environment.)

In /etc/postfix/main.cf, configure

relayhost = [smtp.gmail.com]:587
smtp_use_tls=yes
smtp_sasl_auth_enable = yes
smtp_sasl_mechanism_filter = plain
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = 

In /etc/postfix/sasl_passwd, enter

[smtp.gmail.com]:587  yourusername@example.org:password

Run sudo postmap /etc/postfix/sasl_passwd

Run sudo service postfix reload

Now use local mail delivery, and watch /var/log/mail.log to ensure it gets handed off to Google's servers for delivery.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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