From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/81750 Path: news.gmane.org!not-for-mail From: Binjo Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus fetching same mails again and again (pop) Date: Fri, 13 Apr 2012 12:17:30 +0800 Organization: Wh0 CaR3s Message-ID: <8zty0o8dut.fsf@gmail.com> References: <87mx6hl0fo.fsf@live.com> <871untb4n5.fsf@eps142.cdf.udc.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1334292463 29295 80.91.229.3 (13 Apr 2012 04:47:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 13 Apr 2012 04:47:43 +0000 (UTC) Cc: Yagnesh Raghava Yakkala To: ding@gnus.org Original-X-From: ding-owner+M30028@lists.math.uh.edu Fri Apr 13 06:47:42 2012 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SIYQ9-0005N8-04 for ding-account@gmane.org; Fri, 13 Apr 2012 06:47:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1SIYPP-000524-DO; Thu, 12 Apr 2012 23:46:55 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1SIXxB-0004uf-0Z for ding@lists.math.uh.edu; Thu, 12 Apr 2012 23:17:45 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1SIXx9-000237-ME for ding@lists.math.uh.edu; Thu, 12 Apr 2012 23:17:44 -0500 Original-Received: from mail-ob0-f172.google.com ([209.85.214.172]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1SIXx8-00010L-2n for ding@gnus.org; Fri, 13 Apr 2012 06:17:42 +0200 Original-Received: by obbtb4 with SMTP id tb4so5355653obb.17 for ; Thu, 12 Apr 2012 21:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=LRmR0wluZLhOFNQk+c0+Ys8CnGtlUkFLRobOSySp6X0=; b=dFlEyhAlWM7rDN29O0QXr6qZ9kId/UCgfRXymJehYQj88vEk9a+ZFlWx18ToIybZUr AeLzMDdEFoaIi6vV++75xfLalQhMwqdLXSwI039N1K33hn3oWlHbZhhyO5zg0FK+A0Ig WZFXr7B4/EqSFXG9OaS2HAMuDTCfT0GVtv1qlEZuANJaBjVwcvzjbtPsYmOUktbsSHjZ ACHcUKPWE36AYnqxjoYB9yw8qLgtJctBOqz4W9C4BJ3kuuwYkw7qinZ3CQGWTZ5YhwqG vNvKE4mqFXOCM8iv0hBnqMC3NgSjcD9DD/T3uTa5F34wKGPd0+ovQmB4JOB8KGBAmuzw fIcg== Original-Received: by 10.60.20.3 with SMTP id j3mr208092oee.43.1334290655687; Thu, 12 Apr 2012 21:17:35 -0700 (PDT) Original-Received: from unknown ([58.101.165.70]) by mx.google.com with ESMTPS id o6sm7537443oec.11.2012.04.12.21.17.32 (version=SSLv3 cipher=OTHER); Thu, 12 Apr 2012 21:17:34 -0700 (PDT) In-Reply-To: (Yagnesh Raghava Yakkala's message of "Fri, 13 Apr 2012 03:14:16 +0900") User-Agent: Emacs Gnus X-Spam-Score: -3.0 (---) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:81750 Archived-At: On 04/13/2012, at 02:14, Yagnesh Raghava Yakkala wrote: [...] > >Unfortunately no. Only pop interface. Thunderbird can keep mails on server, is >not it possible with gnus.? > IIRC, the `pop3-movemail' retrieves the mail from the 1 to the last mail on the server, that's why get same mails over and over again. There's no options for Gnus to get from the latest mail, only if totally rewrite the `pop3-movemail'. ;) I once wrote a workaround, which calculate local mails' count, and compare with the server's, and start retrieving from the latest one. It still may mess up, if delete/copy local mail though. :( HTH, --8<---------------cut here---------------start------------->8--- ;;; fuck pop3-movemail ;;; FIXME or get the latest index from "~/Mail/active" ?? (defun binjo-pop3-latest-index (dir-name) "Get latest index to be fetched from DIR-NAME." (let ((n 1) file-name) (mapc (lambda (sub-dir-name) (unless (or (string= "." sub-dir-name) (string= ".." sub-dir-name)) (setq file-name (concat dir-name sub-dir-name "/.overview")) (if (file-exists-p file-name) (with-temp-buffer (insert-file-literally file-name) (goto-char (point-max)) (forward-line -1) (setq n (+ n (string-to-number (car (split-string (thing-at-point 'line)))))))))) (directory-files dir-name)) n)) ;; TODO stick to the latest pop3-movemail, 20101015 (eval-after-load "pop3" '(defun pop3-movemail (&optional crashbox) "Transfer contents of a maildrop to the specified CRASHBOX. A dirty hack to let `pop3-movemail' fetch newest mail if '.overview' exists." (or crashbox (setq crashbox (expand-file-name "~/.crashbox"))) (let* ((process (pop3-open-server pop3-mailhost pop3-port)) (crashbuf (get-buffer-create " *pop3-retr*")) (n 1) message-count (pop3-password pop3-password)) (if (file-exists-p "~/Mail/mail/") (setq n (binjo-pop3-latest-index "~/Mail/mail/"))) ;; for debugging only (if pop3-debug (switch-to-buffer (process-buffer process))) ;; query for password (if (and pop3-password-required (not pop3-password)) (setq pop3-password (read-passwd (format "Password for %s: " pop3-maildrop)))) (cond ((equal 'apop pop3-authentication-scheme) (pop3-apop process pop3-maildrop)) ((equal 'pass pop3-authentication-scheme) (pop3-user process pop3-maildrop) (pop3-pass process)) (t (error "Invalid POP3 authentication scheme"))) (setq message-count (car (pop3-stat process))) (unwind-protect (while (<= n message-count) (message "Retrieving message %d of %d from %s..." n message-count pop3-mailhost) (pop3-retr process n crashbuf) (save-excursion (set-buffer crashbuf) (let ((coding-system-for-write 'binary)) (write-region (point-min) (point-max) crashbox t 'nomesg)) (set-buffer (process-buffer process)) (while (> (buffer-size) 5000) (goto-char (point-min)) (forward-line 50) (delete-region (point-min) (point)))) (unless pop3-leave-mail-on-server (pop3-dele process n)) (setq n (+ 1 n)) (pop3-accept-process-output process)) (when (and pop3-leave-mail-on-server (> n 1)) ;; (message "pop3.el doesn't support UIDL. Setting `pop3-leave-mail-on-server' ;; to %s might not give the result you'd expect." pop3-leave-mail-on-server) (sit-for 1)) (pop3-quit process)) (kill-buffer crashbuf)) t) ) --8<---------------cut here---------------end--------------->8---