LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-28-2019, 09:59 PM   #1
sysmicuser
Member
 
Registered: Mar 2010
Posts: 458

Rep: Reputation: 0
Unhappy Unable to send email from newly provisioned Server on Azure Cloud


Hey Guys,

Wondering what could be wrong as I'm unable to send mail from RHEL 7.6

Code:
[root@fredjiraserver log]# echo "Talking from $(hostname -s)"| mail -s "Test Subject" testme@gmail.com
[root@fredjiraserver log]# send-mail: Cannot open mail:25

[root@fredjiraserver log]# mailx
No mail for root
[root@fredjiraserver log]# mail
No mail for root
[root@fredjiraserver log]# echo "Talking from $(hostname -s)"| mail -s "Test Subject" test@gmail.com
[root@fredjiraserver log]# send-mail: Cannot open mail:25

[root@localhost log]# tail -100f /var/log/maillog
Mar 29 10:00:19 localhost sSMTP[6274]: Unable to locate mail
Mar 29 10:00:19 localhost sSMTP[6274]: Cannot open mail:25
Mar 29 10:00:28 localhost sSMTP[6283]: Unable to locate mail
Mar 29 10:00:28 localhost sSMTP[6283]: Cannot open mail:25
Mar 29 10:07:28 localhost sSMTP[12543]: Unable to locate mail
Mar 29 10:07:28 localhost sSMTP[12543]: Cannot open mail:25
Mar 29 12:07:50 localhost sSMTP[18016]: Unable to locate mail
Mar 29 12:07:50 localhost sSMTP[18016]: Cannot open mail:25
Mar 29 12:10:28 localhost sSMTP[18257]: Unable to locate mail
Mar 29 12:10:28 localhost sSMTP[18257]: Cannot open mail:25
Mar 29 13:46:21 localhost sSMTP[22355]: Unable to locate mail
Mar 29 13:46:21 localhost sSMTP[22355]: Cannot open mail:25

[root@localhost log]# systemctl status mailx
Unit mailx.service could not be found.
[root@localhost log]# systemctl status mail
Unit mail.service could not be found.

[root@localhost log]# cat /etc/*release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.6 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.6"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.6 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.6:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.6"
Red Hat Enterprise Linux Server release 7.6 (Maipo)
Red Hat Enterprise Linux Server release 7.6 (Maipo)
[root@localhost log]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)
Is it because a daemon is not running or the mailx or mail package is not installed?

P.S: mailx is there, mail package does not exist.

Code:
Package mailx-12.5-19.el7.x86_64 already installed and latest version
Nothing to do
yum install mail
Loaded plugins: langpacks, product-id, search-disabled-repos
No package mail available.
Error: Nothing to do

Last edited by sysmicuser; 03-28-2019 at 10:04 PM.
 
Old 03-28-2019, 10:08 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
mailx/mail is an email client.

Do you have an email server running?
Code:
netstat -tnl | grep 25
Have you opened a ticket with Red Hat?
 
Old 03-28-2019, 10:12 PM   #3
sysmicuser
Member
 
Registered: Mar 2010
Posts: 458

Original Poster
Rep: Reputation: 0
Unhappy

The below returns nothing, would Red Hat for a free Azure VM, I wonder? I just want an empty standalone server to send email to my Gmail, so we need a client? not server?

My sincere apologies if I sound stupid.

Code:
[root@localhost log]# netstat -tnl | grep 25
 
Old 03-28-2019, 10:46 PM   #4
sysmicuser
Member
 
Registered: Mar 2010
Posts: 458

Original Poster
Rep: Reputation: 0
This is what I get when I run the subscription status command on the newly provisioned server.

Code:
 subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Unknown


WARNING

The yum/dnf plugins: /etc/yum/pluginconf.d/subscription-manager.conf were automatically enabled for the benefit of Red Hat Subscription Management. If not desired, use "subscription-manager config --rhsm.auto_enable_yum_plugins=0" to block this behavior.
 
Old 03-29-2019, 01:00 PM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by sysmicuser View Post
The below returns nothing, would Red Hat for a free Azure VM, I wonder? I just want an empty standalone server to send email to my Gmail, so we need a client? not server?

My sincere apologies if I sound stupid.

Code:
[root@localhost log]# netstat -tnl | grep 25
Then, no, you do not have a server (sendmail, postfix, qmail, etc) running, so there's nothing to send email with. We can't tell from this if you have a server installed.

You can configure your client to use gmail instead of your server, if you don't want to run a mail server. See man mail

[strike]Aren't you paying RedHat for licensing and support? If not, you shouldn't be using it.[\strike]
Edit: On further thought, it may be included.

Last edited by scasey; 03-29-2019 at 07:48 PM.
 
1 members found this post helpful.
Old 03-29-2019, 07:52 PM   #6
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by sysmicuser View Post
My sincere apologies if I sound stupid.
"Stupid is as stupid does" -- Forrest Gump
You do not sound stupid.
Do you know how to
1. See if postfix is installed on your server
2. Start it if it is installed?

"No" is an acceptable answer, but if you do know how to do those things, please do them and report back.
 
Old 03-31-2019, 10:15 PM   #7
sysmicuser
Member
 
Registered: Mar 2010
Posts: 458

Original Poster
Rep: Reputation: 0
Hi Sean,

Sincerely appreciate your assistance. We as an organization have a mail server, Office 365 mail server so should I still install a mail server on my RHEL 7.6 server? If I don't wish to use Office mail server, do I have to install postfix to set up a mail server?

I don't know much about Postfix, however, I ran and it seems it is not running.

Code:
systemctl status postfix
Unit postfix.service could not be found.
I also looked at the rpm/yum, to check if the package is installed. Unfortunately, it is not installed.

Code:
rpm -qa|grep postfix
>> No output.

yum whatprovides postfix
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
2:postfix-2.10.1-6.el7.x86_64 : Postfix Mail Transport Agent
Repo        : rhui-rhel-7-server-rhui-rpms


2:postfix-2.10.1-7.el7.x86_64 : Postfix Mail Transport Agent
Repo        : rhui-rhel-7-server-rhui-rpms
My assumption is when we use Public Cloud RHEL 7.6, the subscription is already paid for the duration we have our server up and running? From the output, apparently, that's not the case.
This system is not registered with an entitlement server. You can use subscription-manager to register.

Please assist me Sean. Appreciate your assistance.
 
Old 03-31-2019, 11:36 PM   #8
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
You should be able to configure mailx to use your Office 365 mail server...but I don’t know how to do that.
If you don’t want to use that server, then, yes, you’ll need to install and configure an MTA. Postfix is, I think, the current “best” choice, but I don’t know it either...

You probably need to register the server with Red Hat to be able to use their repositories.

I don’t know if your assumption about the subscription is correct. Try to register. See what happens.

My assumption: If the server is free, the subscription is not included.

The bottom line: What, exactly, are you wanting to accomplish with this (apparently) new server?
 
1 members found this post helpful.
Old 04-01-2019, 12:39 AM   #9
sysmicuser
Member
 
Registered: Mar 2010
Posts: 458

Original Poster
Rep: Reputation: 0
Hi Sean,

I want Jira to send outgoing emails from this server. It is unable to send at the moment, so, I checked if I can at least emails from the server itself. Unfortunately, it was not hence, I am trying to see if the mailx/mail can send emails from the server itself. If that works then the application can also send emails. Else it becomes a complex issue to solve.

Make sense now?

Many thanks!
 
Old 04-01-2019, 06:25 AM   #10
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Maybe you already tried this, but if not, you can specify your O365 mail server SMTP IP address like this:

Code:
echo "Talking from $(hostname -s)"| mail -S smtp=<smtp IP> -s "Test Subject" testme@gmail.com
Another method is to use telnet: https://linuxconfig.org/send-an-email-using-telnet
 
1 members found this post helpful.
Old 04-01-2019, 12:51 PM   #11
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by dc.901 View Post
Maybe you already tried this, but if not, you can specify your O365 mail server SMTP IP address like this:

Code:
echo "Talking from $(hostname -s)"| mail -S smtp=<smtp IP> -s "Test Subject" testme@gmail.com
Another method is to use telnet: https://linuxconfig.org/send-an-email-using-telnet
There you go...and that can probably be configured in the OPs .mailrc and /etc/mailrc right?
 
  


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
LXer: How to setup thin Provisioned Logical Volumes in CentOS 7 / RHEL 7 LXer Syndicated Linux News 0 07-16-2016 10:22 PM
Provisioned space does not match space reported by fdisk (VMware ESXi and CentOS 6.6) asun Linux - General 1 03-08-2015 02:43 PM
LXer: Cloud 5: Cloud competition heats up, Google backs Netflix, Azure gets open licening LXer Syndicated Linux News 0 05-23-2014 10:33 PM
LXer: It's a cloud, cloud, cloud, cloud world LXer Syndicated Linux News 0 07-23-2013 05:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:17 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