From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jeffrey DeLeo Newsgroups: gmane.emacs.help Subject: Re: Gnus and offline Email Date: Tue, 15 Nov 2016 09:44:19 -0800 Message-ID: <87y40k63kc.fsf@gmail.com> References: <58273138.4070808@openmailbox.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1479232989 15972 195.159.176.226 (15 Nov 2016 18:03:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 15 Nov 2016 18:03:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 15 19:03:04 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6i4A-0001VI-Lb for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Nov 2016 19:02:42 +0100 Original-Received: from localhost ([::1]:47945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6i4D-0001wp-W2 for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Nov 2016 13:02:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6hqR-0006qy-E6 for help-gnu-emacs@gnu.org; Tue, 15 Nov 2016 12:48:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6hqO-0003R6-9t for help-gnu-emacs@gnu.org; Tue, 15 Nov 2016 12:48:31 -0500 Original-Received: from [195.159.176.226] (port=34856 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c6hqO-0003QV-2k for help-gnu-emacs@gnu.org; Tue, 15 Nov 2016 12:48:28 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1c6hpa-0006Hk-Gi for help-gnu-emacs@gnu.org; Tue, 15 Nov 2016 18:47:38 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 191 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:CJmJVvNcba63eZqjb9xBtYvPgDI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-Mailman-Approved-At: Tue, 15 Nov 2016 13:01:51 -0500 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111734 Archived-At: 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.