mirror of
https://github.com/axllent/mailpit.git
synced 2025-06-15 00:05:15 +02:00
Feature: Add additional ignored flags to sendmail (#384)
commit 5dc0ac63d414d88c516785cba26c5cec24fc817a Author: Ralph Slooten <axllent@gmail.com> Date: Fri Nov 8 21:58:46 2024 +1300 Add new ignored flags to sendmail help commit 810e6ffc2348328bfd8a0a148c95ccfb7a13cbcb Author: Lucas dos Santos Abreu <lucas.s.abreu@gmail.com> Date: Fri Nov 8 05:37:27 2024 -0300 Feature: Add additional ignored flags to sendmail (#384)
This commit is contained in:
@ -12,13 +12,13 @@ var sendmailCmd = &cobra.Command{
|
|||||||
Use: "sendmail [flags] [recipients]",
|
Use: "sendmail [flags] [recipients]",
|
||||||
Short: "A sendmail command replacement for Mailpit",
|
Short: "A sendmail command replacement for Mailpit",
|
||||||
Run: func(_ *cobra.Command, _ []string) {
|
Run: func(_ *cobra.Command, _ []string) {
|
||||||
|
|
||||||
sendmail.Run()
|
sendmail.Run()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(sendmailCmd)
|
rootCmd.AddCommand(sendmailCmd)
|
||||||
|
var ignored string
|
||||||
|
|
||||||
// print out manual help screen
|
// print out manual help screen
|
||||||
sendmailCmd.SetHelpTemplate(sendmail.HelpTemplate([]string{os.Args[0], "sendmail"}))
|
sendmailCmd.SetHelpTemplate(sendmail.HelpTemplate([]string{os.Args[0], "sendmail"}))
|
||||||
@ -27,10 +27,13 @@ func init() {
|
|||||||
// multi-letter single-dash variables (-bs)
|
// multi-letter single-dash variables (-bs)
|
||||||
sendmailCmd.Flags().StringVarP(&sendmail.FromAddr, "from", "f", sendmail.FromAddr, "SMTP sender")
|
sendmailCmd.Flags().StringVarP(&sendmail.FromAddr, "from", "f", sendmail.FromAddr, "SMTP sender")
|
||||||
sendmailCmd.Flags().StringVarP(&sendmail.SMTPAddr, "smtp-addr", "S", sendmail.SMTPAddr, "SMTP server address")
|
sendmailCmd.Flags().StringVarP(&sendmail.SMTPAddr, "smtp-addr", "S", sendmail.SMTPAddr, "SMTP server address")
|
||||||
sendmailCmd.Flags().BoolVarP(&sendmail.UseB, "long-b", "b", false, "Handle SMTP commands on standard input (use as -bs)")
|
sendmailCmd.Flags().BoolVarP(&sendmail.UseB, "ignored-b", "b", false, "Handle SMTP commands on standard input (use as -bs)")
|
||||||
sendmailCmd.Flags().BoolVarP(&sendmail.UseS, "long-s", "s", false, "Handle SMTP commands on standard input (use as -bs)")
|
sendmailCmd.Flags().BoolVarP(&sendmail.UseS, "ignored-s", "s", false, "Handle SMTP commands on standard input (use as -bs)")
|
||||||
sendmailCmd.Flags().BoolP("verbose", "v", false, "Verbose mode (sends debug output to stderr)")
|
sendmailCmd.Flags().BoolP("verbose", "v", false, "Verbose mode (sends debug output to stderr)")
|
||||||
sendmailCmd.Flags().BoolP("long-i", "i", false, "Ignored")
|
sendmailCmd.Flags().BoolP("ignored-i", "i", false, "Ignored")
|
||||||
sendmailCmd.Flags().BoolP("long-o", "o", false, "Ignored")
|
sendmailCmd.Flags().BoolP("ignored-o", "o", false, "Ignored")
|
||||||
sendmailCmd.Flags().BoolP("long-t", "t", false, "Ignored")
|
sendmailCmd.Flags().BoolP("ignored-t", "t", false, "Ignored")
|
||||||
|
sendmailCmd.Flags().StringVarP(&ignored, "ignored-name", "F", "", "Ignored")
|
||||||
|
sendmailCmd.Flags().StringVarP(&ignored, "ignored-bits", "B", "", "Ignored")
|
||||||
|
sendmailCmd.Flags().StringVarP(&ignored, "ignored-errors", "e", "", "Ignored")
|
||||||
}
|
}
|
||||||
|
@ -82,6 +82,9 @@ func Run() {
|
|||||||
flag.BoolP("long-i", "i", false, "Ignored")
|
flag.BoolP("long-i", "i", false, "Ignored")
|
||||||
flag.BoolP("long-o", "o", false, "Ignored")
|
flag.BoolP("long-o", "o", false, "Ignored")
|
||||||
flag.BoolP("long-t", "t", false, "Ignored")
|
flag.BoolP("long-t", "t", false, "Ignored")
|
||||||
|
flag.StringP("from-name", "F", "", "Ignored")
|
||||||
|
flag.StringP("bits", "B", "", "Ignored")
|
||||||
|
flag.StringP("errors", "e", "", "Ignored")
|
||||||
|
|
||||||
// set the default help
|
// set the default help
|
||||||
flag.Usage = func() {
|
flag.Usage = func() {
|
||||||
@ -198,6 +201,9 @@ Flags:
|
|||||||
-i Ignored
|
-i Ignored
|
||||||
-o Ignored
|
-o Ignored
|
||||||
-v Ignored
|
-v Ignored
|
||||||
|
-F string Ignored
|
||||||
|
-B string Ignored
|
||||||
|
-e string Ignored
|
||||||
`, config.Version, strings.Join(args, " "), FromAddr)
|
`, config.Version, strings.Join(args, " "), FromAddr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user