TUTORIAL Install gMail as SMTP SmartHost for SendMail

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,198
Reaction score
5,218
The first message in this thread has everything you need. :wink5:
 

rjm

Guru
Joined
Oct 21, 2007
Messages
475
Reaction score
21
Makemap is kicking back errors.

makemap: genericstable: line1: no RHS for LSH pbx.dyndns.org

Anyone have any ideas?

Thanks
 

jeffersonkim

New Member
Joined
Sep 12, 2008
Messages
25
Reaction score
0
I gave up and just used Nerd Vittles package of PBX In a Flash.

I just installed it and everything was already setup, nice and easy :]
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
I can't get this to send emails from my gmail account. For some reason, my auth keeps failing. :-( I know that I typed in the correct password and everything.
Here is the log:
Code:
Aug 22 21:34:00 pbx sendmail[26143]: o7N1Xxfv026143: from=<[email protected]>, size=6767, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA, relay=myfqdn.com [127.0.0.1]
Aug 22 21:34:00 pbx sendmail[26145]: STARTTLS=client, relay=smtp.gmail.com, version=TLSv1/SSLv3, verify=FAIL, cipher=RC4-MD5, bits=128/128
Aug 22 21:34:00 pbx sendmail[26145]: AUTH=client, relay=smtp.gmail.com [74.125.157.109], authinfo failed
Aug 22 21:34:00 pbx sendmail[26145]: o7N1Xxfv026143: to=<[email protected]>, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=126767, relay=smtp.gmail.com [74.125.157.109], dsn=5.0.0, stat=Service unavailable
Aug 22 21:34:00 pbx sendmail[26145]: o7N1Xxfv026143: to=<[email protected]>, delay=00:00:00, mailer=local, pri=126767, dsn=5.1.1, stat=User unknown
Aug 22 21:34:00 pbx sendmail[26145]: o7N1Xxfv026143: o7N1Y0fv026145: postmaster notify: User unknown
Aug 22 21:34:00 pbx sendmail[26145]: o7N1Y0fv026145: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=38063, dsn=2.0.0, stat=Sent

And my client-info, sanitized:
Code:
AuthInfo:"smtp.gmail.com" U:"smmsp" I:"myemail" P:"mYpAsS" M:"PLAIN"
AuthInfo:"smtp.gmail.com:587  U:"smmsp" I:"myemail" P:"mYpAsS" M:"PLAIN"
AuthInfo:"smtp.gmail.com:465" U:"smmsp" I:"myemail" P:"mYpAsS" M:"PLAIN"
 

grumpy

Member
Joined
Mar 3, 2008
Messages
123
Reaction score
0
Code:
AuthInfo:smtp.gmail.com “U:root” “I:[email protected]” “P:password”  “M:PLAIN”
AuthInfo:smtp.gmail.com:587 “U:root” “I:[email protected]” “P:password”  “M:PLAIN”
I know in Wards instruction he says not to use gmail.com. But I believed I had too, and I do not think you need both 465 and 587. (don't know if it will hurt though) In Wards orginal post he provides a link and thanks to
http://www.linuxha.com/other/sendmail/index.html

Linux Home Automation who links to three other sites that do provide the full [email protected]
 

Pooh-Bah

New Member
Joined
Aug 10, 2010
Messages
6
Reaction score
0
I can't get this to send emails from my gmail account. For some reason, my auth keeps failing. :-( I know that I typed in the correct password and everything.

And my client-info, sanitized:
Code:
AuthInfo:"smtp.gmail.com" U:"smmsp" I:"myemail" P:"mYpAsS" M:"PLAIN"
AuthInfo:"smtp.gmail.com:587  U:"smmsp" I:"myemail" P:"mYpAsS" M:"PLAIN"
AuthInfo:"smtp.gmail.com:465" U:"smmsp" I:"myemail" P:"mYpAsS" M:"PLAIN"
Your quotes are all in the wrong places.
 

MyKroFt

Guru
Joined
Oct 31, 2008
Messages
659
Reaction score
3
I can't get this to send emails from my gmail account.
And my client-info, sanitized:
Code:
AuthInfo:"smtp.gmail.com" U:"smmsp" I:"myemail" P:"mYpAsS" M:"PLAIN"
AuthInfo:"smtp.gmail.com:587  U:"smmsp" I:"myemail" P:"mYpAsS" M:"PLAIN"
AuthInfo:"smtp.gmail.com:465" U:"smmsp" I:"myemail" P:"mYpAsS" M:"PLAIN"

should be:

Code:
AuthInfo:smtp.gmail.com "U:smmsp" "I:myemail" "P:mYpAsS" "M:PLAIN"
AuthInfo:smtp.gmail.com:587 "U:smmsp" "I:myemail" "P:mYpAsS" "M:PLAIN"
AuthInfo:smtp.gmail.com:465 "U:smmsp" "I:myemail" "P:mYpAsS" "M:PLAIN"
if you take the orig echo command like I have suggested it be updated to (this is the #1 prob ppls have with this setup) but change every " to /" in that echo command and the quotes will show up correctly.

Code:
echo AuthInfo:smtp.gmail.com \"U:smmsp\" \"I:user_id\" \"P:password\" \"M:PLAIN\" > client-info
echo AuthInfo:smtp.gmail.com:587 \"U:smmsp\" \"I:user_id\" \"P:password\" \"M:PLAIN\" >> client-info
echo AuthInfo:smtp.gmail.com:465 \"U:smmsp\" \"I:user_id\" \"P:password\" \"M:PLAIN\" >> client-info
Myk
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
It's been a while since I checked this thread, but I changed the authinfo text and I am just waiting to see if it will work now.
Code:
AuthInfo:smtp.gmail.com "U:smmsp" "I:[email protected]" "P:password" "M:PLAIN"
AuthInfo:smtp.gmail.com:587 "U:smmsp" "I:[email protected]" "P:password" "M:PLAIN"
AuthInfo:smtp.gmail.com:465 "U:smmsp" "I:[email protected]" "P:password" "M:PLAIN"
And, yes, I know you aren't supposed to put the domain in there but this is on an Apps account so it has to have the domain.
YAYAYAY! It works now! :D
 

ghurty

Senior Member
Joined
Jan 13, 2009
Messages
852
Reaction score
4
I had it working, but now I am getting the following error:
stat=Service unavailable

Code:
Jan  2 23:47:09 pbx sendmail[6049]: p034l8LC006047: to=<[email protected]>,<[email protected]>, ctladdr=<[email protected]> (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=331496, relay=smtp.gmail.com [74.125.93.109], dsn=5.0.0, stat=Service unavailable
Jan  2 23:47:09 pbx sendmail[6049]: p034l8LC006047: p034l9LC006049: DSN: Service unavailable


Thanks
 

randy7376

Defnyddiwr Gweithredol
Joined
Sep 29, 2010
Messages
864
Reaction score
144
It seems a lot of ISPs are blocking port 25 these days.

If you
Code:
 telnet smtp.gmail.com 25
do you get mail server's banner or does it just timeout?

If it times out, you've probably been blocked. Other places to check would be iptables on the PBX or your firewall/router for anything handling port 25 / SMTP.

It's probably blocked especially if you haven't touched anything. I know AT&T here in Fort Worth blocks outbound to 25. :banghead:

The secure ports are usually OK, however.
 

ghurty

Senior Member
Joined
Jan 13, 2009
Messages
852
Reaction score
4
It does time out, however the other ports (587, etc..) do work so the setup should work but it doesnt.


Thakns
 

randy7376

Defnyddiwr Gweithredol
Joined
Sep 29, 2010
Messages
864
Reaction score
144
Typically, this could be a name-resolution issue. Have you changed anything in DNS or the /etc/hosts file on the PBX, recently?
 

wa4zlw

Member
Joined
Feb 14, 2008
Messages
845
Reaction score
22
I've been through this over and over - new purple

I've tried the gmail route and my ISPs mail server. Were getting to the various mail servers but seems authentication is needed:

Message 376:
From [email protected] Sat Jan 22 17:06:28 2011
Date: Sat, 22 Jan 2011 17:06:28 -0500
From: Mail Delivery Subsystem <[email protected]>
To: <[email protected]>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="p0MM6S9H005873.1295733988/pbx.wa4zlw.homedns.org"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

This is a MIME-encapsulated message

--p0MM6S9H005873.1295733988/pbx.wa4zlw.homedns.org

The original message was received at Sat, 22 Jan 2011 17:06:27 -0500
from pbx.wa4zlw.homedns.org [127.0.0.1]

----- The following addresses had permanent fatal errors -----
<[email protected]>
(reason: 530 authentication needed)

----- Transcript of session follows -----
... while talking to promail.ptd.net.:
>>> MAIL From:<[email protected]> SIZE=622
<<< 530 authentication needed
554 5.0.0 Service unavailable

--p0MM6S9H005873.1295733988/pbx.wa4zlw.homedns.org
Content-Type: message/delivery-status

Reporting-MTA: dns; pbx.wa4zlw.homedns.org
Received-From-MTA: DNS; pbx.wa4zlw.homedns.org
Arrival-Date: Sat, 22 Jan 2011 17:06:27 -0500

Final-Recipient: RFC822; [email protected]
Action: failed
Status: 5.0.0
Diagnostic-Code: SMTP; 530 authentication needed
Last-Attempt-Date: Sat, 22 Jan 2011 17:06:28 -0500

--p0MM6S9H005873.1295733988/pbx.wa4zlw.homedns.org
Content-Type: message/rfc822

Return-Path: <[email protected]>
Received: from pbx.wa4zlw.homedns.org (pbx.wa4zlw.homedns.org [127.0.0.1])
by pbx.wa4zlw.homedns.org (8.13.8/8.13.8) with ESMTP id p0MM6R9H005871
for <[email protected]>; Sat, 22 Jan 2011 17:06:27 -0500
Received: (from root@localhost)
by pbx.wa4zlw.homedns.org (8.13.8/8.13.8/Submit) id p0MM6RcS005870
for [email protected]; Sat, 22 Jan 2011 17:06:27 -0500
Date: Sat, 22 Jan 2011 17:06:27 -0500
From: root <[email protected]>
Message-Id: <[email protected]>
To: [email protected]
Subject: direct test

testing 1,2,3

--p0MM6S9H005873.1295733988/pbx.wa4zlw.homedns.org--

&
At EOF
& q
Saved 5 messages in mbox
Held 371 messages in /var/spool/mail/root
root@pbx:/etc/mail $

my authinfo:

root@pbx:/etc/mail/auth $ cat client-info
AuthInfo:[promail.ptd.net] "U:smmsp" "I:user" "P:pwd" "M:pLAIN"
AuthInfo:[promail.ptd.net:587] "U:smmsp" "I:user" "P:pwd" "M:pLAIN"
AuthInfo:[promail.ptd.net:465] "U:smmsp" "I:user" "P:pwd" "M:pLAIN"
root@pbx:/etc/mail/auth $

it seems gmail and my provider require TLS and I've attempted to turn that stuff on and then it seems certs are missing. Attempting to configure/compile that in seems to cause errors.
looking for some guidance.

there has to be a simpler way to do this :-(

thanks leon
 

wa4zlw

Member
Joined
Feb 14, 2008
Messages
845
Reaction score
22
HI Folks...

I've gone through this again and there's something I have to be missing as I can not get Sendmail to authenticate with TLS. I've tried all permutations (gmail - yes I have a gmail account, comcast version modified for my ISP and modified for my own mail host outside of my ISP). All require userid/password auth.

looking @ maillog it seems certs are lacking...looking for an assist please

Jan 25 16:36:34 pbx sendmail[13734]: p0PLaW3m013732: SMTP outgoing connect on pbx.wa4zlw.homedns.org
Jan 25 16:36:34 pbx sendmail[13734]: STARTTLS: ClientCertFile missing
Jan 25 16:36:34 pbx sendmail[13734]: STARTTLS: ClientKeyFile missing
Jan 25 16:36:34 pbx sendmail[13734]: STARTTLS: CACertPath missing
Jan 25 16:36:34 pbx sendmail[13734]: STARTTLS: CACertFile missing
Jan 25 16:36:34 pbx sendmail[13734]: STARTTLS: CRLFile missing
Jan 25 16:36:34 pbx sendmail[13734]: STARTTLS=client, init=1
Jan 25 16:36:34 pbx sendmail[13734]: STARTTLS=client, start=ok
Jan 25 16:36:34 pbx sendmail[13734]: STARTTLS=client, info: fds=11/10, err=2
Jan 25 16:36:35 pbx sendmail[13734]: STARTTLS=client, info: fds=11/10, err=2
Jan 25 16:36:35 pbx sendmail[13734]: STARTTLS=client, get_verify: 20 get_peer: 0x889a4c8
Jan 25 16:36:35 pbx sendmail[13734]: STARTTLS=client, relay=gmail-smtp-msa.l.google.com., version=TLSv1/SSLv3, veri$
Jan 25 16:36:35 pbx sendmail[13734]: STARTTLS=client, cert-subject=/C=US/ST=California/L=Mountain+20View/O=Google+2$
Jan 25 16:36:35 pbx sendmail[13734]: STARTTLS=read, info: fds=11/10, err=2
Jan 25 16:36:35 pbx sendmail[13734]: AUTH=client, relay=gmail-smtp-msa.l.google.com., mech=, bits=0
Jan 25 16:36:35 pbx sendmail[13734]: STARTTLS=read, info: fds=11/10, err=2
Jan 25 16:36:35 pbx sendmail[13734]: p0PLaW3m013732: to=<[email protected]>, ctladdr=<[email protected]> (0$
Jan 25 16:36:35 pbx sendmail[13734]: p0PLaW3m013732: p0PLaZ3m013734: DSN: Service unavailable
Jan 25 16:36:35 pbx sendmail[13734]: p0PLaZ3m013734: to=<[email protected]>, delay=00:00:00, xdelay=00:00$
Jan 25 16:36:35 pbx sendmail[13734]: p0PLaZ3m013734: done; delay=00:00:00, ntries=1
Jan 25 16:36:35 pbx sendmail[13734]: p0PLaW3m013732: done; delay=00:00:03, ntries=1
Jan 25 16:36:35 pbx sendmail[13734]: STARTTLS=read, info: fds=11/10, err=2
Jan 25 16:36:35 pbx sendmail[13734]: STARTTLS=client, SSL_shutdown not done
 

dswartz

Guru
Joined
Feb 17, 2009
Messages
1,056
Reaction score
0
I know this is not what you are asking, but have you considered replacing sendmail with postfix? Life will get easier (and safer.)
 

wa4zlw

Member
Joined
Feb 14, 2008
Messages
845
Reaction score
22
Hi there...Been there and done that. That was failing too for the same problem. Doing auth and certs with postfix is a PITA too. :banghead:
 

dswartz

Guru
Joined
Feb 17, 2009
Messages
1,056
Reaction score
0
Not to be argumentative, but sasl with postfix (as a client) is absolutely trivial. TLS is maybe not so easy. That seems orthogonal to TLS - do you really need the latter? If not, I can show you how to get postfix using SASL in about 5 minutes on a centos box...
 

wa4zlw

Member
Joined
Feb 14, 2008
Messages
845
Reaction score
22
I'm game for anything this is taking way too much time
 

wa4zlw

Member
Joined
Feb 14, 2008
Messages
845
Reaction score
22
I've reinstalled postfix from webmin and I'[ve disabled sendmail (that's the easy part) :smile5:
 

wa4zlw

Member
Joined
Feb 14, 2008
Messages
845
Reaction score
22
ok I found an article and I got further than before; get a can store backend something or other down below....

Jan 25 18:32:46 pbx postfix/postfix-script: starting the Postfix mail system
Jan 25 18:32:46 pbx postfix/master[30297]: daemon started -- version 2.3.3, configuration /etc/postfix
Jan 25 18:33:18 pbx sendmail[30305]: p0PNXInh030305: from=root, size=51, class=0, nrcpts=1, msgid=<201101252333.p0P$
Jan 25 18:33:18 pbx postfix/smtpd[30306]: warning: SASL authentication failure: OTP: auxprop backend can't store pr$
Jan 25 18:33:18 pbx postfix/smtpd[30306]: connect from pbx.wa4zlw.homedns.org[127.0.0.1]
Jan 25 18:33:18 pbx postfix/smtpd[30306]: 93D0CB8016: client=pbx.wa4zlw.homedns.org[127.0.0.1], sasl_sender=root@pb$
Jan 25 18:33:18 pbx postfix/cleanup[30309]: 93D0CB8016: message-id=<[email protected].$
Jan 25 18:33:18 pbx postfix/qmgr[30300]: 93D0CB8016: from=<[email protected]>, size=561, nrcpt=1 (queue a$
Jan 25 18:33:18 pbx sendmail[30305]: p0PNXInh030305: [email protected], ctladdr=root (0/0), delay=00:00:00, xdelay$
 

Members online

Forum statistics

Threads
25,803
Messages
167,722
Members
19,232
Latest member
voiplads
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top