GODT-1779: Remove go-imap

This commit is contained in:
James Houlahan
2022-08-26 17:00:21 +02:00
parent 3b0bc1ca15
commit 39433fe707
593 changed files with 12725 additions and 91626 deletions

30
tests/ctx_smtp_test.go Normal file
View File

@ -0,0 +1,30 @@
package tests
import (
"fmt"
"net/smtp"
"github.com/ProtonMail/proton-bridge/v2/internal/constants"
)
func (t *testCtx) newSMTPClient(userID, clientID string) error {
return t.newSMTPClientOnPort(userID, clientID, t.bridge.GetSMTPPort())
}
func (t *testCtx) newSMTPClientOnPort(userID, clientID string, imapPort int) error {
client, err := smtp.Dial(fmt.Sprintf("%v:%d", constants.Host, imapPort))
if err != nil {
return err
}
t.smtpClients[clientID] = &smtpClient{
userID: userID,
client: client,
}
return nil
}
func (t *testCtx) getSMTPClient(clientID string) (string, *smtp.Client) {
return t.smtpClients[clientID].userID, t.smtpClients[clientID].client
}