Solved

Unix - SMTP relay

Posted on 2013-06-07
4
517 Views
Last Modified: 2013-06-24
I need to write script to look at the Linux Servers in question to see if SMTP relay is on for port 25.

I have a list of servers need to run this script. Can some one please assist.
0
Comment
Question by:ittechlab
4 Comments
 

Author Comment

by:ittechlab
ID: 39228997
where do i check if i have SMTP relay configured in any linux server.

I am using all redhat 4/5/6
0
 
LVL 20

Assisted Solution

by:carlmd
carlmd earned 167 total points
ID: 39229600
Go to www.mxtoolbox.com, enter your domain, and use "mx lookup", then use SMTP Test on the result.

That should tell you everything you need to know.
0
 
LVL 26

Assisted Solution

by:skullnobrains
skullnobrains earned 166 total points
ID: 39231199
this should get you started with

cat <<EOF | nc -w 10 HOST 25 | grep "550.*access.*denied"
mail from: <>
rcpt to: toto@example.com
EOF

this will return true if you end up with a "relay access denied" while sending a mail from the empty user to a remote domain and false in all other cases including the server being down or failure of the script

you can easily stick this in a loop if you have many machines to check

beware that relay access will differ depending on the location of the machine on which you run the script
0
 
LVL 13

Accepted Solution

by:
Sandy earned 167 total points
ID: 39234719
create a for loop which accepts input(servername) listed in separate file and then put below commands and redirect all the stdin and stderr in a file

#netstat -lnp | grep 25
#alternatives --display mta

Cheers
SA
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now