Skip to content

A go CLI app for sending emails using Microsoft Graph API

License

Notifications You must be signed in to change notification settings

Simplifi-ED/go-amumu

Repository files navigation

go-amumu

A go CLI app for sending and receiving emails using Microsoft Graph API

Set enviroment variables in .env file

CLIENT_ID=< ID >
TENANT_ID=< ID >
CLIENT_SECRET=< SECRET >

Run the app

Usage

Usage:
 amumu [subcommand] [options]
server options:
 -config string - Path to yaml config file
client options:
 -to string - The email address of the recipient
 -from string - The email address of the sender
 -subject string - The subject of the email
 -message string - The message body of the email
 -channel boolean - Send to MS Teams channel (default=false)
 or
 -config string - Path to yaml config file

Examples

As an smtp server

Note

The command server expect a yaml file called amumu-config.yaml in /etc/amumu-config.yaml otherwise, path should be specified with -config flag

amumu server -config=/tmp/config.yaml
host: "0.0.0.0:1065"
domain: "simplified"
writetimeout: 10
readtimeout: 10
MaxMessageBytes: 1048576
maxRecipients: 50
allowInsecureAuth: true

Send email

amumu client -to="[email protected]" -from="[email protected]" -subject="Example Subject" -message="Example Message"

Send with Alert to Ms Teams channel

amumu client -to="[email protected]" -from="[email protected]" -subject="Example Subject" -message="Example Message" --channel=true

Using config file

amumu client -config=/tmp/config.yaml
to: "[email protected]"
from: "[email protected]"
subject: "test subject"
body: "Hello world"
channel: 
  title: "IT Challenge Alerts"
  text: "Hello world test"

Alt text