What's new

amtm I want to leverage the email function within amtm

Ripshod

Part of the Furniture
I'm adapting a little script to notify me when a file changes (comparing md5 checksums) but it was originally written to use sendmail (built into asuswrt/busybox). Needless to say it fails. What I'd like to do is use the email functionality in amtm to handle emails, but I just don't know where to start (my sending email is already set up and working in amtm).
Any pointers?
 
I'm adapting a little script to notify me when a file changes (comparing md5 checksums) but it was originally written to use sendmail (built into asuswrt/busybox). Needless to say it fails. What I'd like to do is use the email functionality in amtm to handle emails, but I just don't know where to start (my sending email is already set up and working in amtm).
Any pointers?
Look at the code of other 3rd-party scripts such as MerlinAU or BACKUPMON that have incorporated this functionality.
 
I'm adapting a little script to notify me when a file changes (comparing md5 checksums) but it was originally written to use sendmail (built into asuswrt/busybox). Needless to say it fails. What I'd like to do is use the email functionality in amtm to handle emails, but I just don't know where to start (my sending email is already set up and working in amtm).
Any pointers?
Like to see a clear answer on this myself. In the meantime here is a snippet of what I came up with that works.

Code:
[email protected]

      NEW_ADDR=`cat /opt/ipchange/last_ip`
        {
         echo From: rt-be88u.dbonenet.com
         echo To: [email protected]
         echo Subject: External IP Address Change
         echo
         echo -n New IP ADDRESS:
         echo ' [ '$NEW_ADDR' ] '
        } | /usr/sbin/sendmail  -H 'exec openssl s_client -quiet -verify_quiet -tls1_3 -CAfile /opt/etc/ssl/cert.pem -connect mail.dbonenet.com:465' $M_ADDR 2>/dev/null
 
Look at the code of other 3rd-party scripts such as MerlinAU or BACKUPMON that have incorporated this functionality.

MerlinAU actually has all the email code integrated directly into the add-on, which may be a bit trickier to digest, but removes any dependencies on external code for MerlinAU.
However @Viktor Jaep 's BACKUPMON uses the Shared Email Library from @Martinski , which is what I would recommend as a starting point and is the simplest implementation.

The library is specifically designed to be a detached "all-in-one" solution other scripts/add-ons can call on to leverage email functionality:
 
Last edited:

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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