Showing results for 
Search instead for 
Did you mean: 

eem on cisco 877, trouble with mail server action and smtp auth


hello all,

i'm using a router 877 at home and i really need to check out what this router do during the day.

So some time ago i configured it using some eem actions and sending to me email, without any problems.

Yesterday I changed my internet provider and now i need to use smtp autheticantion to send emails.

I read about how to authenticate, like username:password@host and also made a fast search here, without solve my problem.

I need to put as username the email of the provider like:

So, i want to know if someone had the same problem and solved it. Of course i couldn't use @ two times or eem would think that is my smtp server! And right now is going in this way!

My IOS version is 15.1(2)T2, eem version is 3.1.

Hope someone could help me!

Thank you in advance.


1 Accepted Solution

Accepted Solutions

Joe Clarke
Hall of Fame Cisco Employee Hall of Fame Cisco Employee
Hall of Fame Cisco Employee

Here you go.

::cisco::eem::event_register_syslog occurs 1 pattern ".*LINEPROTO-5-UPDOWN.*FastEthernet3.*"

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

set mail_pre "Mailservername: myusername@providerDomain:mypassword@providerSMTP\n"
append mail_pre "From: myusername@providerdomain\n"
append mail_pre "To: myusername2@providerDomain2\n"
append mail_pre
append mail_pre "Subject: Check VOIP ATA\n\n"
append mail_pre "Please check VOIP ATA, something not working properly\n\n"
set mail_msg [uplevel #0 [list subst -nobackslashes -nocommands $mail_pre]]
if [catch {smtp_send_email $mail_msg} result] {
    error $result $errorInfo

Save this to a file that ends with ".tcl" (e.g. interface-down-fritz.tcl), then copy it to your EEM policy directory on your router (i.e. the one specified in "event manager directory user policy").  Then register the policy with the command "event manager policy interface-down-fritz.tcl".

View solution in original post

34 Replies 34

Joe Clarke
Hall of Fame Cisco Employee Hall of Fame Cisco Employee
Hall of Fame Cisco Employee

This is a known limitationwith SMTP AUTH and EEM.  An enhancement request, CSCsv24106, was filed to allow for escaping the '@' in a username.  However, I've looked over the code in 15.1(2)T, and it appears that the username with the '@' will be properly understood, provided you're using Tcl.  If you use applets, then it will not work.  If you post your applet, I can convert it to a Tcl policy for you.

Thank you Joseph for your reply.

Here it's a sample, i have other that look like this.

If you can give back an example i will learn tcl also

Thank you in advance!


event manager applet interface-down-fritz
event syslog occurs 1 pattern ".*LINEPROTO-5-UPDOWN.*FastEthernet3.*"
action 1.0 mail server "myusername@providerDomain:mypassword@providerSMTP" to "myusername2@providerDomain2" from "myusername@providerdomain" subject "Check VOIP ATA" body "Please check VOIP ATA, something not working properly"