info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IMAP Sending Issue with Multiple Accounts


From: Serghei Iakovlev
Subject: Re: IMAP Sending Issue with Multiple Accounts
Date: Thu, 05 Sep 2024 18:33:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Hi Leo,

I think I’ve already tried something similar to what you’re
suggesting. I even experimented with a specialized hook. Here’s a
cleaned-up version of my current setup:

--8<-------------------------- separator ------------------------>8--
(setq gnus-posting-styles
      `((".*"
         (signature ,user-full-name)
         (address "egrep@protonmail.ch")
         ("GCC" "nnimap+main:Sent")
         ("X-Message-SMTP-Method" "smtp 127.0.0.1 1025"))
        ("nnimap\\+gmail:.*"
         (address "redacted@gmail.com")
         ("GCC" "nnimap+gmail:[Gmail]/Sent Mail")
         ("X-Message-SMTP-Method" "smtp smtp.gmail.com 587"))))

(setq message-send-mail-function 'message-smtpmail-send-it)
(setq send-mail-function #'smtpmail-send-it)

(setq smtpmail-debug-info t)
(setq smtpmail-stream-type 'ssl)

;; Disabled in global scope
;; (setq smtpmail-default-smtp-server "127.0.0.1")
;; (setq smtpmail-smtp-service 1025)

(defun set-mail-transport ()
  (cond ((equal user-mail-address "egrep@protonmail.ch")
         (message "=== sending via proton ===")
         (setq smtpmail-smtp-server "127.0.0.1")
         (setq smtpmail-smtp-service 1025))
        ((equal user-mail-address "redacted@gmail.com")
         (message "=== sending via gmail ===")
         (setq smtpmail-smtp-server "smtp.gmail.com")
         (setq smtpmail-smtp-service 587))))

(add-hook 'message-send-hook #'set-mail-transport)
--8<-------------------------- separator ------------------------>8--

Sending via ProtonMail works perfectly fine, but when I try to send
through Gmail, it just hangs for a long time, and eventually, I get
the following:

--8<-------------------------- separator ------------------------>8--
=== sending via gmail ===
Sending...
Sending via mail...
open-network-stream: Failed connect: Operation timed out
--8<-------------------------- separator ------------------------>8--

I feel like I’m close, but there’s something still not quite
right. If you have any insights on what might be going wrong or any
tweaks I should try, I’d really appreciate it.


-- 
Serghei Iakovlev




reply via email to

[Prev in Thread] Current Thread [Next in Thread]