ssmtp error : Cannot open <ip_address>:25


 
Thread Tools Search this Thread
Operating Systems Linux ssmtp error : Cannot open <ip_address>:25
# 1  
Old 05-27-2010
ssmtp error : Cannot open <ip_address>:25

Hello,

I am facing a problem with ssmtp mailing agent.
I have installed and configured ssmtp in my RHEL5.3 system. I have written a shell script which sends mail to a couple of email id's. The script uses ssmtp to send mails. When I am running the scipt manually i.e. sh <script_name>.sh then the script is sending mail properly. But if I create a service which will start when the system will boot in RHEL and the service will just run that shell script (which will send email), then I am getting "ssmtp: Cannot open <ip_address>:25" error. The same error I am getting if I create a cronjob to run that script instead of creating a service.

NOTE: I have removed sendmail service from /etc/init.d.

My target is, I want to send email to a set of email id's as soon as the system boots into RHEL i.e. without any manual intervention.

Can anyone please help me out. I have checked a number of forums but did not get any answer which will fix my problem.

Thanks.
# 2  
Old 05-27-2010
Is it possible you're trying to send emails before the network service has been brought up? Does ssmtp work later?
# 3  
Old 05-28-2010
Corona688,

I have scheduled my service as the last service (Service start number 99) so I hope that all the service should have started by the time my service gets called.

Also, ssmtp works later, i.e. if I log into the system and manually run the script.
# 4  
Old 05-28-2010
Just because the network service has started doesn't mean the network's actually ready, perhaps. Could you put a reasonable delay in your script?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Awk: can't open error

Hi , In a directory i've the files in the following format pay:year:mon:11789604 pay:year:mon:17675644 --- and i need to get 4th part of the above file name so i used awk command in the below code #!/bin/ksh for test_data in pay* do txt_awk = awk -F':' '{print $4;}' $test_data ... (7 Replies)
Discussion started by: smile689
7 Replies

2. Red Hat

Problem setting up SSMTP with Office 365

Hi guys! Im trying to setup my box so it can send its emails through Office 365 SMTP. I spent 8 hours yesterday trying to configure sendmail to do this, but I gave up. Now Im trying to do it with SSMTP and I followed this guide to configure it How to install and configure sSMTP on CentOS /... (0 Replies)
Discussion started by: RedSpyder
0 Replies

3. Shell Programming and Scripting

[Fixed Itself!] Sending mail form script using sSMTP does not work

I have installed sSMTP and set it up to use my gmail. Sending from cli does work fine: msg file:From: test@gmail.com To test2@gmail.com Subject: test post This is a test Executing from console:ssmtp -t < msg does work fine. But from script it does not work:#!/bin/sh ssmtp -t < msg... (0 Replies)
Discussion started by: Jotne
0 Replies

4. Ubuntu

ssmtp

I installed sSMTP in ubuntu 12.04 This works goed but I have two problems and I don't find a answer with google. I don't find how to stop sSMTP so this server only works when I want. sudo etc//init.d/ssmtp stop doesn't work because ssmtp isn't in init.d When I start truecrypt than I always... (3 Replies)
Discussion started by: thailand
3 Replies

5. Shell Programming and Scripting

Configuring ssmtp

Hi, I have trouble in configuring ssmtp for sending mail to gmail. I have configured the following way, plz suggest/correct me if i have done something wrong root=nagiostool@gmail.com mailhub=smtp.gmail.com:587 #RewriteDomain= # The full hostname Hostname=nagiosxi # Set this to... (1 Reply)
Discussion started by: nagios
1 Replies

6. Shell Programming and Scripting

grep can't open error

Hi, Thanks for all your help. This forum is excellent. I just learnt PERL over the last few weeks by coding and asking questions.... I have one more. When I run my script I get the following error msg. The grep statement I have is `grep "Number of jobs processed:" output | sort -u |... (10 Replies)
Discussion started by: nurani
10 Replies

7. Red Hat

Error: Can't open display: :0.0

Hi, I get errors while running xclock from a non root user: # xclock --- this works fine # su - girish $ DISPLAY=:0.0; export DISPLAY $ xclock Xlib: connection to ":0.0" refused by server Xlib: No protocol specified Error: Can't open display: :0.0 $ I basically want to... (4 Replies)
Discussion started by: girish1428
4 Replies

8. UNIX for Advanced & Expert Users

getting error when open vi editor

helo I install my product for koren language I m uisng RHEL -4 operating system now problem is whenever I open any file vi filename I got following error on the screen E557: Cannot open termcap file 'vt100' not known. Available builtin terminals are: builtin_ansi ... (1 Reply)
Discussion started by: amitpansuria
1 Replies

9. UNIX for Dummies Questions & Answers

cannot open error

Hi, Iam facing following error.please see the below script and error.Iam unable to attach error message to mail and its not sending mail also. vi Expedites_test.ksh "Expedites_test.ksh" 49 lines, 2276 characters #!/bin/ksh... (4 Replies)
Discussion started by: venu_cisco
4 Replies
Login or Register to Ask a Question