Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Unix - SMTP relay

Posted on 2013-06-07
4
Medium Priority
?
556 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 501 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 27

Assisted Solution

by:skullnobrains
skullnobrains earned 498 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 501 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Utilizing an array to gracefully append to a list of EmailAddresses
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

670 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