Fix the RFC 822-related bug in Cisco IOS

From CT3

Jump to: navigation, search

Embedded Event Manager (EEM) in IOS releases up to 12.4(15)T2 and 12.2(33)SRC does not insert an empty line required by RFC 822 (and subsequent SMTP-related RFCs) between the message header and the message body in e-mails sent with the action mail EEM applet command (bug details; available to registered CCO users). This bug might manifest itself if you send e-mails from the router to an SMTP MTA that stricter in checking RFC compliance as the Unix sendmail program and its derivatives. E-mail user agent receiving the ill-formed e-mail message might display the e-mail body in the subject line.

To fix this problem, you can manually insert CRLF combination in the e-mail body generated with the action mail command with the \015\012 escape sequence. For example, to send an e-mail every time an interface changes its status, use the following EEM applet:

Please check the Send e-mail from EEM applet page for additional detailed explanations of various EEM environment variables and action mail command parameters.
event manager applet InterfaceUpDown
 event syslog occurs 1 pattern "UPDOWN" period 1
 action 1.0 info type routername
 action 2.0 mail server "$_mail_smtp" to "$_mail_rcpt" →
    from "$_info_routername@$_mail_domain" subject "Interface state change" →
    body "\015\012$_syslog_msg"
The non-printable characters entered in the EEM action mail command with the escape sequence are not escaped when displayed in the router configuration, resulting in a configuration that is hard to read/copy.
The workaround has been provided by Gerald Kowalsky
Personal tools

CT3

Main menu