diff --git a/README.mdwn b/README.mdwn index bebd684..ba4ad0a 100644 --- a/README.mdwn +++ b/README.mdwn @@ -87,13 +87,6 @@ echo "---\nfoo: 1" | leatherman yaml2json * `update`: Installs new version of leatherman if one exists. ([internal/tool/leatherman/update/update.md](https://github.com/frioux/leatherman/blob/main/internal/tool/leatherman/update/update.md)) -### mail - - * `addrs`: Sorts addresses on stdin based on recency. ([internal/tool/mail/email/addrs.md](https://github.com/frioux/leatherman/blob/main/internal/tool/mail/email/addrs.md)) - * `addrspec-to-tabs`: Converts email addresses from the standard format on stdin to the mutt address book format on stdout. ([internal/tool/mail/email/addrspec-to-tabs.md](https://github.com/frioux/leatherman/blob/main/internal/tool/mail/email/addrspec-to-tabs.md)) - * `email2json`: Converts email to JSON. ([internal/tool/mail/email/email2json.md](https://github.com/frioux/leatherman/blob/main/internal/tool/mail/email/email2json.md)) - * `render-mail`: Render email with a Local-Date included, if Date is not already in local time. ([internal/tool/mail/email/render-mail.md](https://github.com/frioux/leatherman/blob/main/internal/tool/mail/email/render-mail.md)) - ### misc * `backlight`: Modifies screen brightness. ([internal/tool/misc/backlight/backlight.md](https://github.com/frioux/leatherman/blob/main/internal/tool/misc/backlight/backlight.md)) diff --git a/dispatch.go b/dispatch.go index 261124c..13aed12 100644 --- a/dispatch.go +++ b/dispatch.go @@ -23,7 +23,6 @@ import ( "github.com/frioux/leatherman/internal/tool/chat/automoji" "github.com/frioux/leatherman/internal/tool/chat/slack" "github.com/frioux/leatherman/internal/tool/leatherman/update" - "github.com/frioux/leatherman/internal/tool/mail/email" "github.com/frioux/leatherman/internal/tool/misc/backlight" "github.com/frioux/leatherman/internal/tool/misc/bamboo" "github.com/frioux/leatherman/internal/tool/misc/desktop" @@ -42,47 +41,43 @@ import ( func init() { Dispatch = map[string]func([]string, io.Reader) error{ - "addrs": email.Addrs, - "addrspec-to-tabs": email.ToTabs, - "alluni": uni.All, - "amygdala": amygdala.Amygdala, - "auto-emote": automoji.Run, - "backlight": backlight.Run, - "brainstem": brainstem.Brainstem, - "clocks": clocks.Run, - "csv2json": csv.ToJSON, - "csv2md": csv.ToMarkdown, - "debounce": debounce.Run, - "draw": img.Draw, - "dump-mozlz4": dumpmozlz4.Run, - "email2json": email.ToJSON, - "expand-url": expandurl.Run, - "export-bamboohr": bamboo.ExportDirectory, - "fn": fn.Run, - "group-by-date": groupbydate.Run, - "media-remote": desktop.MediaRemote, - "minotaur": minotaur.Run, - "name2rune": uni.ToRune, - "netrc-password": netrcpassword.Run, - "notes": now.Serve, - "pomotimer": pomotimer.Run, - "prepend-hist": prependemojihist.Run, - "proj": proj.Proj, - "render-mail": email.Render, - "replace-unzip": replaceunzip.Run, - "slack-deaddrop": slack.Deaddrop, - "slack-open": slack.Open, - "slack-status": slack.Status, - "srv": srv.Serve, - "status": status.Status, - "steamsrv": steamsrv.Serve, - "toml2json": toml.ToJSON, - "twilio": twilio.Twilio, - "uni": uni.Describe, - "update": update.Update, - "wuphf": wuphf.Wuphf, - "yaml2json": yaml.ToJSON, - "zine": zine.Run, + "alluni": uni.All, + "amygdala": amygdala.Amygdala, + "auto-emote": automoji.Run, + "backlight": backlight.Run, + "brainstem": brainstem.Brainstem, + "clocks": clocks.Run, + "csv2json": csv.ToJSON, + "csv2md": csv.ToMarkdown, + "debounce": debounce.Run, + "draw": img.Draw, + "dump-mozlz4": dumpmozlz4.Run, + "expand-url": expandurl.Run, + "export-bamboohr": bamboo.ExportDirectory, + "fn": fn.Run, + "group-by-date": groupbydate.Run, + "media-remote": desktop.MediaRemote, + "minotaur": minotaur.Run, + "name2rune": uni.ToRune, + "netrc-password": netrcpassword.Run, + "notes": now.Serve, + "pomotimer": pomotimer.Run, + "prepend-hist": prependemojihist.Run, + "proj": proj.Proj, + "replace-unzip": replaceunzip.Run, + "slack-deaddrop": slack.Deaddrop, + "slack-open": slack.Open, + "slack-status": slack.Status, + "srv": srv.Serve, + "status": status.Status, + "steamsrv": steamsrv.Serve, + "toml2json": toml.ToJSON, + "twilio": twilio.Twilio, + "uni": uni.Describe, + "update": update.Update, + "wuphf": wuphf.Wuphf, + "yaml2json": yaml.ToJSON, + "zine": zine.Run, "help": Help, "version": Version, diff --git a/help_generated.go b/help_generated.go index f02a1ed..a40b1e1 100644 --- a/help_generated.go +++ b/help_generated.go @@ -25,10 +25,6 @@ import "embed" //go:embed internal/tool/chat/slack/slack-open.md //go:embed internal/tool/chat/slack/slack-status.md //go:embed internal/tool/leatherman/update/update.md -//go:embed internal/tool/mail/email/addrs.md -//go:embed internal/tool/mail/email/addrspec-to-tabs.md -//go:embed internal/tool/mail/email/email2json.md -//go:embed internal/tool/mail/email/render-mail.md //go:embed internal/tool/misc/backlight/backlight.md //go:embed internal/tool/misc/img/draw.md //go:embed internal/tool/misc/bamboo/export-bamboohr.md @@ -92,14 +88,6 @@ var helpPaths = map[string]string{ "update": "internal/tool/leatherman/update/update.md", - "addrs": "internal/tool/mail/email/addrs.md", - - "addrspec-to-tabs": "internal/tool/mail/email/addrspec-to-tabs.md", - - "email2json": "internal/tool/mail/email/email2json.md", - - "render-mail": "internal/tool/mail/email/render-mail.md", - "backlight": "internal/tool/misc/backlight/backlight.md", "draw": "internal/tool/misc/img/draw.md", diff --git a/internal/tool/mail/email/addrs.go b/internal/tool/mail/email/addrs.go deleted file mode 100644 index 84dfe99..0000000 --- a/internal/tool/mail/email/addrs.go +++ /dev/null @@ -1,147 +0,0 @@ -package email - -import ( - "bufio" - "errors" - "fmt" - "io" - "log" - "math" - "net/mail" - "os" - "path/filepath" - "sort" - "strings" - "time" -) - -type addr struct { - addr, name string - score float64 -} - -func (a addr) String() string { return fmt.Sprintf("%s\t%s", a.addr, a.name) } - -// allAddrs returns all email addresses an email was sent to (To, Cc, and Bcc) -func allAddrs(email *mail.Message) []*mail.Address { - addrs := []*mail.Address{} - headers := []string{"To", "Cc", "Bcc"} - for _, x := range headers { - if email.Header.Get(x) != "" { - // Emails tend to be messy, ignore error - iAddrs, _ := email.Header.AddressList(x) - addrs = append(addrs, iAddrs...) - } - } - - return addrs -} - -// buildFrecencyMapFromGlob calls buildFrecencyMap passing emails found from the -// passed glob -func (score frecencyMap) scoreFromGlob(glob string) { - matches, err := filepath.Glob(glob) - if err != nil { - log.Fatal("couldn't get glob", err) - } - - for _, path := range matches { - file, err := os.Open(path) - if err != nil { - log.Println("Coudln't open email", path, err) - } - email, err := mail.ReadMessage(file) - file.Close() - if err != nil { - log.Println("Coudln't parse email", path, err) - continue - } - score.scoreEmail(email, time.Now()) - } -} - -type frecencyMap map[string]*addr - -// math.Log(2) / 30 -const lambda = 0.02310490601866484364 - -func newFrecencyMap() frecencyMap { return map[string]*addr{} } - -// buildFrecencyMap returns a map of addresses, scored based on how recently -// they were mailed to. See -// https://wiki.mozilla.org/User:Jesse/NewFrecency#Proposed_new_definition -func (score frecencyMap) scoreEmail(email *mail.Message, now time.Time) { - for _, addr := range allAddrs(email) { - if val, ok := score[strings.ToLower(addr.Address)]; ok { - time, err := email.Header.Date() - if err != nil { - log.Println("Couldn't read date", err) - continue - } - age := now.Sub(time).Hours() / 24 - - val.score += math.Exp(-lambda * age) - } - } -} - -// buildAddrMap returns a map of address and content, based on os.Stdin -func buildAddrMap(reader io.Reader) frecencyMap { - scanner := bufio.NewScanner(reader) - - ret := newFrecencyMap() - for scanner.Scan() { - z := strings.SplitN(scanner.Text(), "\t", 2) - if len(z) < 2 { - continue - } - if _, ok := ret[z[0]]; ok { - continue - } - ret[z[0]] = &addr{ - addr: z[0], - name: z[1], - } - } - - return ret -} - -// sortAddrMap sorts the addrs arg based on the values in the score arg; -// leftover values are printed in alphabetical order. -func sortAddrMap(score frecencyMap) []addr { - addrs := make([]addr, len(score)) - - i := 0 - for _, addr := range score { - addrs[i] = *addr - i++ - } - - // sort keys based on score - sort.Slice( - addrs, - func(i, j int) bool { return addrs[i].score > addrs[j].score }, - ) - - return addrs -} - -func Addrs(args []string, stdin io.Reader) error { - if len(args) != 2 { - return errors.New("please pass a glob") - } - - addrMap := buildAddrMap(stdin) - addrMap.scoreFromGlob(args[1]) - - addrs := sortAddrMap(addrMap) - - // first line is blank - fmt.Println() - for _, line := range addrs { - fmt.Println(line) - } - - return nil -} diff --git a/internal/tool/mail/email/addrs.md b/internal/tool/mail/email/addrs.md deleted file mode 100644 index fc25d0a..0000000 --- a/internal/tool/mail/email/addrs.md +++ /dev/null @@ -1,12 +0,0 @@ -Sorts addresses on stdin based on recency. - -`addrs` sorts the addresses passed on stdin (in the mutt addrbook format, see -`addrspec-to-tabs`) and sorts them based on how recently they were used, from -the glob passed on the arguments. The tool exists so that you can create an -address list either with an export tool (like `goobook`), a subset of your sent -addresses, or whatever else, and then you can sort it based on your sent mail -folder. - -``` bash -$ sortedaddrs.txt -``` diff --git a/internal/tool/mail/email/addrs_test.go b/internal/tool/mail/email/addrs_test.go deleted file mode 100644 index b6d222e..0000000 --- a/internal/tool/mail/email/addrs_test.go +++ /dev/null @@ -1,100 +0,0 @@ -package email - -import ( - "net/mail" - "strings" - "testing" - "time" - - "github.com/frioux/leatherman/internal/testutil" -) - -func TestAllAddrs(t *testing.T) { - t.Parallel() - - message, err := mail.ReadMessage(strings.NewReader(`To: "A B" -Date: Sat, 21 Dec 2012 00:59:51 +0000 -Subject: Station - -Foo bar`)) - if err != nil { - t.Errorf("Couldn't set up test: %s", err) - return - } - - a := allAddrs(message) - if testutil.Equal(t, len(a), 1, "wrong address count") { - testutil.Equal(t, a[0].Name, "A B", "wrong name") - testutil.Equal(t, a[0].Address, "a.b@c.com", "wrong address") - } -} -func TestScoreEmail(t *testing.T) { - t.Parallel() - - message, err := mail.ReadMessage(strings.NewReader(`To: "A B" -Date: Sat, 21 Dec 2012 00:59:51 +0000 -Subject: Station - -Foo bar`)) - if err != nil { - t.Errorf("Couldn't set up test: %s", err) - return - } - - m := newFrecencyMap() - m["a.b@c.com"] = &addr{ - addr: "a.b@c.com", - name: "A B", - score: 0, - } - - m.scoreEmail(message, time.Date(2012, 12, 12, 12, 12, 12, 12, time.UTC)) - if s := m["a.b@c.com"].score; s > 1.217+0.001 || s < 1.217-0.001 { - t.Errorf("Score should have been about 1.217, was %f", s) - } -} - -func TestBuildAddrMap(t *testing.T) { - t.Parallel() - - m := buildAddrMap(strings.NewReader("\n" + - "frew@me.com\tFrew\n" + - "frew@me.com\tFrew2\n", - )) - - if testutil.Equal(t, len(m), 1, "incorrectly sized map") { - a, ok := m["frew@me.com"] - if !ok { - t.Errorf("didn't find address frew@me.com") - return - } - testutil.Equal(t, a.name, "Frew", "incorrect name") - testutil.Equal(t, a.addr, "frew@me.com", "incorrect address") - testutil.Equal(t, a.score, float64(0), "incorrect score") - } -} - -func TestSortAddrMap(t *testing.T) { - t.Parallel() - - m := newFrecencyMap() - m["a@b.com"] = &addr{name: "a", addr: "a@b.com", score: 1} - m["b@b.com"] = &addr{name: "b", addr: "b@b.com", score: -1} - m["c@b.com"] = &addr{name: "c", addr: "c@b.com", score: 0} - m["d@b.com"] = &addr{name: "d", addr: "d@b.com", score: 3} - - a := sortAddrMap(m) - if testutil.Equal(t, len(a), 4, "incorrectly sized slice") { - testutil.Equal(t, a[0].name, "d", "wrong name") - testutil.Equal(t, a[1].name, "a", "wrong name") - testutil.Equal(t, a[2].name, "c", "wrong name") - testutil.Equal(t, a[3].name, "b", "wrong name") - } -} - -func TestAddrString(t *testing.T) { - t.Parallel() - - a := &addr{name: "frew", addr: "a@b.com"} - testutil.Equal(t, a.String(), "a@b.com\tfrew", "wrong mutt address format") -} diff --git a/internal/tool/mail/email/addrspec-to-tabs.go b/internal/tool/mail/email/addrspec-to-tabs.go deleted file mode 100644 index 442730f..0000000 --- a/internal/tool/mail/email/addrspec-to-tabs.go +++ /dev/null @@ -1,31 +0,0 @@ -package email - -import ( - "bufio" - "fmt" - "io" - "log" - "net/mail" -) - -func ToTabs(args []string, stdin io.Reader) error { - if len(args) > 1 && args[1] == "-h" { - fmt.Println("reads emails (`\"Foo Bar\" `) and produces addrbook", - "format (`Foo Bar\tfoo@bar.com`)") - return nil - } - scanner := bufio.NewScanner(stdin) - for scanner.Scan() { - list := scanner.Text() - emails, err := mail.ParseAddressList(list) - if err != nil { - log.Print(err, list) - } - - for _, v := range emails { - fmt.Println(v.Address + "\t" + v.Name + "\t") - } - } - - return nil -} diff --git a/internal/tool/mail/email/addrspec-to-tabs.md b/internal/tool/mail/email/addrspec-to-tabs.md deleted file mode 100644 index 0eb1f7f..0000000 --- a/internal/tool/mail/email/addrspec-to-tabs.md +++ /dev/null @@ -1,15 +0,0 @@ -Converts email addresses from the standard format on stdin to the mutt address book format on stdout. - -`addrspec-to-tabs` converts email addresses from the standard format (`"Hello Friend" -`) from stdin to the mutt address book format, ie tab separated fields, -on stdout. - -``` bash -$ addrbook.txt -``` - -This tool ignores the comment because, after actually auditing my addressbook, -most comments are incorrectly recognized by all tools. (for example: -`<5555555555@vzw.com> (555) 555-5555` should not have a comment of `(555)`.) - -It exists to be combined with `addrs` and mutt. diff --git a/internal/tool/mail/email/email2json.go b/internal/tool/mail/email/email2json.go deleted file mode 100644 index 7613399..0000000 --- a/internal/tool/mail/email/email2json.go +++ /dev/null @@ -1,83 +0,0 @@ -package email - -import ( - "encoding/json" - "errors" - "fmt" - "io" - "mime" - "net/mail" - "os" - "path/filepath" -) - -type email struct { - Header map[string]string -} - -func toJSON(r io.Reader, w io.Writer) error { - enc := json.NewEncoder(w) - - e, err := mail.ReadMessage(r) - if err != nil { - return fmt.Errorf("mail.ReadMessage: %w", err) - } - - dec := new(mime.WordDecoder) - - eml := email{Header: make(map[string]string)} - for k := range e.Header { - header, err := dec.DecodeHeader(e.Header.Get(k)) - if err != nil { - panic(err) - } - eml.Header[k] = header - } - - err = enc.Encode(eml) - if err != nil { - return fmt.Errorf("json.Encode: %w", err) - } - - return nil -} - -func toJSONFromFile(path string, w io.Writer) (err error) { - file, err := os.Open(path) - if err != nil { - return fmt.Errorf("os.Open: %w", err) - } - defer file.Close() - - defer func() { - if r := recover(); r != nil { - err = fmt.Errorf("%s", r) - } - }() - - if err := toJSON(file, w); err != nil { - return fmt.Errorf("%w (%s)", err, path) - } - return nil -} - -func ToJSON(args []string, stdin io.Reader) error { - if len(args) < 2 { - return errors.New("please pass one or more globs") - } - - for _, glob := range args[1:] { - matches, err := filepath.Glob(glob) - if err != nil { - return fmt.Errorf("filepath.Glob: %w", err) - } - - for _, path := range matches { - if err := toJSONFromFile(path, os.Stdout); err != nil { - fmt.Fprintln(os.Stderr, err) - } - } - } - - return nil -} diff --git a/internal/tool/mail/email/email2json.md b/internal/tool/mail/email/email2json.md deleted file mode 100644 index bc357d5..0000000 --- a/internal/tool/mail/email/email2json.md +++ /dev/null @@ -1,21 +0,0 @@ -Converts email to JSON. - -Produces a JSON representation of an email from a list of globs. Only -headers are currently supported, patches welcome to support bodies. - -```bash -$ email2json '/home/frew/var/mail/mitsi/cur/*' | head -1 | jq . -{ - "Header": { - "Content-Type": "multipart/alternative; boundary=00163642688b8ef3070464661533", - "Date": "Thu, 5 Mar 2009 15:45:17 -0600", - "Delivered-To": "xxx", - "From": "fREW Schmidt ", - "Message-Id": "", - "Mime-Version": "1.0", - "Received": "by 10.103.115.8 with HTTP; Thu, 5 Mar 2009 13:45:17 -0800 (PST)", - "Subject": "STATION", - "To": "xyzzy@googlegroups.com" - } -} -``` diff --git a/internal/tool/mail/email/render-mail.go b/internal/tool/mail/email/render-mail.go deleted file mode 100644 index a050594..0000000 --- a/internal/tool/mail/email/render-mail.go +++ /dev/null @@ -1,33 +0,0 @@ -package email - -import ( - "bufio" - "fmt" - "io" - "net/mail" - "regexp" - "time" -) - -var dateRe = regexp.MustCompile(`^Date:\s+(.*)\s*$`) - -func Render(args []string, stdin io.Reader) error { - scanner := bufio.NewScanner(stdin) - for scanner.Scan() { - line := scanner.Text() - - match := dateRe.FindSubmatch([]byte(line)) - if match == nil { - fmt.Println(line) - } else { - date, err := mail.ParseDate(string(match[1])) - - if err == nil && date.Location() != time.Local { - fmt.Println("Local-Date: " + date.In(time.Local).Format("Mon, 02 Jan 2006 15:04:05")) - } - fmt.Println(line) - } - } - - return nil -} diff --git a/internal/tool/mail/email/render-mail.md b/internal/tool/mail/email/render-mail.md deleted file mode 100644 index 5289cef..0000000 --- a/internal/tool/mail/email/render-mail.md +++ /dev/null @@ -1 +0,0 @@ -Render email with a Local-Date included, if Date is not already in local time. diff --git a/internal/tool/mail/email/render_test.go b/internal/tool/mail/email/render_test.go deleted file mode 100644 index 60dcff6..0000000 --- a/internal/tool/mail/email/render_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package email_test - -import ( - "strings" - - "github.com/frioux/leatherman/internal/tool/mail/email" -) - -func ExampleRender() { - r := strings.NewReader(`foo -bar -baz -Date: Wed, 18 Jul 2019 16:00:00 +0000`) - - email.Render(nil, r) - // Output: - // foo - // bar - // baz - // Local-Date: Thu, 18 Jul 2019 09:00:00 - // Date: Wed, 18 Jul 2019 16:00:00 +0000 -} diff --git a/internal/tool/mail/email/testdata/basic.eml b/internal/tool/mail/email/testdata/basic.eml deleted file mode 100644 index 6346ed6..0000000 --- a/internal/tool/mail/email/testdata/basic.eml +++ /dev/null @@ -1,33 +0,0 @@ -MIME-Version: 1.0 -Date: Fri, 22 Mar 2019 21:00:48 -0700 -Message-ID: -Subject: Tweet from Official AJ Smith (@officalajsmith) -From: Frew Schmidt -To: Frew@xyzzy.com -Content-Type: multipart/alternative; boundary="0000000000004d71c00584bb0498" - ---0000000000004d71c00584bb0498 -Content-Type: text/plain; charset="UTF-8" - -Official AJ Smith (@officalajsmith) tweeted at 8:47 PM on Fri, Mar 22, 2019: -@JacobyDave -I found this entertaining and felt the need to share with someone. -https://t.co/BK3lJWTsT5 -(https://twitter.com/officalajsmith/status/1109300669209554945?s=03) - -Get the official Twitter app at https://twitter.com/download?s=13 - ---0000000000004d71c00584bb0498 -Content-Type: text/html; charset="UTF-8" -Content-Transfer-Encoding: quoted-printable - -
Official AJ Smith (@officalajsmith) tweeted at 8:47 PM on= - Fri, Mar 22, 2019:
@JacobyDave
I found this entertaining and felt t= -he need to share with someone. https://= -t.co/BK3lJWTsT5
(https://twitter.com/officalajsmith/status/110= -9300669209554945?s=3D03)

Get the official Twitter app at https://twitter.com/download?s=3D1= -3
- ---0000000000004d71c00584bb0498-- diff --git a/internal/tool/mail/email/testdata/basic.json b/internal/tool/mail/email/testdata/basic.json deleted file mode 100644 index 5517b8b..0000000 --- a/internal/tool/mail/email/testdata/basic.json +++ /dev/null @@ -1 +0,0 @@ -{"Header":{"Content-Type":"multipart/alternative; boundary=\"0000000000004d71c00584bb0498\"","Date":"Fri, 22 Mar 2019 21:00:48 -0700","From":"Frew Schmidt \u003cfrew@xyzzy.com\u003e","Message-Id":"\u003cCA+xnatts1+B99DipMtTmw66bLinR=60da4rU3emQM=UW-ifPsw@mail.gmail.com\u003e","Mime-Version":"1.0","Subject":"Tweet from Official AJ Smith (@officalajsmith)","To":"Frew@xyzzy.com"}} diff --git a/internal/tool/mail/email/tojson_test.go b/internal/tool/mail/email/tojson_test.go deleted file mode 100644 index 611007e..0000000 --- a/internal/tool/mail/email/tojson_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package email - -import ( - "bytes" - "flag" - "io/ioutil" - "os" - "path/filepath" - "testing" - - "github.com/frioux/leatherman/internal/testutil" -) - -var update = flag.Bool("update", false, "update golden files") - -func TestToJSON(t *testing.T) { - t.Parallel() - - tests := []string{"basic"} - - for _, name := range tests { - t.Run(name, func(t *testing.T) { - sourceMIME, err := os.Open(filepath.Join("testdata", name+".eml")) - if err != nil { - t.Fatalf("Couldn't load MIME: %s", err) - } - defer sourceMIME.Close() - - buf := &bytes.Buffer{} - err = toJSON(sourceMIME, buf) - if err != nil { - t.Errorf("%s errored: %s", name, err) - return - } - - golden := filepath.Join("testdata", name+".json") - if *update { - if err := ioutil.WriteFile(golden, buf.Bytes(), 0644); err != nil { - t.Fatalf("Couldn't update %s: %s", golden, err) - } - } - expected, err := ioutil.ReadFile(golden) - if err != nil { - t.Fatalf("Couldn't load JSON: %s", err) - } - - testutil.JSONEqual(t, buf.String(), string(expected), name+" matches") - }) - } -} diff --git a/internal/tool/mail/email/totabs_test.go b/internal/tool/mail/email/totabs_test.go deleted file mode 100644 index e7b05da..0000000 --- a/internal/tool/mail/email/totabs_test.go +++ /dev/null @@ -1,15 +0,0 @@ -package email_test - -import ( - "strings" - - "github.com/frioux/leatherman/internal/tool/mail/email" -) - -func ExampleToTabs() { - - r := strings.NewReader(`"Frew Schmidt" `) - - email.ToTabs(nil, r) - // Output: frew@frew.frew Frew Schmidt -}