cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
995
Views
0
Helpful
2
Replies

IOS-XR EEM smtp issue

stijn.peeters
Level 1
Level 1

Hi,

i'm quite new to cisco's EEM TCL; basic cli stuff works fine for me in our ASR9K (version 4.3.4)

However i can't get the smtp to work.
I've created a very simple script for testing e-mail: (used a wan interface to avoid any VRF issues, the mailserver allows port 25 and any ip from our router without aditional credentials).

::cisco::eem::event_register_none

namespace import ::cisco::eem::*
namespace import ::cisco::lib::*

set mail_pre "Mailservername: 193.xxx.xxx.xxx\n"
append mail_pre "From: asr@ourdomain.nl\n"
append mail_pre "To: me@ourdomain.nl\n"
append mail_pre "Cc: \n"
append mail_pre "Subject: Ciscotest\n\n"
append mail_pre "Test succesful\n\n"
set mail_msg [uplevel #0 [list subst -nobackslashes -nocommands $mail_pre]]
if [catch {smtp_send_email $mail_msg} result] {
error $result $errorInfo
}

On execute the ASR9K seems to contact the mailserver (hostname is reported back in the error)


RP/0/RSP0/CPU0:asr9k01#event manager run mailtest.tcl

error connecting to mail server:
can't read "reply_code_str(220-mail.ourdomain.nl)": no such element in array
while executing
"smtp_send_email $mail_msg"
invoked from within
"if [catch {smtp_send_email $mail_msg} result] {
error $result $errorInfo
}"
(file "/dev/rdsfs/etc/eem_rdsfs/mailtest.tcl" line 13)

Anyone that can help me on my smtp-way?

2 Replies 2

Joe Clarke
Cisco Employee
Cisco Employee

Your mail server is returning non-standard reply lines.  Typically, the reply code is separated from the additional text with a space.  The EEM SMTP code assumes this.  Here is an example from my server:

220 host.domain.com ESMTP Sendmail 8.15.2/8.15.2; Thu, 6 Oct 2016 13:44:11 -0400 (EDT)

Is there another SMTP server you can use?

Hi Joe,

This is ICEWarp SMTP server.

I'll give it a go on a MS-SMTP service and report back.

grtz