Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 569
  • Last Modified:

Unix - SMTP relay

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
ittechlab
Asked:
ittechlab
3 Solutions
 
ittechlabLinux SupportAuthor Commented:
where do i check if i have SMTP relay configured in any linux server.

I am using all redhat 4/5/6
0
 
carlmdCommented:
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
 
skullnobrainsCommented:
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
 
SandyCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now