How to configure sendmail to use Gmail as SMTP server?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to configure sendmail to use Gmail as SMTP server?
Hi,
It seems my sendmail (running in slackware 13.0) cannot send out emails correctly. I guess I need to tell it what is the smtp server to use. And, I heard, gmail's smtp server is available to use for this purpose. Can anyone please help me to configure my sendmail this way?
It seems my sendmail (running in slackware 13.0) cannot send out emails correctly. I guess I need to tell it what is the smtp server to use. And, I heard, gmail's smtp server is available to use for this purpose. Can anyone please help me to configure my sendmail this way?
Thanks in advance.
-
narke
well the server address is smtp.gmail.com
And if you use the SSL the port will be 465
hey! thank you for all your replies. i will dive to study to see if i can work it out. Thanks again!
hi, experts
after read some documents i now come back with a feeling that it is really not an easy thing to learn. on the other hand, my purpose is only to let my sendmail use gmail's smtp relay service, so i think i need a minimum example that show the points. learning from an example is easier than go through the very long sendmail manuals.
it will be highly appreciated if you can help.
P.S. my smtp host does not has a DNS MX record and gets a private IP address, it is behind a firewall, but i can access internet.
If you want the easy way out, get msmtp. It is an smtp *client* and does what you want without fuss. sendmail is by default an smtp *server*, but can be strong-armed into acting as an smtp client -- but as you have seen it is not simple.
I did write a howto on using sendmail relay to the virginmedia server (link in sig). The vm server uses gmail so should be almost the same. The problem I found is that I had to use stunnel to create an ssl tunnel for sendmail to relay through.
So yes, msmtp is a much easier solution to it, and it's on slackbuilds.org.
Why would you use sendmail to send email to another smtp server? I don't know what setup you have, but it sounds as if anything would be simpler.
If you're simply trying to send emails with Mutt, then I third the suggestion for msmtp.
It's because my host is running some web services such wiki and a forum, their abilities of sending out email to users is based on the fact that the host gets smtp.
i don't think that gmail wants smtp servers to be using them as a mail relay. google's smtp server is intended for emails destined for their users (ie users with a @gmail.com account). i doubt they would allow you to relay email through them. even if they did you would have to authenticate to their smtp server first and this is something that smtp servers normally do not do. usually if you want an smtp server to be able to relay email through another smtp server they would have to permit their ip in order to do this. i am not saying that what you want to do is impossible; however it is something that smtp servers generally do not do nor need to do. if you need to relay email through an smtp server you should probably be using your ISP's smtp server.
EXTRA:
I believe gmail rewrites relayed message headers. However, some ISP-provided SMTP relays do not do this. Therefore, if your sendmail server does not have a FQDN, some spam filters will block your message.
This problem can be avoided by spoofing your headers. Using mutt, just add this line to your .muttrc :
Quote:
set envelope_from=yes
set from="My Name <my.address@isp.net>"
Let me know if you need any more help. Sendmail is an MTA. Most people don't understand this concept...
You are now on the road to enlightenment.
EDIT: If your ISP is blocking port 25, add this following line to your sendmail.mc to change the port to 587:
Code:
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
Last edited by granth; 01-26-2011 at 01:13 PM.
Reason: additional content
It's very strange! Before I post the first message in the thread, I thought that my host should not have ability to send out email without really a try, because the host only have a private IP addres (10.x.x.x) and sit behind a firewall.
But, today after I really tried it, I found the story is actually a little different. It can send out message (via mutt) to my company email address, but it just can not send out message to external email adress (such as my gmail account). And, I have totally no idea how this can happen!
Here are mail log when I sent email to my company email adress:
And, here is my /etc/resolve.conf
---------------------------
search ap.foo.net
nameserver 10.86.10.27
nameserver 10.86.10.21
----------------------------
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.