• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Seeing as I'm feeling generous TLS SMTP test script

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Seeing as I'm feeling generous TLS SMTP test script

    CheckTLS is handy but a PIA for lots of lookups.

    So here's a Unix script that does it for you.
    CAVEAT: I'm not a programmer so it's ugly.

    #!/bin/sh
    >master-report
    for domain in `cat domains`
    do dig mx $domain +short | awk '!($1="")'| sed 's/.$//' > reportfiles/$domain.MX.report
    for mx in `cat reportfiles/$domain.MX.report`
    do echo Q | openssl s_client -connect $mx:25 -starttls smtp > reportfiles/$domain.SMTP.report 2>&1
    if [ $? -eq 0 ];
    then echo " PASSED " >> reportfiles/$domain.SMTP.report
    echo $domain $mx "PASSED" >> master-report
    else echo " FAILED" >> reportfiles/$domain.SMTP.report
    echo $domain $mx "FAILED" >> master-report
    fi
    done
    done



    you're welcome.
    See You Next Tuesday

    #2
    Originally posted by Lance View Post
    CheckTLS is handy but a PIA for lots of lookups.

    So here's a Unix script that does it for you.
    CAVEAT: I'm not a programmer so it's ugly.

    #!/bin/sh
    >master-report
    for domain in `cat domains`
    do dig mx $domain +short | awk '!($1="")'| sed 's/.$//' > reportfiles/$domain.MX.report
    for mx in `cat reportfiles/$domain.MX.report`
    do echo Q | openssl s_client -connect $mx:25 -starttls smtp > reportfiles/$domain.SMTP.report 2>&1
    if [ $? -eq 0 ];
    then echo " PASSED " >> reportfiles/$domain.SMTP.report
    echo $domain $mx "PASSED" >> master-report
    else echo " FAILED" >> reportfiles/$domain.SMTP.report
    echo $domain $mx "FAILED" >> master-report
    fi
    done
    done



    you're welcome.
    github.com/yoursharedcodebelongshere

    FTFY

    Comment


      #3
      Originally posted by SeanT View Post
      github.com/yoursharedcodebelongshere

      FTFY
      it's 'built for developers'. I ain't a developer.
      See You Next Tuesday

      Comment


        #4
        Originally posted by Lance View Post
        it's 'built for developers'. I ain't a developer.
        I don’t want a random shell script - I’m more of a perl man myself
        merely at clientco for the entertainment

        Comment


          #5
          Originally posted by eek View Post
          I don’t want a random shell script - I’m more of a perl man myself
          I vowed in 1991 I'd never learn another language (had done BASIC, pascal, fortran, c, c++, 6502, z80A, 6510, 6800 & 68000 - that was really enough to know it's just ******* stupid languages with the same outcome). I had to learn Bourne Shell for a pay rise in 1998. Hence my most recent language is /bin/sh
          Last edited by Lance; 28 November 2017, 20:09. Reason: added c
          See You Next Tuesday

          Comment


            #6
            Originally posted by Lance View Post
            I vowed in 1991 I'd never learn another language (had done BASIC, pascal, fortran, c, c++, 6502, z80A, 6510, 6800 & 68000 - that was really enough to know it's just ******* stupid languages with the same outcome). I had to learn Bourne Shell for a pay rise in 1998. Hence my most recent language is /bin/sh
            I've always stuck with BAL < now HLA> and REXX, myself

            Comment


              #7
              Originally posted by BR14 View Post
              I've always stuck with BAL < now HLA> and REXX, myself
              Nope. No idea what that means.
              See You Next Tuesday

              Comment


                #8
                Originally posted by Lance View Post
                Nope. No idea what that means.
                it's dinosaur code, mate, don't worry about it

                Comment


                  #9
                  Originally posted by Lance View Post

                  I vowed in 1991 I'd never learn another language (had done BASIC, pascal, fortran, c, c++, 6502, z80A, 6510, 6800 & 68000 - that was really enough to know it's just ******* stupid languages with the same outcome). I had to learn Bourne Shell for a pay rise in 1998. Hence my most recent language is /bin/sh
                  Damnit....
                  I've gone and learned Powershell now..... Bloody Microsoft not releasing the O365 cmdlets for Unix or Mac.
                  See You Next Tuesday

                  Comment

                  Working...
                  X