adjust auto-retry, fix banned response code, rewrite email composing to enmime, add more logs

This commit is contained in:
Aine
2022-11-16 22:22:19 +02:00
parent fce6593cd7
commit 225ba2ee9b
4 changed files with 44 additions and 77 deletions

View File

@@ -39,7 +39,7 @@ func (b *Bot) SetSendmail(sendmail func(string, string, string) error) {
func (b *Bot) Sendmail(eventID id.EventID, from, to, data string) (bool, error) {
err := b.sendmail(from, to, data)
if err != nil {
if strings.HasPrefix(err.Error(), "45") {
if strings.HasPrefix(err.Error(), "4") {
b.log.Debug("email %s (from=%s to=%s) was added to the queue: %v", eventID, from, to, err)
return true, b.enqueueEmail(eventID.String(), from, to, data)
}