send_vault

package
v0.82.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:     "send-vault",
	Short:   "Send mail (with credentials from vault)",
	Aliases: []string{"send-v", "s-v", "sv"},
	Args:    cobra.NoArgs,
	Run: func(c *cobra.Command, args []string) {
		var err error
		host, port, user, password, err := vault_smtp.GetSMTPSecrets(FlagVaultKey)
		if err != nil {
			log.Fatal(err)
		}
		message := FlagMessage
		if message == "-" {
			message = stdin_utils.ReadAll()
		}
		from := user
		if FlagFrom != "" {
			from = FlagFrom
		}
		err = mail_utils.SendSimpleMail(
			host,
			strconv.Itoa(port),
			user,
			password,
			from,
			FlagTo,
			FlagSubject,
			message,
		)
		if err != nil {
			log.Fatal(err)
		}
	},
}
View Source
var FlagFrom string
View Source
var FlagMessage string
View Source
var FlagSubject string
View Source
var FlagTo string
View Source
var FlagVaultKey string

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL