Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 96B94431FBC for ; Sun, 22 Nov 2009 09:02:09 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eh7GtbIG1Oyf for ; Sun, 22 Nov 2009 09:02:08 -0800 (PST) Received: from mail-bw0-f224.google.com (mail-bw0-f224.google.com [209.85.218.224]) by olra.theworths.org (Postfix) with ESMTP id 40D7A431FAE for ; Sun, 22 Nov 2009 09:02:08 -0800 (PST) Received: by bwz24 with SMTP id 24so3408774bwz.30 for ; Sun, 22 Nov 2009 09:02:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :in-reply-to:references:date:message-id:mime-version:content-type; bh=fq6XDslB1+EEgwws+FgT3WkYKMFix3Ym/uTZIbV3ClM=; b=L2F577h1iaZ7dXAOuMWHRGnBIG1sFPVBmkjc8qLf9H1yRvMkzJwyQZLNRCmi8Ro2Nm v76Lf4yA/GxYTundejw2VMVfMNbMqTJ3kkDzLJi2oj92hntOzklGAQi19SQG7DVkHD0n KisdMXTYFy1VhV30DdlwtwihY7P//GFIdyu4w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; b=pNWLI8DIbMQI9GRKjCn/Xe4o9LMhN5lNrrsWcPI/T/jVzlqsS8+tR8TiaXUfsmLoKR OU/mlKKhP8v39e7dj8mXMhH0SxZo+4/91qFV8Xvq7XQa5m0kfz49a4g3M1q3Y8fqz2LI P+tIBzqbMmqBGb4bIXErXnTUGEahMV/PW3lRE= Received: by 10.204.175.20 with SMTP id v20mr3590876bkz.213.1258909327484; Sun, 22 Nov 2009 09:02:07 -0800 (PST) Received: from kunyang (vawpc43.ethz.ch [129.132.59.11]) by mx.google.com with ESMTPS id 13sm4521642fks.45.2009.11.22.09.02.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 22 Nov 2009 09:02:06 -0800 (PST) Sender: Jed Brown From: Jed Brown To: Brett Viren , Jjgod Jiang In-Reply-To: <46263c600911220641m4d6de6d9u190d41c3feb87bc7@mail.gmail.com> References: <46263c600911220641m4d6de6d9u190d41c3feb87bc7@mail.gmail.com> Date: Sun, 22 Nov 2009 18:02:36 +0100 Message-ID: <87zl6ev6fn.fsf@kunyang.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: notmuch@notmuchmail.org Subject: Re: [notmuch] Guide for new users? X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 17:02:09 -0000 On Sun, 22 Nov 2009 09:41:16 -0500, Brett Viren wrote: > On Sat, Nov 21, 2009 at 11:44 PM, Jjgod Jiang wrote: > > > 1. What's the most efficient way to sync mails from my gmail > > account to a local Maildir? I've tried offlineimap but it > > keeps crashing python (!) on my system (python 2.6, Mac OS X > > 10.6.2). > > OfflineIMAP would have been my suggestion. Yes, however it will change flags which changes file names and currently confuses notmuch. I synced [Gmail].All Mail with OfflineIMAP and am now using Getmail to pull via POP. In the Gmail settings, activate POP starting at the current time. I'll switch back to OfflineIMAP when notmuch is happy with changing file names. The following should save notmuch + Gmail users some time. ~/.getmail/gmail: [retriever] # Getmail can also do IMAP # type = SimpleIMAPSSLRetriever # server = imap.gmail.com type = SimplePOP3SSLRetriever server = pop.gmail.com username = yourname@gmail.com password = Pa55W0rd # Use this with IMAP to only download one copy of each message # mailboxes = ('[Gmail]/All Mail',) [destination] type = Maildir path = ~/.mail-archive/gmail/pop/ [options] # print messages about each action (verbose = 2) # Other options: # 0 prints only warnings and errors # 1 prints messages about retrieving and deleting messages only verbose = 2 message_log = ~/.getmail/gmail.log With getmail, put something like this in your crontab (checks every 2 minutes) # MIN HOUR DAY MONTH DAYOFWEEK COMMAND */2 * * * * getmail -r gmail && notmuch new ~/.offlineimaprc: [general] accounts = GMail maxsyncaccounts = 1 ui = Noninteractive.Basic [Account GMail] localrepository = Local remoterepository = Remote autorefresh = 1 quick = 10 postsynchook = notmuch new [Repository Local] type = Maildir localfolders = /home/jed/.mail-archive/gmail/imap [Repository Remote] type = Gmail folderfilter = lambda foldername: foldername in ['[Gmail]/All Mail'] remotehost = imap.gmail.com remoteuser = yourname@gmail.com remotepass = Pa55W0rd ssl = yes maxconnections = 2 #Setting realdelete = yes will Really Delete email from the server. #Otherwise "deleting" a message will just remove any labels and #retain the message in the All Mail folder. realdelete = no Note that with IMAP, your messages in '[Gmail]/All Mail' will be delivered to a path with spaces which notmuch handles fine, but you will need a patch <1258771074-25997-1-git-send-email-jed@59A2.org> for start-process-shell-command, e.g. to apply patches from within emacs via | git am * Sending messages To send messages from Emacs via Gmail, put something like this in your ~/.emacs (setq smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)) ; Must be set BEFORE loading smtpmail smtpmail-auth-credentials (expand-file-name "~/.authinfo") smtpmail-default-smtp-server "smtp.gmail.com" smtpmail-smtp-server "smtp.gmail.com" smtpmail-smtp-service 587 smtpmail-debug-info t ; change to nil once it works smtpmail-debug-verb t) (require 'smtpmail) (setq message-send-mail-function 'smtpmail-send-it) (require 'starttls) you can inline authentication, but especially if you keep ~/.emacs under version control, you should put it separately (chmod 600). ~/.authinfo: machine smtp.gmail.com login yourname@gmail.com password Pa55W0rd port 587 * Git Git + Gmail users can use git send-email by putting this in your .gitconfig [sendemail] smtpserver = smtp.gmail.com smtpserverport = 587 smtpencryption = tls smtpuser = yourname@gmail.com smtppass = Pa55W0rd I hope this helps. Jed