sophuwu.site > mailboxxer
view
sophuwu sophie@skisiel.com
Sat, 20 Jul 2024 15:53:19 +0200
commit

62d70a9ef3dbea7c9ff59c09b8318d2c5a6f79df

parent

1c95c3260c1336416d090e1f7c17b51e2dd4f7f0

1 files changed, 10 insertions(+), 0 deletions(-)

jump to
M main.gomain.go

@@ -2,6 +2,7 @@ package main

import ( "fmt" + "github.com/DusanKasan/parsemail" "os" "path/filepath" )

@@ -14,6 +15,15 @@ fmt.Println("From ", meta.From)

fmt.Println("To", meta.To) fmt.Println("Subject", meta.Subject) fmt.Println("Date", TimeStr(meta.Date)) + return + } + if len(os.Args) > 1 && os.Args[1] == "view" { + e, err := parsemail.Parse(os.Stdin) + if err != nil { + fmt.Println(err) + return + } + fmt.Println(e.HTMLBody, e.TextBody) return }