[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guidance with handling email from emacs
From: |
Björn Bidar |
Subject: |
Re: Guidance with handling email from emacs |
Date: |
Tue, 26 Sep 2023 22:57:21 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Robert Pluim <rpluim@gmail.com> writes:
> >> * Is there a “right” way for easily handling multiple SMTP accounts (or
> >> identities as Thunderbird calls them)?
>
> Eshel> Yes, there are a couple of ways to achieve this, none of them are
> really
> Eshel> great IMO. But the best way is to customize
> `message-server-alist`.
> Eshel> You can take a look at my email config here:
> Eshel>
> http://git.eshelyaron.com/gitweb/?p=dotfiles.git;a=blob;f=.emacs.d/lisp/esy-comm.el;hb=HEAD
>
> Iʼve used `gnus-posting-styles' for this in the past. something like
>
> (setq gnus-posting-styles
> '(
> ("^nnimap\\+gmail"
> (address "myusername@gmail.com")
> ("X-Message-SMTP-Method" "smtp mail.gmail.com smtps myusername"))
> ("^nnimap\\+yahoo"
> (address "myusername@yahoo.com")
> ("X-Message-SMTP-Method" "smtp mail.yahoo.com smtps myusername"))))
Another option is to use gnus-alias. You can define `gnus-alias-identity-rules`
to use a
different identity based on the rules e.g.
(setq gnus-alias-identity-rules
'(("Example-Rule-name"
;; If the email was send To: an address from example.com
;; use the alias called user@example.com
("to" ".+@.*example.com" previous)
"user@example.com")))
This way you can define an alias and set settings such as the smtp method:
(setq gnus-alias-identity-alist
'(("user@example.com" ;; Alias
"" ;; Refers-To:
"Example User <user@example.com>" ;; To:
"Example Org" ;; Organization
;; Set Gcc so mails are send in the Send folder
;; on the imap server example.com
(("Gcc" . "nnimap+example.com:Sent")
;; Using X-Message-SMTP-Method we can tell
;; Emacs wich smtp server to use, doesn't depend on
;; gnus-alias
("X-Message-SMTP-Method" .
"smtp smtp.example.com 25 user@example.com")) ;; headers
"" ;; Body Text
"") ;; Signature