FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 10-05-2011, 09:45 AM
Alexander Farber
 
Default Howto use Gmail with sendmail on CentOS 6

Hello,

I hope nobody minds, if I post a short summary here for archives -

How to forward mails via Gmail account from CentOS 6

(I use sendmail, because haven't figured out how to setup Postfix yet):

# yum erase postfix
# yum install sendmail sendmail-cf cyrus-sasl-plain cyrus-sasl-md5

# mkdir /etc/mail/auth
# chmod 700 /etc/mail/auth

Create the file /etc/mail/auth/client-info:

AuthInfo:smtp.gmail.com "U:smmsp" "I:your_gmail_address"
"P:your_password" "M:PLAIN"
AuthInfo:smtp.gmail.com:587 "U:smmsp" "I:your_gmail_address"
"P:your_password" "M:PLAIN"

# cd /etc/mail/auth
# makemap -r hash client-info.db < client-info
# chmod 600 client-info client-info.db

Then edit /etc/mail/sendmail.mc (most lines are there already
and just need to be uncommented and edited a bit):

define(`SMART_HOST', `smtp.gmail.com')dnl

define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5
LOGIN PLAIN')dnl

FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl

define(`confCACERT_PATH', `/etc/pki/tls/certs')dnl
define(`confCACERT', `/etc/pki/tls/certs/ca-bundle.crt')dnl
define(`confSERVER_CERT', `/etc/pki/tls/certs/sendmail.pem')dnl
define(`confSERVER_KEY', `/etc/pki/tls/certs/sendmail.pem')dnl
define(`confCLIENT_CERT', `/etc/pki/tls/certs/sendmail.pem')dnl
define(`confCLIENT_KEY', `/etc/pki/tls/certs/sendmail.pem')dnl

Then create certificates (I've used "DE", "NRW", "Bochum",
"my hostname", "my gmail address" there as input):

# cd /etc/pki/tls/certs
# make sendmail.pem

Append the following line to /etc/aliases:

root: your_gmail_address

and run "newaliases". If you need, also append
"apache" to /etc/mail/trusted-users. Finally:

# cd /etc/mail
# make (this will generate new sendmail.cf)
# service sendmail restart

and check the /var/log/maillog for error messages
while sending test mail messages from command line.

Regards
Alex
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 10:36 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org