GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - actcoding/smtp-cli: 📨 Send emails right from your terminal.

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
config
config
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
Taskfile.yml
Taskfile.yml
 
 
cli.go
cli.go
 
 
config.go
config.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
install.sh
install.sh
 
 
smtp.go
smtp.go
 
 

Repository files navigation

smtp-cli

📨 Send emails right from your terminal.

We use this tool to send an informational email whenever someone logs in to one of our servers. Intended usage is via pam_exec(8).

Emails are sent directly via SMTP. The config is read from a json file, see Config.

The message body is produced via go templates, see Templates.

Installation

Download an archive (.tar.gz) from the latest release and run the install.sh script.

Usage

Add the following snippet to /etc/pam.d/sshd:

session    required     pam_exec.so /usr/local/bin/smtp-cli -config /usr/local/etc/smtp-cli/config.json -template /usr/local/etc/smtp-cli/template.gotmpl

Config

{
    "host":  "mail.example.org",
	"port":  465,
	"username":  "[email protected]",
	"password":  "",
	"from":  "monitor <[email protected]>",
	"to":  [
		"info <[email protected]>"
	],
	"subject": "New login to the server"
}

Templates

The following variables are made available to the go template:

Variable Type
Host string
User string
RemoteUser string
RemoteHost string
Tty string
Timestamp time.Time

License

MIT

About

📨 Send emails right from your terminal.

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.