LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-06-2014, 06:59 AM   #1
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 16

Rep: Reputation: Disabled
Sending mail in Linux using mail command


Hi,
I want to send mail from linux to gmail server but am getting delivery failed mentioning "Connection refused."

But I am able to send the mail to yahoo server.

Can anyone help in setting for gmail server and how can I send mail to official gmail account.
 
Old 05-06-2014, 07:44 AM   #2
decenter
Member
 
Registered: Sep 2011
Distribution: Fedora release 21 (Twenty One)
Posts: 156

Rep: Reputation: 19
Are you sending mail from a system which is having a static IP address?

Try the following tutorial:

http://www.mavinerc.com/home/2012/04...tp-mail-relay/
 
Old 05-06-2014, 08:05 AM   #3
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
No, we have dynamic IP address.

Also, the link you provided states to install using yum and this yum command is not working in my Linux session.

How can I install package without yum?
 
Old 05-06-2014, 08:40 AM   #4
decenter
Member
 
Registered: Sep 2011
Distribution: Fedora release 21 (Twenty One)
Posts: 156

Rep: Reputation: 19
What distro are you using?
 
Old 05-06-2014, 02:43 PM   #5
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,340

Rep: Reputation: Disabled
Quote:
Originally Posted by coolpul View Post
I want to send mail from linux to gmail server but am getting delivery failed mentioning "Connection refused."
Where do you see this error message?

By default, most Mail Transfer Agents (MTA) come with a default configuration that specifies the use of DNS lookups for external mail delivery. The MTA will attempt to connect directly to the MX servers for the domain in question (gmail.com in this case), but since you're using a dynamic, public IP, most servers on the Internet will have been configured to reject the connection as a anti-spam measure.

You will probably need to configure your MTA to use a "smart host"; a relay server provided by your ISP specifically to avoid this issue. As for how you do this, that would depend on which distribution/MTA you're using.
 
Old 05-07-2014, 02:21 AM   #6
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
decenter,
I am using RedHat Linux 4 Enterprise edition

---------- Post added 05-07-14 at 12:52 PM ----------

Ser Olmy,
I am not sure which distribution/MTA I am using.

Can you help me out with this?
 
Old 05-07-2014, 05:14 AM   #7
decenter
Member
 
Registered: Sep 2011
Distribution: Fedora release 21 (Twenty One)
Posts: 156

Rep: Reputation: 19
I'm not sure of RHEL 4 but try to use up2date utility to install the packages (I think there will be similar packages in the RHEL 4 repository).
 
Old 05-07-2014, 05:40 AM   #8
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
On running up2date, I am getting "OpenSSL.SSL.Error".

Any idea regarding this?
 
Old 05-07-2014, 07:32 AM   #9
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,340

Rep: Reputation: Disabled
Quote:
Originally Posted by coolpul View Post
I am not sure which distribution/MTA I am using.

Can you help me out with this?
According to this article, RHEL 4 includes no less than 3 MTAs: sendmail, postfix and exim. The default is sendmail, but apparently one can use the "Mail Transport Agent Switcher" GUI application or the system-switch-mail-nox terminal command to select another MTA.

To make sendmail use a Smart Host, edit the /etc/mail/sendmail.mc file and add the line:
Code:
define(`SMART_HOST',`isp-smarthost.isp.com')
Replace isp-smarthost.isp.com with the fully qualified domain name of the Smart Host server provided by your ISP. Important: You must use the exact same quote characters as in the example above; mix up single quotes and backticks and it just won't work.

Once you've done that, you must run the make command in the /etc/mail directory and restart sendmail with service sendmail restart.
 
Old 05-30-2014, 01:28 AM   #10
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Ser Olmy,
Can you provide some example as am new to this.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail (mailserver) -- sending mail with the mail command -- doesn't work :-( carolinevdh Linux - Server 1 08-13-2009 09:43 PM
sending mail from win xp to linux imap mail server cvdsamy Red Hat 2 05-30-2009 12:37 AM
Sending mail by mailx command? lifeforce4 Debian 2 07-28-2008 05:00 PM
Sending mail with some attached files using "mail" command? zahadumy Linux - Software 3 05-27-2006 10:43 PM
Sending mail through command prompt moger Linux - General 1 02-18-2003 02:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:53 AM.

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