What's new

amtm AddOns E-mail configuration and usage poll

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

How Have you setup email notifications?


  • Total voters
    11
  • Poll closed .

Weblee2407

Regular Contributor
After setting up all my services and scripts, I see I have about 10 scripts that email me about status changes or events. I now see I have a bit of script sprawl and need to make changes in a lot of places if something gets updated. Before I refactor all my scripting
I would like to know how everyone else is handling their usage of mail notices.
 
What do you mean with "something gets updated"?
The format and variables in amtm email settings never change.
 
Yeah, I updated the email.conf to include a cc and a text to address in an attempt to keep that data centralized after attempting to change the TO info on the fly in certain scripts...but the curl statement that actually sends the email is repeated in each script. So - is it better to have that statement in each file, or should I centralize those lines of code into a script which is called by all the scripts?
 
Can yon post your (redacted) conf file?
 
I think if you go back into the original vnstat threads, you will see @dev_null working through this. My memory on this is hazy, but I think he experimented with using a single email script wrapper that was used for a number of purposes, and then moved to using the scripts own sending function but using the amtm conf file for the actual credentials. Having your own common script for sending can be useful.
 
# Email settings (mail envelope) #
FROM_ADDRESS="My.net@email.com"
TO_NAME="Strike Monitor"
TO_ADDRESS="rein.04.strike@icloud.com"
CC_NAME="Kenny James"
CC_ADDRESS="Kenny@earthlink.net"
TX_NAME="Jimmy James"
TX_ADDRESS="9597394965@mypixmessages.com"

FRIENDLY_ROUTER_NAME="IronGate"

# Email credentials #
USERNAME="james@email.com"
# Encrypted Password is stored in emailpw.enc file.

# Server settings #
SMTP="smtpauth.email.com"
PORT="587"
PROTOCOL="smtp"
SSL_FLAG="--insecure"
emailPwEnc=-pbkdf2
 
I think if you go back into the original vnstat threads, you will see @dev_null working through this. My memory on this is hazy, but I think he experimented with using a single email script wrapper that was used for a number of purposes, and then moved to using the scripts own sending function but using the amtm conf file for the actual credentials. Having your own common script for sending can be useful.
Hoo, wayback machine for sure. That was before @thelonelycoder built the email capability into AMTM. At the time I was doing that, dn-vnstat was one of the few scripts that by design was emailing on a recurring basis, and there were a couple of other scripts that I wanted to "push" email summaries to me.

I actually still use the stub of that work to email me weekly summaries from skynet and immediate new OVPN connections, but other scripts leverage AMTM now. The original dn-vnstat script and it's usage is located here: https://github.com/de-vnull/vnstat-on-merlin - scroll down to the section that describes "If you want to run vnstat without the UI, are not running Diversion, and still wish to email daily usage" (about 4/5 the way down the page).

WICENS does have a "cc" function (which I don't use and can't speak to) so maybe @Maverickcdn can weigh in on the cc'ing situation.
 
# Email settings (mail envelope) #
FROM_ADDRESS="My.net@email.com"
TO_NAME="Strike Monitor"
TO_ADDRESS="rein.04.strike@icloud.com"
CC_NAME="Kenny James"
CC_ADDRESS="Kenny@earthlink.net"
TX_NAME="Jimmy James"
TX_ADDRESS="9597394965@mypixmessages.com"

FRIENDLY_ROUTER_NAME="IronGate"

# Email credentials #
USERNAME="james@email.com"
# Encrypted Password is stored in emailpw.enc file.

# Server settings #
SMTP="smtpauth.email.com"
PORT="587"
PROTOCOL="smtp"
SSL_FLAG="--insecure"
emailPwEnc=-pbkdf2
Why don‘t you put the extra variables in a separate file and source it in your script?
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top