* Gnus and offline Email
@ 2016-11-12 15:11 Tim Zander
2016-11-12 19:37 ` Eric Abrahamsen
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Tim Zander @ 2016-11-12 15:11 UTC (permalink / raw)
To: help-gnu-emacs
Dear all,
how do I set-up Gnus (and my GNU/Linux operating) to read and send my
emails? Preferably with IMAP but it should also work offline. Everything
I found online was very old, but if you know that some guide still works
today I could give it a try.
My email provider is openmailbox.org and I am using GNU Emacs 26.0.50.2
on Trisquel 7.0 (if this makes any difference).
Many Thanks,
Tim
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Gnus and offline Email
2016-11-12 15:11 Gnus and offline Email Tim Zander
@ 2016-11-12 19:37 ` Eric Abrahamsen
2016-11-14 20:42 ` Tim Zander
2016-11-14 12:28 ` Filipp Gunbin
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Eric Abrahamsen @ 2016-11-12 19:37 UTC (permalink / raw)
To: help-gnu-emacs
Tim Zander <timisch@openmailbox.org> writes:
> Dear all,
>
> how do I set-up Gnus (and my GNU/Linux operating) to read and send my
> emails? Preferably with IMAP but it should also work offline. Everything
> I found online was very old, but if you know that some guide still works
> today I could give it a try.
What most people do in your case is to install a local IMAP server,
usually dovecot, on your local machine. Then use isync or offlineimap to
sync that to the remote server. Gnus only ever talks to the local IMAP
server.
It's a little harder for offline sending. I use msmtp to send mails, and
apparently there is a msmtp-queue package that will let send emails from
Gnus, but queue them up until there's an internet connection to actually
send them.
Otherwise, you just use the Gnus agent, toggle unplugged, send as
usual, and when you're back online, toggle plugged.
HTH,
Eric
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Gnus and offline Email
2016-11-12 15:11 Gnus and offline Email Tim Zander
2016-11-12 19:37 ` Eric Abrahamsen
@ 2016-11-14 12:28 ` Filipp Gunbin
2016-11-14 19:07 ` Eric Abrahamsen
2016-11-15 17:44 ` Jeffrey DeLeo
2016-11-21 10:34 ` Eric S Fraga
3 siblings, 1 reply; 12+ messages in thread
From: Filipp Gunbin @ 2016-11-14 12:28 UTC (permalink / raw)
To: Tim Zander; +Cc: help-gnu-emacs
Hi,
On 12/11/2016 16:11 +0100, Tim Zander wrote:
> Dear all,
>
> how do I set-up Gnus (and my GNU/Linux operating) to read and send my
> emails? Preferably with IMAP but it should also work offline. Everything
> I found online was very old, but if you know that some guide still works
> today I could give it a try.
>
> My email provider is openmailbox.org and I am using GNU Emacs 26.0.50.2
> on Trisquel 7.0 (if this makes any difference).
>
> Many Thanks,
>
> Tim
A less popular, but working way is to download mail via IMAP as you
would do via POP. Like that:
(setq mail-sources '((imap :server "yourserver.com"
:user "you@yourserver.com"
:stream tls)))
(setq gnus-select-method '(nnnil ""))
(setq gnus-secondary-select-methods
'((nnfolder "mailserver"
(nnfolder-directory "~/mailfolder"))))
See also (info "(gnus) Mail Source Specifiers").
File ~/.authinfo.gpg will contain credentials:
`machine yourserver.com login you@yourserver.com password <secret>'.
Variable `nnmail-split-methods' directs client-side splitting.
Filipp
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Gnus and offline Email
2016-11-14 12:28 ` Filipp Gunbin
@ 2016-11-14 19:07 ` Eric Abrahamsen
2016-11-15 10:34 ` Filipp Gunbin
0 siblings, 1 reply; 12+ messages in thread
From: Eric Abrahamsen @ 2016-11-14 19:07 UTC (permalink / raw)
To: help-gnu-emacs
Filipp Gunbin <fgunbin@fastmail.fm> writes:
> Hi,
>
> On 12/11/2016 16:11 +0100, Tim Zander wrote:
>
>> Dear all,
>>
>> how do I set-up Gnus (and my GNU/Linux operating) to read and send my
>> emails? Preferably with IMAP but it should also work offline. Everything
>> I found online was very old, but if you know that some guide still works
>> today I could give it a try.
>>
>> My email provider is openmailbox.org and I am using GNU Emacs 26.0.50.2
>> on Trisquel 7.0 (if this makes any difference).
>>
>> Many Thanks,
>>
>> Tim
>
> A less popular, but working way is to download mail via IMAP as you
> would do via POP. Like that:
>
> (setq mail-sources '((imap :server "yourserver.com"
> :user "you@yourserver.com"
> :stream tls)))
>
> (setq gnus-select-method '(nnnil ""))
>
> (setq gnus-secondary-select-methods
> '((nnfolder "mailserver"
> (nnfolder-directory "~/mailfolder"))))
Interesting. So, for my own information, this basically creates a
one-way sync with your mail server? What happens if, say, you delete a
message locally, then sync again? Will it replace the message, or is it
a "blind" one-way sync?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Gnus and offline Email
2016-11-12 19:37 ` Eric Abrahamsen
@ 2016-11-14 20:42 ` Tim Zander
2016-11-14 21:29 ` Eric Abrahamsen
0 siblings, 1 reply; 12+ messages in thread
From: Tim Zander @ 2016-11-14 20:42 UTC (permalink / raw)
To: help-gnu-emacs
On 12.11.2016 20:37, Eric Abrahamsen wrote:
> Tim Zander <timisch@openmailbox.org> writes:
>> how do I set-up Gnus (and my GNU/Linux operating) to read and send my
>> emails? Preferably with IMAP but it should also work offline. Everything
>> I found online was very old, but if you know that some guide still works
>> today I could give it a try.
>
> What most people do in your case is to install a local IMAP server,
> usually dovecot, on your local machine. Then use isync or offlineimap to
> sync that to the remote server. Gnus only ever talks to the local IMAP
> server.
Great, I had success for this, I followed your guide:
https://ericabrahamsen.net/tech/2014/oct/gnus-dovecot-lucene.html
But I used this in my .gnus file:
(setq gnus-select-method
'(nnimap "OPENMAILBOX"
(nnimap-stream network)
(nnimap-address "localhost")
(nnimap-authenticator login)
(nnimap-user "timisch@openmailbox.org")))
> I use msmtp to send mails, and ..
> there is a msmtp-queue package that will let send emails from
> Gnus, but queue them up until there's an internet connection to ..
> send them.
Is there any guide for that?
> Otherwise, you just use the Gnus agent, toggle unplugged, send as
> usual, and when you're back online, toggle plugged.
Any way of letting Gnus do this automatically?
Many thanks,
Tim
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Gnus and offline Email
2016-11-14 20:42 ` Tim Zander
@ 2016-11-14 21:29 ` Eric Abrahamsen
0 siblings, 0 replies; 12+ messages in thread
From: Eric Abrahamsen @ 2016-11-14 21:29 UTC (permalink / raw)
To: help-gnu-emacs
Tim Zander <timisch@openmailbox.org> writes:
> On 12.11.2016 20:37, Eric Abrahamsen wrote:
>> Tim Zander <timisch@openmailbox.org> writes:
>>> how do I set-up Gnus (and my GNU/Linux operating) to read and send my
>>> emails? Preferably with IMAP but it should also work offline. Everything
>>> I found online was very old, but if you know that some guide still works
>>> today I could give it a try.
>>
>> What most people do in your case is to install a local IMAP server,
>> usually dovecot, on your local machine. Then use isync or offlineimap to
>> sync that to the remote server. Gnus only ever talks to the local IMAP
>> server.
>
> Great, I had success for this, I followed your guide:
>
> https://ericabrahamsen.net/tech/2014/oct/gnus-dovecot-lucene.html
>
> But I used this in my .gnus file:
>
> (setq gnus-select-method
> '(nnimap "OPENMAILBOX"
> (nnimap-stream network)
> (nnimap-address "localhost")
> (nnimap-authenticator login)
> (nnimap-user "timisch@openmailbox.org")))
>
>> I use msmtp to send mails, and ..
>> there is a msmtp-queue package that will let send emails from
>> Gnus, but queue them up until there's an internet connection to ..
>> send them.
>
> Is there any guide for that?
Here's something:
https://github.com/tpn/msmtp/blob/master/scripts/msmtpq/README.msmtpq
I've never used it though!
>> Otherwise, you just use the Gnus agent, toggle unplugged, send as
>> usual, and when you're back online, toggle plugged.
>
> Any way of letting Gnus do this automatically?
Sure, you can add the function `gnus-group-send-queue' to
`gnus-agent-plugged-hook'. Even if you don't do that, it's very easy to
do manually: "J j" to toggle plugged, then "J S" to send the queue.
E
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Gnus and offline Email
2016-11-14 19:07 ` Eric Abrahamsen
@ 2016-11-15 10:34 ` Filipp Gunbin
2016-11-15 17:20 ` Eric Abrahamsen
0 siblings, 1 reply; 12+ messages in thread
From: Filipp Gunbin @ 2016-11-15 10:34 UTC (permalink / raw)
To: Eric Abrahamsen; +Cc: help-gnu-emacs
On 14/11/2016 11:07 -0800, Eric Abrahamsen wrote:
> Filipp Gunbin <fgunbin@fastmail.fm> writes:
>>
>> A less popular, but working way is to download mail via IMAP as you
>> would do via POP. Like that:
>>
>> [...]
>
> Interesting. So, for my own information, this basically creates a
> one-way sync with your mail server? What happens if, say, you delete a
> message locally, then sync again? Will it replace the message, or is it
> a "blind" one-way sync?
It just downloads mail from the server, deleting it there, and puts it
locally according to your select methods settings.
That's not how IMAP is usually used, although I find it useful, because
I try to keep by inbox (local & remote) clean.
Filipp
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Gnus and offline Email
2016-11-15 10:34 ` Filipp Gunbin
@ 2016-11-15 17:20 ` Eric Abrahamsen
0 siblings, 0 replies; 12+ messages in thread
From: Eric Abrahamsen @ 2016-11-15 17:20 UTC (permalink / raw)
To: help-gnu-emacs
Filipp Gunbin <fgunbin@fastmail.fm> writes:
> On 14/11/2016 11:07 -0800, Eric Abrahamsen wrote:
>
>> Filipp Gunbin <fgunbin@fastmail.fm> writes:
>>>
>>> A less popular, but working way is to download mail via IMAP as you
>>> would do via POP. Like that:
>>>
>>> [...]
>>
>> Interesting. So, for my own information, this basically creates a
>> one-way sync with your mail server? What happens if, say, you delete a
>> message locally, then sync again? Will it replace the message, or is it
>> a "blind" one-way sync?
>
> It just downloads mail from the server, deleting it there, and puts it
> locally according to your select methods settings.
>
> That's not how IMAP is usually used, although I find it useful, because
> I try to keep by inbox (local & remote) clean.
Interesting -- thanks for that.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Gnus and offline Email
2016-11-12 15:11 Gnus and offline Email Tim Zander
2016-11-12 19:37 ` Eric Abrahamsen
2016-11-14 12:28 ` Filipp Gunbin
@ 2016-11-15 17:44 ` Jeffrey DeLeo
2016-11-17 13:47 ` Filipp Gunbin
2016-11-21 10:34 ` Eric S Fraga
3 siblings, 1 reply; 12+ messages in thread
From: Jeffrey DeLeo @ 2016-11-15 17:44 UTC (permalink / raw)
To: help-gnu-emacs
After trying many ways, I now use *offlineimap* to sync messages between
my machine and the google server. *Gnus* then reads messages from the
local machine. *Postfix* is used to send messages to the gmail smtp
server. Virtues of this setup: reading/sending email does not involve
waiting for servers while in gnus (fast), can read/send email while
offline (passed to server when online again). If you preferred to use
RMail, you could instead of gnus.
This is what I do on ubuntu.
offlineimap, run periodically puts mail into ~/Maildr/Gmail
contents of ~/.offlineimaprc:
#+BEGIN_SRC
[general]
# List of accounts to be synced, separated by a comma.
accounts = Gmail
maxsyncaccounts = 2
[Account Gmail]
# Identifier for the local repository; e.g. the maildir to be synced via IMAP.
localrepository = Gmail-local
# Identifier for the remote repository; i.e. the actual IMAP, usually non-local.
remoterepository = Gmail-remote
# Status cache. Default is plain, which eventually becomes huge and slow.
status_backend = sqlite
[Repository Gmail-local]
type = Maildir
localfolders = ~/Maildir/Gmail
[Repository Gmail-remote]
type = Gmail
remoteuser = YourName@gmail.com
remotepass = YourPass
folderfilter = lambda foldername: foldername in ['INBOX', 'Dev']
# Necessary as of OfflineIMAP 6.5.4
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
#+END_SRC
gnus reads mail from ~/Maildir/Gmail
In emacs, the variable /gnus-home-directory/ is set to
"~/Documents/gnus". Contents of "~/Documents/gnus/.gnus":
#+BEGIN_SRC emacs-lisp
(setq gnus-select-method
'(nntp "localhost")) ; I also read news in gnus; it is copied to my local machine via *leafnode*
(setq gnus-secondary-select-methods
'((nnmaildir "GMail" (directory "~/Maildir/Gmail")) ; grab mail from here
(nnfolder "archive"
(nnfolder-directory "~/Documents/gnus/Mail/archive") ; where I archive sent email
(nnfolder-active-file "~/Documents/gnus/Mail/archive/active")
(nnfolder-get-new-mail nil)
(nnfolder-inhibit-expiry t))))
#+END_SRC
Sending mail: emacs configuration variables: /mail-user-agent/ is set to
'gnus-user-agent /send-mail-function/ is set to 'sendmail-send-it
/user-mail-address/ is set to "YourName@gmail.com"
Trickiest thing is setting up Postfix, that is clearly described
[[https://easyengine.io/tutorials/linux/ubuntu-postfix-gmail-smtp/][here]]
The program *offlineimap* is controlled by the file
/~/.offlineimaprc/. When offineimap runs, it will keep information in
the directory ~/.offlineimap. You can read the docs for explanation of
how that all works.
Re: sending mail: In fact, I used to send mail directly from emacs. This
involved fiddling with a number of things. It turned out to be much
easier to just let postfix handle it. For example, I use several
different email accounts to send mail from in Gnus; I now let gnus know
about this via posting-styles, and let postfix worry about which address
should go to which server, and how.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Gnus and offline Email
2016-11-15 17:44 ` Jeffrey DeLeo
@ 2016-11-17 13:47 ` Filipp Gunbin
2016-11-17 16:57 ` Jeffrey DeLeo
0 siblings, 1 reply; 12+ messages in thread
From: Filipp Gunbin @ 2016-11-17 13:47 UTC (permalink / raw)
To: Jeffrey DeLeo; +Cc: help-gnu-emacs
On 15/11/2016 09:44 -0800, Jeffrey DeLeo wrote:
> Re: sending mail: In fact, I used to send mail directly from emacs. This
> involved fiddling with a number of things. It turned out to be much
> easier to just let postfix handle it. For example, I use several
> different email accounts to send mail from in Gnus; I now let gnus know
> about this via posting-styles, and let postfix worry about which address
> should go to which server, and how.
Could you please show how you set up whatever points to your target smtp
server in posting styles?
I now write smth like this to separate my private and work accounts:
(setq gnus-posting-styles
'((".*"
(address "fgunbin@fastmail.fm")
("X-Message-SMTP-Method" "smtp mail.messagingengine.com 587"))
("nnfolder\\+mailserver:mail.work"
(address "fgunbin@work.com")
("X-Message-SMTP-Method" "smtp outlook.office365.com 587"))))
When replying, it just works. When writing new message, I have to put
point onto `mail.work' group in *Groups* and use `C-u m' to have *message*
buffer set with the posting style above.
Filipp
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Gnus and offline Email
2016-11-17 13:47 ` Filipp Gunbin
@ 2016-11-17 16:57 ` Jeffrey DeLeo
0 siblings, 0 replies; 12+ messages in thread
From: Jeffrey DeLeo @ 2016-11-17 16:57 UTC (permalink / raw)
To: Filipp Gunbin; +Cc: help-gnu-emacs
Filipp Gunbin <fgunbin@fastmail.fm> writes:
> Could you please show how you set up whatever points to your target
> smtp server in posting styles?
>
> I now write smth like this to separate my private and work accounts:
>
> (setq gnus-posting-styles '((".*" (address "fgunbin@fastmail.fm")
> ("X-Message-SMTP-Method" "smtp mail.messagingengine.com 587"))
> ("nnfolder\\+mailserver:mail.work" (address "fgunbin@work.com")
> ("X-Message-SMTP-Method" "smtp outlook.office365.com 587"))))
>
> When replying, it just works. When writing new message, I have to put
> point onto `mail.work' group in *Groups* and use `C-u m' to have
> *message* buffer set with the posting style above.
>
> Filipp
In my emacs init file, I have:
#+BEGIN_SRC
(setq user-mail-address "mainEmailAddress@someWhere.com")
(setq gnus-ignored-from-addresses (quote ("mainEmailAddress@someWhere.com" "me@specialGroup.org")))
#+END_SRC
which sets my main email address. Associated with a particular Topic in gnus, I have set up
another email address via a posting-style. When I am in that topic, that email address is used.
This is set in .newsrc.eld in gnus-home-directory:
#+BEGIN_SRC
(setq gnus-topic-topology
'(("Gnus" visible nil nil)
(("Mail" visible nil nil)
(("Personal" visible nil nil))
(("Work" visible nil nil))
(("SpecialGroup" visible nil
((posting-style (address "me@specialGroup.org") (organization "SpecialGroup")))))
(("Archive" visible nil nil)
(("2013" invisible nil nil))
(("2014" invisible nil nil))
(("2015" invisible nil nil))
(("Ancient" invisible nil nil))))
(("misc" visible nil nil))
(("Dev" visible nil nil)
(("Python" visible nil nil))
(("Emacs" visible nil nil))
(("News" visible nil nil)))
))
#+END_SRC
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Gnus and offline Email
2016-11-12 15:11 Gnus and offline Email Tim Zander
` (2 preceding siblings ...)
2016-11-15 17:44 ` Jeffrey DeLeo
@ 2016-11-21 10:34 ` Eric S Fraga
3 siblings, 0 replies; 12+ messages in thread
From: Eric S Fraga @ 2016-11-21 10:34 UTC (permalink / raw)
To: help-gnu-emacs
On Saturday, 12 Nov 2016 at 16:11, Tim Zander wrote:
> Dear all,
>
> how do I set-up Gnus (and my GNU/Linux operating) to read and send my
> emails? Preferably with IMAP but it should also work offline. Everything
> I found online was very old, but if you know that some guide still works
> today I could give it a try.
I use the gnus agent and it works very well. Fetch news/email when
connected, read using gnus-unplugged and write emails as you wish. The
emails you have written will be sent when you next connect or with "J S".
--
Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D)
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2016-11-21 10:34 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-12 15:11 Gnus and offline Email Tim Zander
2016-11-12 19:37 ` Eric Abrahamsen
2016-11-14 20:42 ` Tim Zander
2016-11-14 21:29 ` Eric Abrahamsen
2016-11-14 12:28 ` Filipp Gunbin
2016-11-14 19:07 ` Eric Abrahamsen
2016-11-15 10:34 ` Filipp Gunbin
2016-11-15 17:20 ` Eric Abrahamsen
2016-11-15 17:44 ` Jeffrey DeLeo
2016-11-17 13:47 ` Filipp Gunbin
2016-11-17 16:57 ` Jeffrey DeLeo
2016-11-21 10:34 ` Eric S Fraga
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 read-only IMAP folder(s) and NNTP newsgroup(s).