Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Understanding Junos Snapshot Administrator in Python Mail Files

The Junos Snapshot Administrator in Python (jsnapy) mail files are YAML-formatted files that define the details needed for jsnapy to send e-mail regarding the results of completed snapshots and comparison tests.

General Information

You can name mail files whatever you want except that the name cannot contain spaces or special characters. The mail file should be stored in the same directory as the jsnapy configuration file to which it is linked. When a mail file is referenced from a configuration file, e-mail will be sent every time jsnapy is run with that configuration using either the --check or --snapcheck options, regardless of success or failure of the tests that are run on the Junos OS host. If jsnapy is run with the --check option, then no mail is sent.

After installation and initialization, there is a sample mail file named send_mail.yml in the /etc/jsnapy/samples directory. This file shows the available fields and some sample values.

This sample mail file will not work for sending mail without modification.

Jsnapy uses sendmail on the jsnapy server to send SMTP e-mail to the Gmail server smtp.gmail.com by default.

Understanding the Structure of a Mail File

The jsnapy mail file has several required parameter-value pairs and two optional ones. All parameter-value pairs are separated by a colon (:). Table 1 describes both the required and optional parameters for jsnapy mail file configuration.

Table 1: Key-Value Pairs in jsnapy Mail Files

Parameter

Description

to

This value is the e-mail address to which you want the e-mail messages sent.

from

This value is an e-mail address that is used as the from field of the outgoing e-mail. It is also used as the username for login to the SMTP server specified by the server parameter.

Note:

If no value is given for the server parameter, then this value should be a valid e-mail address @gmail.com.

sub

This value is used as the subject line in the outgoing e-mail.

recipient_name

This value is used as the salutation in the body of the e-mail.

passwd

This value is the password associated with the e-mail account value in the from parameter.

server

This optional value is the IP address or DNS name of an SMTP server that jsnapy will use for sending e-mail. If no value is given, jsnapy will use smtp.gmail.com for sending e-mail.

port

This optional value tells jsnapy to send e-mail on a TCP port other than port 587 (SMTP).

sender_name

This value is the name used as the signature line in the body of the e-mail.