cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Community Helping Community

90
Views
0
Helpful
2
Replies
Highlighted
Beginner

IOS-XR EEM smtp issue

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?

Everyone's tags (1)
2 REPLIES 2
Hall of Fame Cisco Employee

Your mail server is returning

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?

Beginner

Hi Joe,

Hi Joe,

This is ICEWarp SMTP server.

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

grtz

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards