Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to know if server has access to internet and if it can send email with the help of a python script. Server OS is Red Hat Enterprise 5. When I open firefox and enter an url, it can't connect. What shell commands should I use to check availability of sending email?

share|improve this question
    
You mean you think you're on a connection with HTTP firewalled but SMTP permitted? –  Mechanical snail Jun 29 '12 at 23:46
    
Yes, exactly. How to tell? –  alwbtc Jun 30 '12 at 18:12
    
See below. If you can communicate via telnet on port 25 you can connect via SMTP - if you can't, you can't. –  lonstar Jul 3 '12 at 19:27
add comment

2 Answers

You can also try mailx on your system but this won't tell you anything about sending mail. You will need an SMTP host for that.

Try to telnet to a known mailhost on port 25:

telnet (name of mail host) 25

if you get a connection you should be in business, otherwise the request will block and make you wait.

share|improve this answer
    
I get this error: Escape character is '^]'. 421 4.3.2 Service not available Connection closed by foreign host. What is wrong? –  alwbtc Jul 20 '12 at 11:32
    
Your question was " What shell commands should I use to check availability of sending email?" - the telnet command connected to the foreign host, but the host rejected the connection. This is common to prevent spamming. However, it does answer your questions 1) your server does have access to the internet, and 2) it is able to communicate on port 25. –  lonstar Jul 21 '12 at 2:06
add comment

First make sure that you are connected to the internet by trying a ping command to one of the most popular site.

Example: ping www.google.com

This will make sure you have the internet connectivity.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.