all repos — honk @ 99c543f5e08f6a55903b8ccdd03e35628447c946

my fork of honk

clear remaining retries after a final delivery failure
Ted Unangst tedu@tedunangst.com
Sat, 18 Jul 2020 15:01:00 -0400
commit

99c543f5e08f6a55903b8ccdd03e35628447c946

parent

c5f27e6a069459f1110b8a4f96734926d3dc6666

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

jump to
M deliverator.godeliverator.go

@@ -16,6 +16,7 @@

package main import ( + "fmt" "log" notrand "math/rand" "time"

@@ -43,6 +44,7 @@ case 5:

drift = 24 * time.Hour default: log.Printf("he's dead jim: %s", rcpt) + clearoutbound(rcpt) return } drift += time.Duration(notrand.Int63n(int64(drift / 10)))

@@ -55,6 +57,17 @@ select {

case pokechan <- 0: default: } +} + +func clearoutbound(rcpt string) { + hostname := originate(rcpt) + if hostname == "" { + return + } + xid := fmt.Sprintf("%%https://%s/%%", hostname) + log.Printf("clearing outbound for %s", xid) + db := opendatabase() + db.Exec("delete from doovers where rcpt like ?", xid) } var garage = gate.NewLimiter(40)