all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to add multiple email accounts inside gnus
@ 2015-11-03 18:36 Zed
  2015-11-03 19:28 ` Jorge A. Alfaro-Murillo
  2015-11-03 19:32 ` Filipp Gunbin
  0 siblings, 2 replies; 3+ messages in thread
From: Zed @ 2015-11-03 18:36 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I have set up the gnus with one gmail account (as follows)

(setq gnus-select-method
      '(nnimap "gmail"
	       (nnimap-address "imap.gmail.com")  ; it could also be imap.googlemail.com if that's your server.
	       (nnimap-server-port 993)
	       (nnimap-stream ssl)))

(setq smtpmail-default-smtp-server "smtp.gmail.com")
(setq smtpmail-smtp-server "smtp.gmail.com")
(setq smtpmail-smtp-service 587) 
(setq sendmail-program "C:/cygwin64/usr/sbin/msmtp")

(setq message-send-mail-function 'message-send-mail-with-sendmail)
(setq message-sendmail-extra-arguments '("-a" "gmail"))


but is it possible to add other accounts such as hotmail as well? Also,
I am not sure how to attach different accounts for different newsgroup?

I googled the question for quite a well, but by adding address of
gnus-posting-styles  only changes the signature but not the email
adress?

Thanks!


-- 
You learn when you sweat


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to add multiple email accounts inside gnus
  2015-11-03 18:36 How to add multiple email accounts inside gnus Zed
@ 2015-11-03 19:28 ` Jorge A. Alfaro-Murillo
  2015-11-03 19:32 ` Filipp Gunbin
  1 sibling, 0 replies; 3+ messages in thread
From: Jorge A. Alfaro-Murillo @ 2015-11-03 19:28 UTC (permalink / raw)
  To: help-gnu-emacs

Zed writes:

> I have set up the gnus with one gmail account (as follows) 
> 
> (setq gnus-select-method 
>       '(nnimap "gmail" 
> 	       (nnimap-address "imap.gmail.com") 
> (nnimap-server-port 993) (nnimap-stream ssl)))> 
> 
> but is it possible to add other accounts such as hotmail as 
> well? 

Do the same as above with the correct port, but add it to 
gnus-secondary-select-methods:

#+BEGIN_SRC emacs-lisp
  (add-to-list 'gnus-secondary-select-methods 
               '(nnimap "hotmail"
  [...]
#+END_SRC

> (setq smtpmail-default-smtp-server "smtp.gmail.com") (setq 
> smtpmail-smtp-server "smtp.gmail.com") (setq 
> smtpmail-smtp-service 587) 

smtp (the sending part) is a little bit more tricky, since there 
is only one variable. You either have to (1) change 
smtpmail-smtp-server whenever you need the other, or (2) assuming 
they have the same port, add a line in the heading (just like you 
do with "Subject" and "To") with "X-SMTP-Server: 
whatever-the-smtp-address-for-hotmail-is".

You could also make Gmail be able to post from the other service, 
in gmail go to "Settings", then "Accounts and Import", then "Send 
mail as". If you do that, then you only need to change the "From" 
heading, so that it has you hotmail address, Gmail then sends it 
with the correct address. This is the method that I use, but I 
cannot confirm that it works with hotmail.

> (setq sendmail-program "C:/cygwin64/usr/sbin/msmtp")
> (setq message-send-mail-function 
> 'message-send-mail-with-sendmail) 

You shouldn't have to change that.

> (setq message-sendmail-extra-arguments '("-a" "gmail"))

I don't know what that does. I use gmail and do not need it. 

> Also, I am not sure how to attach different accounts for 
> different newsgroup?

I suppose you mean different servers for news. Same as above, 
add-to-list in gnus-secondary-select-methods.

Best,
-- 
Jorge.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to add multiple email accounts inside gnus
  2015-11-03 18:36 How to add multiple email accounts inside gnus Zed
  2015-11-03 19:28 ` Jorge A. Alfaro-Murillo
@ 2015-11-03 19:32 ` Filipp Gunbin
  1 sibling, 0 replies; 3+ messages in thread
From: Filipp Gunbin @ 2015-11-03 19:32 UTC (permalink / raw)
  To: Zed; +Cc: help-gnu-emacs

Hi,

On 03/11/2015 11:36 -0700, Zed wrote:

> I have set up the gnus with one gmail account (as follows)
>
> (setq gnus-select-method
>       '(nnimap "gmail"
> 	       (nnimap-address "imap.gmail.com")  ; it could also be imap.googlemail.com if that's your server.
> 	       (nnimap-server-port 993)
> 	       (nnimap-stream ssl)))
>
> (setq smtpmail-default-smtp-server "smtp.gmail.com")
> (setq smtpmail-smtp-server "smtp.gmail.com")
> (setq smtpmail-smtp-service 587) 
> (setq sendmail-program "C:/cygwin64/usr/sbin/msmtp")
>
> (setq message-send-mail-function 'message-send-mail-with-sendmail)
> (setq message-sendmail-extra-arguments '("-a" "gmail"))
>
>
> but is it possible to add other accounts such as hotmail as well? Also,
> I am not sure how to attach different accounts for different newsgroup?
>
> I googled the question for quite a well, but by adding address of
> gnus-posting-styles  only changes the signature but not the email
> adress?
>
> Thanks!

Sending mail:

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

(setq gnus-posting-styles
      '((".*"
	 (address "me@server1.com")
	 ("X-Message-SMTP-Method" "smtp smtp.server1.com 587"))
	("nnml:some-group"
	 (address "me@server2.com")
	 ("X-Message-SMTP-Method" "smtp smtp.server2.com 587"))))

This will add correct (internal) header when replying automatically, but
to use this when composing new message you have to go to the appropriate
group's line in Group buffer and type `C-u m' - this way this group's
posting style will be used.

For receiving my setup is a bit unusual - I download all email from imap
server.

(setq gnus-select-method '(nnnil ""))
(setq gnus-secondary-select-methods '((nnml "")))

(setq mail-sources '((imap :server "imap.server1.com"
			   :user "me@server1.com" 
			   :stream tls)
		     (imap :server "imap.servers2.com" 
		     	   :user "me@server2.com"
		     	   :stream tls)))

~/.authinfo:

machine imap.server1.com login me@server1.com password secret1
machine imap.server2.com login me@server2.com password secret2

Filipp



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-03 19:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-03 18:36 How to add multiple email accounts inside gnus Zed
2015-11-03 19:28 ` Jorge A. Alfaro-Murillo
2015-11-03 19:32 ` Filipp Gunbin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.