How do I configure Linux server to be able to send emails internally?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How do I configure Linux server to be able to send emails internally?
# 1  
Old 01-05-2010
How do I configure Linux server to be able to send emails internally?

Hi

The script:

Code:
 
#!/bin/sh
#set -x
# set admin email so that you can get email
ADMIN="myemailaddress"
# set alert level
ALERT=4
df -HP | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
do
  #echo $output
  usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1  )
  partition=$(echo $output | awk '{ print $2 }' )
  if [ $usep -ge $ALERT ]; then
    echo "Running out of space \"$partition $usep% used\" on $(hostname) as on $(date)" |
     mail -s "Alert:$(hostname) almost out of disk space $usep% used" $ADMIN
  fi
done

It works fine, but the emails are not being delivered. On other Linux servers with the emails configured, I get the alerts. How do I see how the oher servers are set up, or how would I set up this server to be able to send emails internally? We have a Linux smart relay and Exchange server in our Environment.

Thanks!!
# 2  
Old 01-05-2010
I could be off, but don't you need to end the mail command with a period?

example:
Code:
some command | mail -s "subject" user@email.com

some text here

.

done

I haven't used the mail command in a long time, so this is going off of memory.
# 3  
Old 01-05-2010
Nope, does not work. This script works on all 15 other Linux servers and I do get the emails.
# 4  
Old 01-05-2010
Quote:
Originally Posted by wbdevilliers
Nope, does not work. This script works on all 15 other Linux servers and I do get the emails.
Well are there any differences between the machines that work versus the ones that do not work?
# 5  
Old 01-05-2010
Just the OS versions would be different and then obviously a config that probably needs to be done on this one. They are all on the same subnet and this one can also see the mail servers on our network.

All I need to know is how to configure this server to be able to send emails to our Exchange or Relay server. From there it will be sent to my inbox.
# 6  
Old 01-05-2010
Well with out knowing all the differences of your set up I would just have to guess it has to do with configuration or version differences. I am just shooting in the dark. I guess you should compare the differences is what I suggest. Sorry I could not be of more help.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Configure AIX server to send logs and auditing to Qradar

Hi All I need your help to configure Aix to send logs to Qradar, I did all the methods that mentioned in IBM website and no use, Plz Help,, The Logs should I receive from Aix and display in Qradar is (create user delete user changing in privileges....etc ) my skype account khaled_ly84 ... (4 Replies)
Discussion started by: khaled_ly84
4 Replies

2. Shell Programming and Scripting

Sendmail Fails to send emails from Linux server.

I m using free zoho mail client application (similar to microsoft outlook) on my mobile for all my emails to mohtashim@techx.com I wish to only recieve emails from my Linux Server details of which are: techx 3.10.0-514.10.2.el7.x86_64 #1 SMP CentOS release 7.3.1611 (Core). I try the below... (20 Replies)
Discussion started by: mohtashims
20 Replies

3. Shell Programming and Scripting

How to configure mutt to send emails on Linux.?

Hello, I am trying to use mutt in order to send emails. I have installed mutt using yum and pasted some details about it later in the post. When I try to run: echo test | mutt -s "Test Email" user@id.com It doesn't do anything. I dont receive any emails. I have the SMTP details for... (1 Reply)
Discussion started by: vaibhavraj
1 Replies

4. Linux

How to connect Linux server (configure two way authentication) with Windows server?

Hi my name is Manju. ->I have configure the two way authentication on my linux server. ->Now I am able to apply two way authenticator on particuler user. ->Now I want to map this linux server to my AD server. ->Kindly tell me how to map AD(Active Directory) with this linux server. ... (0 Replies)
Discussion started by: manjusharma128
0 Replies

5. Homework & Coursework Questions

Configure the AD Window server with Linux server(google Authenticator is installed)

Hi my name is Manju. ->I have configure the two way authentication on my linux server. ->Now I am able to apply two way authenticator on particuler user. ->Now I want to map this linux server to my AD server. ->Kindly tell me how to map AD(Active Directory) with this linux server. ... (2 Replies)
Discussion started by: manjusharma128
2 Replies

6. UNIX for Dummies Questions & Answers

Emails sent from Linux server are rejected by recipient

Hello i have this longterm issue which im unable to solve, i think this is quite simple issue, i hope you may know the cause It is on CentOS Redhat server with qmail installed. # service qmail status # service qmail start Starting Qmail: # ps aux | grep mail qmails 1688 0.0 0.0 ... (1 Reply)
Discussion started by: postcd
1 Replies

7. Linux

Configure ntp server and Linux in oel 5.9

i want to configure machine1 as ntp server. this machine has oel 5.9 64 bit installed and this machine is not connected to internet neither there is any ntp server. there is another machine2 and i want to configure that as ntp client. plz do tell me that what lines do i add in /etc/ntp.conf... (0 Replies)
Discussion started by: rehantayyab82
0 Replies

8. UNIX for Dummies Questions & Answers

Can't configure sendmail to send mails to external SMTP Server

Hi all,I know, that this is very common issue, but I can't find where is the problem... I have Solaris 10 installed.I want to send mail to external SMTP server, like:echo "letter body"| mailx -s "subject" test@test.comBut I donno what kind of changes I have to do in /etc/hosts and sendmail.cf or... (5 Replies)
Discussion started by: nypreH
5 Replies

9. Solaris

Server unable to send mail-how to configure

Hi All, I'm unable to send out email using mailx command in a new server. I guess the server has to be configured for this. I searched a lot and everywhere it was asked to check /etc/sendmail.cf (I don't have this file in that path.) And I don't have a folder called host or hosts in /etc... (6 Replies)
Discussion started by: Qwerty123
6 Replies

10. AIX

how to configure server to send email in AIX

Hi, anyone can guide me how to configure server to send email in AIX. My server is in a closed network, what do I need to configure and how? SMTP gateway? mail server? Thanks and best regards Solomon (4 Replies)
Discussion started by: chongkls77
4 Replies
Login or Register to Ask a Question