sendpy
π§ Send e-mail (and text messages) from the command line
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
βCITATION.cff file
Found CITATION.cff file -
βcodemeta.json file
Found codemeta.json file -
β.zenodo.json file
Found .zenodo.json file -
βDOI references
-
βAcademic publication links
-
βCommitters with academic emails
1 of 2 committers (50.0%) from academic institutions -
βInstitutional organization owner
-
βJOSS paper metadata
-
βScientific vocabulary similarity
Low similarity (13.3%) to scientific vocabulary
Repository
π§ Send e-mail (and text messages) from the command line
Basic Info
Statistics
- Stars: 9
- Watchers: 2
- Forks: 5
- Open Issues: 1
- Releases: 0
Metadata Files
README.md
Send Msg CLI
Send e-mail (and text messages) from the command line
Copyright Β© 2019 Teal Dulcet (both) and Daniel Connelly (Python)
Send e-mail (and text messages), with optional message and attachments, from the command line. Supports Unicode characters in the display names, subject, message and attachment filenames (MIME). Wrapper around cURL and the mail command to easily send e-mails from the command line. Optionally use your own e-mail address and an external SMTP server.
Useful to know when a cron job failed, when a long running job (LRP) has finished, to quickly backup/share a file or to send notifications as part of a larger script.
See the python directory for SendPy, a Python port of the script.
β€οΈ Please visit tealdulcet.com to support these scripts and my other software development.
Usage
Supports Unix, including both Linux and macOS. Requires at least Bash 4.4 and cURL, which are included on most Linux distributions.
Optional S/MIME digital signatures require OpenSSL.\
Optional PGP/MIME digital signatures require GNU Privacy Guard (GPG).\
Optional attachment compression requires the zip command.
Run: ./sendmsg.sh <OPTION(S)>... -s <subject>\
One or more To, CC or BCC e-mail addresses are required. Send text messages by using the mobile providers e-mail to SMS or MMS gateway. All the options can also be set by opening the script in an editor and setting the variables at the top. See Help below for full usage information.
- Verify that the required commands above are installed.
- Download the script (sendmsg.sh). Run:
wget https://raw.github.com/tdulcet/Send-Msg-CLI/master/sendmsg.sh. - At a minimum, you need to provide one To e-mail address. If the computer is on a residential network or if it does not have an SMTP server setup then you will also need to provide an external SMTP server. For security, any passwords/passphrases should be set in the script, instead of on the command line.
- Execute the script once to make sure there are no errors. For example, run:
chmod u+x sendmsg.shand./sendmsg.sh -s "Test" -m "This is a test!" -t "Example <example@example.com>" -d. - If you want the script to be available for all users, install it. Run:
sudo cp sendmsg.sh /usr/local/bin/sendmsgandsudo chmod +x /usr/local/bin/sendmsg.
Examples
See Help below for more examples.
Send a notification when a long running job (LRP) has finished, with the exit code and output:
bash
output=$(myLRP arg1 arg2β¦ 2>&1); ./sendmsg.sh -s "βmyLRP arg1 arg2β¦β has finished"'!' -m "The program βmyLRP arg1 arg2β¦β has finished on β$HOSTNAMEβ"'!'"\nExit code: $?\nOutput:\n$output\n"
Replace myLRP arg1 arg2β¦ with the actual program and arguments.
Backup/Share a file:
bash
./sendmsg.sh -s "Log file" -m "Please see the attached log file." -a status.log
Send notifications as part of a larger script:
bash
./sendmsg.sh -s "β¬οΈ Example Website is DOWN"'!' -m "Example Website (https://www.example.com/) is currently DOWN"'!'"\n\nThis script will alert you when it is back up.\n"
Example adapted from the Linux Remote Servers Status Monitoring Script.
Gmail
Instructions
To send e-mail from a Gmail account, add these options to the command: `-f "UserFeature comparison
| This Send E-mail Script | S-nail (formerly Heirloom mailx) | Mutt | SSMTP | SendEmail | smtp-cli | |||
|---|---|---|---|---|---|---|---|---|
| Send e-mail | β | β | β | β | β | β | β | |
| Send text messages (e-mail to SMS) | β | β | β | β | β | β | β | |
| Use your own e-mail address | β* | β* | β* | β | β | β | β | |
| Use an external SMTP server | β* | β* | β* | β | β* | β* | β* | |
| Include attachment(s) | β | β | β | β | β | β | ||
| Send e-mails to CC and BCC addresses | β | β | β | β | β | |||
| Supports e-mail addresses with display names | β | β | β | β | β | |||
| Supports HTML formatted messages | β | β | ||||||
| Supports Unicode characters in subject and message (MIME) | β | β | β | β | β | Message only | ||
| Supports International email addresses | ββ | β | β | |||||
| Supports E-mail Priority | β | High Priority only | ||||||
| Digitally sign e-mails | S/MIME certificate | β | β | β | ||||
| PGP/MIME | β | β | β | |||||
| Does NOT require compiling or installing anything | β | |||||||
| 100% Open Source | β | β | β | β | β | β | β | |
| Free | π | π | π | π | π | π | π | |
* Optional\ β Only supported in Internationalizing Domain Names in Applications (IDNA) encoding
This is not a comprehensive list of the Send E-mail Scriptβs functionality.
Source: S-nail, Mutt, SSMTP, SendEmail (archived, source), eMail and smtp-cli
Help
``` $ sendmsg -h Usage: sendmsg
Options:
-s
-S <SMTP server>SMTP server
Supported protocols: "smtp" and "smtps". Requires From e-mail address. Use "smtp://localhost" if running a mail server on this device.
-u <username> SMTP server username
-p <password> SMTP server password
-P <priority> Priority
Supported priorities: "5 (Lowest)", "4 (Low)", "Normal", "2 (High)" and "1 (Highest)". Requires SMTP server.
-r Request Return Receipt
Requires SMTP server.
-C <certificate>S/MIME Certificate filename for digitally signing the e-mails
It will ask you for the password the first time you run the script with this option. Requires SMTP server.
-k <passphrase> PGP secret key passphrase for digitally signing the e-mails with PGP/MIME
Requires SMTP server.
-z <zipfile> Compress attachment(s) with zip
-l Set Content-Language
Uses value of LANG environment variable.
-U Sanitize the Date
Uses Coordinated Universal Time (UTC) and rounds date down to whole minute. Set the TZ environment variable to change time zone.
-T <seconds> Time to delay sending of the e-mail
-d Dry run, do not send the e-mail
-V Verbose, show the client-server communication
Requires SMTP server.
-h Display this help and exit
-v Output version information and exit
Examples: Send e-mail $ sendmsg -s "Example" -t "User user@example.com"
Send e-mail with message
$ sendmsg -s "Example" -m "This is an example!" -t "User <user@example.com>"
Send e-mail with message and single attachment
$ sendmsg -s "Example" -m "This is an example!" -a example.txt -t "User <user@example.com>"
Send e-mail with message and multiple attachments
$ sendmsg -s "Example" -m "This is an example!" -a example1.txt -a example2.txt -t "User <user@example.com>"
Send e-mail to a CC address
$ sendmsg -s "Example" -t "User 1 <user1@example.com>" -c "User 2 <user2@example.com>"
Send e-mail with a From address
$ sendmsg -s "Example" -f "Example <example@example.com>" -t "User <user@example.com>"
Send e-mail with an external SMTP server
$ sendmsg -s "Example" -f "Example <example@example.com>" -S "smtps://mail.example.com" -u "example" -p "password" -t "User <user@example.com>"
Send high priority e-mail
$ sendmsg -s "Example" -f "Example <example@example.com>" -S "smtps://mail.example.com" -u "example" -p "password" -P "1 (Highest)" -t "User <user@example.com>"
Send e-mail digitally signed with an S/MIME Certificate
$ sendmsg -s "Example" -f "Example <example@example.com>" -S "smtps://mail.example.com" -u "example" -p "password" -C "cert.p12" -t "User <user@example.com>"
Send e-mail digitally signed with PGP/MIME
$ sendmsg -s "Example" -f "Example <example@example.com>" -S "smtps://mail.example.com" -u "example" -p "password" -k "passphrase" -t "User <user@example.com>"
```
Scripts where this is incorporated
Contributing
Pull requests welcome! Ideas for contributions:
Bash: * Send e-mails with very long subjects or many e-mail addresses * Support International email addresses * Currently they are only supported in Internationalizing Domain Names in Applications (IDNA) encoding. * Support inputting the message body from standard input (stdin)
Python: * Do not create temporary files for performance and to reduce disk wear.
Both: * Improve the performance * Support HTML formatted messages * Provide an option to automatically upload large files to an external storage service, such as Send (provided by @timvisee, formerly Firefox Send) or transfer.sh * Add tests * Automatically renew the S/MIME certificate, as certbot does for Let's Encrypt certificates
Thanks to Daniel Connelly for helping create the Feature comparison and test the Bash script!
Owner
- Name: Teal Dulcet
- Login: tdulcet
- Kind: user
- Location: Portland, Oregon
- Website: https://www.tealdulcet.com/
- Repositories: 31
- Profile: https://github.com/tdulcet
π¨βπ» Computer Scientist, BS, CRTGR, MS @Thunderbird Council member
Citation (CITATION.cff)
cff-version: 1.2.0
title: Send E-mail Script
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Teal
family-names: Dulcet
orcid: 'https://orcid.org/0009-0008-6616-2631'
repository-code: 'https://github.com/tdulcet/Send-Msg-CLI'
abstract: >-
Send e-mail (and text messages), with optional message and
attachments, from the command line. Optionally use your
own e-mail address and an external SMTP server.
license: GPL-3.0
version: '1.0.1'
GitHub Events
Total
- Delete event: 3
- Push event: 6
- Create event: 4
Last Year
- Delete event: 3
- Push event: 6
- Create event: 4
Committers
Last synced: 10 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Teal Dulcet | t****t@p****u | 18 |
| Daniel Connelly | c****0@g****m | 2 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 8 months ago
All Time
- Total issues: 1
- Total pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: almost 2 years
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 1.0
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- Danc2050 (1)
Pull Request Authors
- Danc2050 (3)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 12 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 4
- Total maintainers: 2
pypi.org: sendpy
Email and text notification program
- Homepage: https://github.com/tdulcet/Send-Msg-CLI
- Documentation: https://sendpy.readthedocs.io/
- License: GPL
-
Latest release: 1.0.2
published about 2 years ago
Rankings
Funding
- https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NJ4PULABRVNCC