Exim4 and Gmail

Forum for questions and support relating to the 1.28.x releases only.
Locked
swulf
Posts: 15
Joined: Tue Jun 30, 2015 4:07 am

Exim4 and Gmail

Post by swulf »

I'm trying to set up my Zoneminder 1.28.1 to send email to my Gmail account using exim4. I have followed instructions found on the web in several places and am close to having it working I suspect. Of course there are those final hurdles...

Cutting to the chase, if I send email to Gmail like this:

Code: Select all

echo "Testing email." | mail -s Test me@mine.org
while monitoring the exim4 log thus

Code: Select all

sudo tail -f /var/log/exim4/mainlog
I see this sort of thing:

Code: Select all

2015-08-23 15:46:58 1ZTe2U-0002Sj-6M <= me@zmbox.net U=me P=local S=472
2015-08-23 15:46:58 1ZTe2U-0002Sj-6M gmail-smtp-msa.l.google.com [2607:f8b0:400e:c03::6c] Network is unreachable
2015-08-23 15:46:58 1ZTe2U-0002Sj-6M ** recipient@destination.org R=smarthost T=remote_smtp_smarthost: SMTP error from remote mail server after MAIL FROM:<me@zmbox> SIZE=1510: host gmail-smtp-msa.l.google.com [74.125.129.108]: 530-5.5.1 Authentication Required. Learn more at\n530 5.5.1  https://support.google.com/mail/answer/14257 kd3sm15046894pad.15 - gsmtp
2015-08-23 15:46:59 1ZTe2V-0002So-1j <= <> R=1ZTe2U-0002Sj-6M U=Debian-exim P=local S=1525
2015-08-23 15:46:59 1ZTe2U-0002Sj-6M Completed
2015-08-23 15:46:59 1ZTe2V-0002So-1j gmail-smtp-msa.l.google.com [2607:f8b0:400e:c02::6c] Network is unreachable
2015-08-23 15:46:59 1ZTe2V-0002So-1j ** me@zmbox.net R=smarthost T=remote_smtp_smarthost: SMTP error from remote mail server after MAIL FROM:<> SIZE=2588: host gmail-smtp-msa.l.google.com [74.125.129.108]: 530-5.5.1 Authentication Required. Learn more at\n530 5.5.1  https://support.google.com/mail/answer/14257 kw3sm14977235pbc.30 - gsmtp
2015-08-23 15:46:59 1ZTe2V-0002So-1j Frozen (delivery error message)
I've confirmed the machine can see the network and that the Google server can be resolved from the command line. The password to the Google Gmail account I am using, and its username, are confirmed correct and verified by logging in to the account at Google. The username and password in passwd.client are correct.

Also: I am unable to delete 'frozen' messages according to instructions here http://bradthemad.org/tech/notes/exim_cheatsheet.php. I get

Code: Select all

exim: permission denied
Can anyone point me to some clues as to how I can fix this? Seems like it shouldn't be so hard...

Thank you.
chippy99
Posts: 66
Joined: Wed Aug 30, 2006 5:38 pm
Location: Barnet, Herts. UK

Re: Exim4 and Gmail

Post by chippy99 »

Have you tried enabling less secure apps to access gmail as documented here https://support.google.com/accounts/answer/6010255
swulf
Posts: 15
Joined: Tue Jun 30, 2015 4:07 am

Re: Exim4 and Gmail

Post by swulf »

I have made the suggested change at Google's site and my Zoneminder machine still cannot send email to the account. =(

Thanks for the suggestion though, I didn't know about that option.
swulf
Posts: 15
Joined: Tue Jun 30, 2015 4:07 am

Re: Exim4 and Gmail

Post by swulf »

I learned one thing here - to delete frozen messages the following works:

Code: Select all

sudo exiqgrep -z -i | xargs sudo exim -Mrm
while this doesn't:

Code: Select all

sudo exiqgrep -z -i | xargs exim -Mrm
chippy99
Posts: 66
Joined: Wed Aug 30, 2006 5:38 pm
Location: Barnet, Herts. UK

Re: Exim4 and Gmail

Post by chippy99 »

Are you still getting same error message ? If so, and you are definitely sending correct credentials, suggest you follow link google is sending back to you (just after the learn more message).
swulf
Posts: 15
Joined: Tue Jun 30, 2015 4:07 am

Re: Exim4 and Gmail

Post by swulf »

Yes, I have visited the page. I've followed the directions and it doesn't change the errors I get.

I suspect that TLS should be enabled in Exim4 in order to make the connection to Google but I have not been able to discover how to do that yet. I did find an article on the web indicating that the messages posted in the Exim4 log when an email is sent should indicate that TLS is being used, but the messages in my log do not show that.

If someone has this sort of setup working perhaps they might be able to share some of their configuration information with me.
Locked