fix(PROJ-30): imapclient.New — Rueckgabewert an go-imap/v2 beta.8 API anpassen
imapclient.New gibt in beta.8 nur *Client zurueck (kein error). Alle drei Aufrufe in Connect() korrigiert. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+3
-15
@@ -62,11 +62,7 @@ func Connect(host string, port int, tlsMode string) (*Conn, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("imap connect ssl: %w", err)
|
||||
}
|
||||
c, err := imapclient.New(raw, nil)
|
||||
if err != nil {
|
||||
raw.Close()
|
||||
return nil, fmt.Errorf("imap client ssl: %w", err)
|
||||
}
|
||||
c := imapclient.New(raw, nil)
|
||||
return &Conn{Client: c, raw: raw}, nil
|
||||
|
||||
case "starttls":
|
||||
@@ -74,13 +70,9 @@ func Connect(host string, port int, tlsMode string) (*Conn, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("imap connect starttls: %w", err)
|
||||
}
|
||||
c, err := imapclient.New(raw, &imapclient.Options{
|
||||
c := imapclient.New(raw, &imapclient.Options{
|
||||
TLSConfig: &tls.Config{ServerName: host},
|
||||
})
|
||||
if err != nil {
|
||||
raw.Close()
|
||||
return nil, fmt.Errorf("imap client starttls: %w", err)
|
||||
}
|
||||
return &Conn{Client: c, raw: raw}, nil
|
||||
|
||||
case "none":
|
||||
@@ -88,11 +80,7 @@ func Connect(host string, port int, tlsMode string) (*Conn, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("imap connect plain: %w", err)
|
||||
}
|
||||
c, err := imapclient.New(raw, nil)
|
||||
if err != nil {
|
||||
raw.Close()
|
||||
return nil, fmt.Errorf("imap client plain: %w", err)
|
||||
}
|
||||
c := imapclient.New(raw, nil)
|
||||
return &Conn{Client: c, raw: raw}, nil
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user