dsirrine_23403
Feb 24, 2011Nimbostratus
Custom Monitor EAV with Send/Expect script
I am having an issue with my custom monitor where I am attempting to send an e-mail via telnet on port 25 using the send/expect scripted monitor. What I have so far is the following:
send telnet =IP= 25\r\n
expect 220
send HELO =IP=\r\n
expect 250
send MAIL FROM: =email=\r\n
expect 250
send RCPT TO: =email=\r\n
expect 250
send DATA\r\n
expect 354
send SUBJECT:This is a test\r\n
send \r\n
send Test\r\n
send .\r\n
expect 250
send quit\r\n
When it sends the telnet *ip* 25, it recieves the 220 ok, however, it then doesn't ignore the rest of the header lines. Is there a method to use regex or a pause statement that I can use to solve this issue in this expect script? Thank you in advance.