small pixel drawing of a pufferfish clist

Copy to/cc verbatim, strip useless db function
j3s j3s@c3f.net
Sat, 16 Nov 2019 21:12:49 -0600
commit

9c82843f67f2521a5d366ddfa81592991e6d4294

parent

e7e3c31673cf63c4090b876e75d27161da761131

1 files changed, 2 insertions(+), 20 deletions(-)

jump to
M main.gomain.go

@@ -325,15 +325,7 @@ for _, list := range gConfig.Lists {

addresses = append(addresses, list.Address) } - cc := []string{} recipients := []string{} - - for _, a := range e.Cc { - if !badAddress(a, addresses) { - cc = append(cc, a) - } - } - for _, a := range fetchSubscribers(l.Id) { if !badAddress(a, addresses) { recipients = append(recipients, a)

@@ -346,8 +338,8 @@ // Return the new message

newEmail := email.NewEmail() newEmail.Sender = "bounces-" + l.Address newEmail.From = e.From - newEmail.To = []string{l.Name + "<" + l.Address + ">"} - newEmail.Cc = cc + newEmail.To = e.To + newEmail.Cc = e.Cc newEmail.Recipients = recipients newEmail.Subject = e.Subject newEmail.Text = e.Text

@@ -501,16 +493,6 @@ log.Printf("DATABASE_ERROR Error=%q\n", err.Error())

os.Exit(0) } log.Printf("SUBSCRIPTION_REMOVED User=%q List=%q\n", user, list) -} - -// Remove all subscriptions from a given mailing list -func clearSubscriptions(list string) { - db := requireDB() - _, err := db.Exec("DELETE FROM subscriptions WHERE AND list=?", list) - if err != nil { - log.Printf("DATABASE_ERROR Error=%q\n", err.Error()) - os.Exit(0) - } } // HELPER FUNCTIONS ///////////////////////////////////////////////////////////