LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-11-2011, 08:39 PM   #1
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Rep: Reputation: Disabled
Sendmail to use Gmail's SMTP to send mail


Hi there!

I am trying to configure sendmail to use GMail to send emails. I followed the instructions at http://www.phinesolutions.com/sendma...lay-howto.html but it failed.

After I was done with these instructions, I think I "cooked" sendmail... Can no longer configure it and it seems that I will have to start from scratch again...

Anybody can provide direction? How to get sendmail to send emails using Gmail's SMTP server?

Thanks!
 
Old 04-12-2011, 04:41 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
The link you provided looks great and appears to work well. I don't understand what else we are supposed to say..?
 
Old 04-12-2011, 04:50 PM   #3
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
Well I should have been more descriptive....

Like i said, I followed the instructions at that link, but for some reasons, it no longer works. I am trying to send an email using a python script somebody put together, and before I tried to modify sendmail, the emails were at least created, but could not be delivered (due to the misconfiguration and not using Gmail's smtp). At least, I could see them as "Deferred" in root's inbox. I am using Webmin to manage my server and see the inboxes.

Now since I tried to modify sendmail to use Gmail's smtp servers, I no longer can access sendmail's config page (in Webmin) nor I can see root's inbox. I also dont receive the emails so this means that they are not sent. When I try to access sendmail's config page in webmin, it says:

Quote:
Your sendmail config file does not appear to be for the latest sendmail version. Webmin only supports versions 8.8 and above.
Sendmail.cf has this in it (looks rather incomplete to me...)

Quote:
FEATURE('authinfo','hash /etc/mail/auth/client-info.db')












TRUST_AUTH_MECH('EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')
Thats what I mean by "cooked" What should I do?

Thanks!

Last edited by lpallard; 04-12-2011 at 04:52 PM.
 
Old 04-26-2011, 09:14 PM   #4
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
Bump.. Anybody?

Anybody configured sendmail to use an external email server to send email?? Cant believe Im the only one to have tried this...
 
Old 04-27-2011, 02:04 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Well I'd certainly steer clear of webmin for anything at all. I'd also personally steer clear of sendmail as it's ancient and complicated compared to, for example, Postfix. You're never going to get anywhere using webmin errors to base a diagnosis on, what actually happens in the mail logs? Does sendmail start? Is that all that is in the cf file?? What about the sendmail.mc?
 
Old 04-27-2011, 04:49 AM   #6
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
Well in light of your reply I think the best course of action is to ignore webmin for what it says and delete the config files of sendmail and restart fresh. What happens I think is somehow the procedure I followed was either flawed or I screwed up doing it (more likely to be this one) and resulted in an incomplete config file.

So if I get this straight, you're recommending to get away from sendmail for the default system email client? As for webmin you also recommend staying away from it? I use webmin on my server to have all features and info available in the same location and be able to remotely control them. Do you have a suggestion for a better replacement?

Last edited by lpallard; 04-27-2011 at 04:51 AM.
 
Old 04-27-2011, 05:32 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Sendmail is still the most prolific SMTP server on the web, and it's extremely good, it's just complicated and obscure - I mean, it has a config file to manage the config file!

I would never want to use an all-in-one tool for management like that. I wold rather know the actual products I'm using. SSH works well for me.
 
Old 04-27-2011, 09:26 AM   #8
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
You have to enable smtp at gmail account.
Go to gmail settings and enable forwarding POP IMAP

Last edited by EDDY1; 04-27-2011 at 09:33 AM.
 
Old 04-30-2011, 02:09 PM   #9
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
OK after a few weeks off the keyboard, I am coming back to this topic.

I've restarted from scratch and completely ignoring webmin this time. Here's where I think the problem is:

My sendmail.mc file is:


Code:
FEATURE(`authinfo',`hash /etc/mail/auth/client-info.db')dnl
define(`SMART_HOST',`smtp.gmail.com')dnl
define(`RELAY_MAILER_ARGS',`TCP $h 587')
define(`ESMTP_MAILER_ARGS',`TCP $h 587')
define(`CERT_DIR',`/etc/mail/certs')
define(`confCACERT_PATH',`CERT_DIR')
define(`confCACERT',`CERT_DIR/ca-bundle.crt')
define(`confCRL',`CERT_DIR/ca-bundle.crt')
define(`confSERVER_CERT',`CERT_DIR/sendmail.pem')
define(`confSERVER_KEY',`CERT_DIR/sendmail.pem')
define(`confCLIENT_CERT',`CERT_DIR/sendmail.pem')
define(`confCLIENT_KEY',`CERT_DIR/sendmail.pem')
define(`confAUTH_MECHANISMS',`EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')
Now I know m4 used to generate the sendmail.cf file is sensitive to the stupid quote marks... Are they all OK? No syntax errors there???

Then I used

m4 sendmail.mc > sendmail.cf

and got a sendmail.cf file with this in it:

Code:
FEATURE(authinfo,hash /etc/mail/auth/client-info.db)










TRUST_AUTH_MECH(EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN)
Like I said, it looks incomplete to me...

THen I restarted the sendmail daemon and got this output:
Code:
root@server:/etc/mail# /etc/rc.d/rc.sendmail start
Starting sendmail MTA daemon:  /usr/sbin/sendmail -L sm-mta -bd -q25m
451 4.0.0 /etc/mail/sendmail.cf: line 1: fileclass: cannot open 'ATURE(authinfo,hash': No such file or directory
554 5.0.0 No local mailer defined
554 5.0.0 QueueDirectory (Q) option must be set
Starting sendmail MSP queue runner:  /usr/sbin/sendmail -L sm-msp-queue -Ac -q25m
Then I tested sendmail with

mail email@domail.com and entering subject/text body and pressing Crtl+D but I never gor the email.

So this confirms that something is wrong. Whats the problem?

Thanks!
 
Old 04-30-2011, 04:10 PM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
451 4.0.0 /etc/mail/sendmail.cf: line 1: fileclass: cannot open 'ATURE(authinfo,hash': No such file or directory
I don't see something wrong in the .mc file, but looks line there is an error at the beginning(maybe some not printed characters), so the resulting .cf is bungled.
Take a look at this howto
, here at LQ (just the "Client-Side SMTP AUTH + SMART_HOST" section) to recreate a correct .mc file

Regards
 
Old 05-01-2011, 10:58 AM   #11
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
OK I got past the last point where I was, now I have a decent sendmail.cf file... but I still cant send mails. I have this in my /var/log/maillog:

Quote:
May 1 11:57:10 server sendmail[9707]: p41FvAZh009707: from=root, size=224, class=0, nrcpts=1, msgid=<201105011557.p41FvAZh009707@server.localdomain>, relay=root@localhost
May 1 11:57:10 server sm-mta[9708]: p41FvART009708: from=<root@server.localdomain>, size=467, class=0, nrcpts=1, msgid=<201105011557.p41FvAZh009707@server.localdomain>, proto=ESMTP, daemon=M$
May 1 11:57:10 server sendmail[9707]: p41FvAZh009707: to=email@gmail.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30224, relay=[127.0.0.1] [127.0.0.1],$
May 1 11:57:11 server sm-mta[9710]: STARTTLS=client, relay=smtp.gmail.com, version=TLSv1/SSLv3, verify=FAIL, cipher=RC4-SHA, bits=128/128
May 1 11:57:11 server sm-mta[9710]: p41FvART009708: to=<email@gmail.com>, ctladdr=<root@server.localdomain> (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=120467, relay=smt$
May 1 11:57:11 server sm-mta[9710]: p41FvART009708: p41FvBRT009710: DSN: Service unavailable
May 1 11:57:11 server sm-mta[9710]: p41FvBRT009710: to=<root@server.localdomain>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31682, dsn=2.0.0, stat=Sent
As you can see, the 4th line has

version=TLSv1/SSLv3, verify=FAIL

that is probably why it doesn't work. Anybody would know what could be wrong?
 
Old 05-01-2011, 11:48 AM   #12
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
This is not an error. The problem is
Quote:
May 1 11:57:11 server sm-mta[9710]: p41FvART009708: p41FvBRT009710: DSN: Service unavailable
This is because gmail does not accept auth on smtp port 25, but on submission port 587. Take a look here to see what you need to change

Regards
 
Old 05-01-2011, 01:05 PM   #13
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
I finally got it to work!! The instructions at http://www.phinesolutions.com/sendma...lay-howto.html were either incomplete or not meant to be implemented on a slackware machine, I am no Sendmail expert to comment ion that but I used the instructions of http://www.linuxha.com/other/sendmail/gmail.html and with small modifications such as ISP name and file names, it works perfectly!

Thanks to all!!!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to configure sendmail to use Gmail as SMTP server? narke Slackware 23 03-10-2014 02:02 PM
Sendmail SMTP send doesn't work with OS X 10.6 mail.app clients tedcox Linux - Server 4 09-19-2011 02:13 AM
[SOLVED] Exim SMTP problem delivering mail to gmail. dracuss Linux - Server 5 02-22-2011 08:43 AM
how to send mail to my gmail account through sendmail shridhar005 Linux - Newbie 5 01-22-2009 05:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration