aboutsummaryrefslogtreecommitdiffstats
path: root/worker
diff options
context:
space:
mode:
Diffstat (limited to 'worker')
-rw-r--r--worker/imap/worker.go3
-rw-r--r--worker/worker.go8
2 files changed, 8 insertions, 3 deletions
diff --git a/worker/imap/worker.go b/worker/imap/worker.go
index ade539af..125fba88 100644
--- a/worker/imap/worker.go
+++ b/worker/imap/worker.go
@@ -71,10 +71,9 @@ func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error {
w.config.addr = u.Host
if !strings.ContainsRune(w.config.addr, ':') {
- w.config.addr += ":" + u.Scheme
+ w.config.addr += ":" + w.config.scheme
}
- w.config.scheme = u.Scheme
w.config.user = u.User
case *types.Connect:
var (
diff --git a/worker/worker.go b/worker/worker.go
index 2a430832..7db7be5e 100644
--- a/worker/worker.go
+++ b/worker/worker.go
@@ -7,6 +7,7 @@ import (
"fmt"
"log"
"net/url"
+ "strings"
)
// Guesses the appropriate worker type based on the given source string
@@ -16,7 +17,12 @@ func NewWorker(source string, logger *log.Logger) (*types.Worker, error) {
return nil, err
}
worker := types.NewWorker(logger)
- switch u.Scheme {
+ scheme := u.Scheme
+ if strings.ContainsRune(scheme, '+') {
+ scheme = scheme[:strings.IndexRune(scheme, '+')]
+ fmt.Println(scheme)
+ }
+ switch scheme {
case "imap":
fallthrough
case "imaps":