Gnus development mailing list
 help / color / mirror / Atom feed
* Multiple gmail accounts and SMTP (again)
@ 2011-07-24 20:55 Johnny
  2011-07-25 17:58 ` Sivaram Neelakantan
  2011-08-21  4:14 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 4+ messages in thread
From: Johnny @ 2011-07-24 20:55 UTC (permalink / raw)
  To: ding

I am attempting to set up a second gmail account, and have some trouble
in getting the outgoing mail to behave nicely. Summarising, I want to
send mail from either gmail-account with "From" address set
accordingly. Below, a ramble about my attempts so far.


In setting up the IMAP part, I defined the virtual server names and used
those in authinfo to successfully differentiate between the accounts:
In .gnus.el:
       (nnimap "gmail1"
	       (nnimap-address "imap.gmail.com")
	       (nnimap-server-port 993)
	       (nnimap-stream ssl)
	       (nnimap-list-pattern inbox-)
	       )
        (nnimap "gmail2"
	       (nnimap-address "imap.gmail.com")
	       (nnimap-server-port 993)
	       (nnimap-stream ssl)
	       (nnimap-list-pattern inbox-)
	       )

And then in .authinfo:
 machine gmail1 login gmail1@gmail.com password gmail1pass port 993
 machine gmail2 login gmail2@gmail.com password gmail2pass port 993

This makes the IMAP work well. All good so far. 

(For SMTP, I am using the emacs-wiki setup, as described here: http://www.emacswiki.org/emacs/MultipleSMTPAccounts)

I then attempted to use virtual server names for SMTP as well, i.e.:
In .gnus.el:
(setq smtp-accounts '(
                      (ssl "gmail1" "smtp.gmail.com" "587"
                            "gmail1@gmail.com" nil)
                      (ssl "gmail2" "smtp.gmail.com" "587"
                            "gmail2@gmail.com" nil)))

And in authinfo:
 machine gmail1 login gmail1@gmail.com password gmail1pass port 587
 machine gmail2 login gmail2@gmail.com password gmail2pass port 587

This breaks the sendmail/authinfo functionality such that I have to
enter credentials every time sending mail from either account.

If I instead replace the 2 lines above in authinfo with:
 machine smtp.gmail.com login gmail1@gmail.com password gmail1pass port 587

This makes mailing from both addresses work. I /think/ the setup makes
gmail2 use gmail1's SMTP credentials to send the mail (note that I
didn't have to do any changes in .gnus.el on the gmail2 credentials),
and indeed, when it is received, the posting-styles for gmail2 is used,
but the senders mail address has been changed to gmail1, which I do not
fancy at all.

Any ideas on how to enable using either gmail as sender?

Cheers
-- 
Johnny



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

end of thread, other threads:[~2011-08-21  4:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-24 20:55 Multiple gmail accounts and SMTP (again) Johnny
2011-07-25 17:58 ` Sivaram Neelakantan
2011-07-25 20:23   ` Johnny
2011-08-21  4:14 ` Lars Magne Ingebrigtsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).