Skip to content

Send gmail from a bash/dash command line with Debian, Ubuntu, Raspbian

Notifications You must be signed in to change notification settings

ghoulmann/cmd-gmail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Reference

http://tuxtweaks.com/2012/10/send-gmail-from-the-linux-command-line/

What it Currently Does

  • cmd_mail_interactive.sh is interactive install and config; no editing required.
  • Otherwise, Reads configuration from mail_conf.sh (edit this file to customize, for sure)
  • Updates repos
  • Installs msmtp-mta & heirloom-mailx from repositiories
  • Configures msmtp-mta for gmail & based on variables in mail_conf.sh
  • Configures mailx to use msmtp-mta
  • Makes files with password information available only to you (chmod)

Usage

  • Obtain with git clone or download and unzip.
  • If the .sh files aren't already executeable, chmod +x each file.
  • Use a text editor (leafpad or nano, for example) to set the email account name, the gmail address, and the password to the mail account
  • Assuming you are at the command line and in the directory with the scripts, execute with: sudo cmd_mail.sh

Example Usage

mail -s "Subject" address@example.com < message.txt

To Do

  • Scrap the configuration include and prompt user for addy, account name, and password (more secure, less configuration). It's not like that now because I'm used to automating and eliminating interactivity.
  • If I get ambitious: prompt for info with dialog boxes (apt-get install dialog)
  • If I get more ambitious: install and configure in a lab setting for specified list of users and corresponding passwords.

About

Send gmail from a bash/dash command line with Debian, Ubuntu, Raspbian

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages