about summary refs log tree commit diff stats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/compose.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/widgets/compose.go b/widgets/compose.go
index 9bd5350..26b567f 100644
--- a/widgets/compose.go
+++ b/widgets/compose.go
@@ -217,8 +217,16 @@ func (c *Composer) PrepareHeader() (*mail.Header, []string, error) {
 	if date, err := header.Date(); err != nil || date == (time.Time{}) {
 		header.SetDate(time.Now())
 	}
-	if from, _ := mhdr.Text("From"); from == "" {
-		mhdr.SetText("From", c.headers.from.input.String())
+	from := c.headers.from.input.String()
+	from_addrs, err := gomail.ParseAddressList(from)
+	if err != nil {
+		return nil, nil, errors.Wrapf(err, "ParseAddressList(%s)", from)
+	} else {
+		var simon_from []*mail.Address
+		for _, addr := range from_addrs {
+			simon_from = append(simon_from, (*mail.Address)(addr))
+		}
+		header.SetAddressList("From", simon_from)
 	}
 	if to := c.headers.to.input.String(); to != "" {
 		// Dammit Simon, this branch is 3x as long as it ought to be because