Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Agent in batch mode for imap
@ 2013-01-04  9:08 Julien Cubizolles
  2013-01-04 14:41 ` Julien Cubizolles
  2013-01-04 17:35 ` William Gardella
  0 siblings, 2 replies; 7+ messages in thread
From: Julien Cubizolles @ 2013-01-04  9:08 UTC (permalink / raw)
  To: info-gnus-english

I'm thinking of using the following setup, so that emacs isn't stuck
while gnus checks for new mail.

start gnus in unplugged mode
have a cron job run 

--8<---------------cut here---------------start------------->8---
emacs -batch -l ~/.emacs -l ~/.gnus.el -f gnus-agent-batch >/dev/null 2>&1
--8<---------------cut here---------------end--------------->8---

Will a line like
--8<---------------cut here---------------start------------->8---
(gnus-demon-add-handler 'gnus-group-get-new-news 10 nil)
--8<---------------cut here---------------end--------------->8---
refresh the group buffer ?

I'm not sure about how moving and deleting messages from an imap server
with this setup. These aren't operations you can make while
unplugged and I will certainly have to plug the agent from time to
time. Won't there be a conflict between the moving/copying operations
and the fetch from the agent in batch mode ?

How are you using gnus-agent-batch with imap ?




_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

* Re: Agent in batch mode for imap
  2013-01-04  9:08 Agent in batch mode for imap Julien Cubizolles
@ 2013-01-04 14:41 ` Julien Cubizolles
  2013-01-04 17:12   ` William Gardella
  2013-01-04 17:49   ` William Gardella
  2013-01-04 17:35 ` William Gardella
  1 sibling, 2 replies; 7+ messages in thread
From: Julien Cubizolles @ 2013-01-04 14:41 UTC (permalink / raw)
  To: info-gnus-english

Julien Cubizolles <j.cubizolles@free.fr> writes:


> start gnus in unplugged mode
> have a cron job run 
>
> emacs -batch -l ~/.emacs -l ~/.gnus.el -f gnus-agent-batch >/dev/null 2>&1

A previous problem of mine comes in full force when using this setup :
every unread mail gets a *new* duplicate in the nnimap summary buffer
every time the agent fetchs. With gnus-agent-batch running every 15
minutes, I had 8 copies of each unread message appearing in 2
hours... Plugging the agent and running M-g removes all those duplicates
but gnus-agent-batch can't really be a solution as long as this problem
remains.

Here are the methods definitions in .gnus.el

--8<---------------cut here---------------start------------->8---
(setq gnus-select-method 
	'(nnml "local"))

(setq gnus-secondary-select-methods
      '(
	(nnimap "gmail"
                (nnimap-address "imap.gmail.com")
                (nnimap-stream ssl)
		(nnir-search-engine imap))
	(nnimap "free"
		(nnimap-address "imap.free.fr")
		(nnimap-unsplittable-articles (%Deleted %Seen))
		(nnir-search-engine imap)
		(nnimap-split-methods default)
		(nnimap-inbox "INBOX")
		)
	(nntp "news.free.fr")
	(nntp "news.gwene.org"
	      (nnir-search-engine gmane))
	(nntp "news.gmane.org"
	      (nnir-search-engine gmane))
	)
)
--8<---------------cut here---------------end--------------->8---

Could anyone happy with gnus-agent-batch with an imap server post his
configuration ?

Julien.


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

* Re: Agent in batch mode for imap
  2013-01-04 14:41 ` Julien Cubizolles
@ 2013-01-04 17:12   ` William Gardella
  2013-01-04 17:49   ` William Gardella
  1 sibling, 0 replies; 7+ messages in thread
From: William Gardella @ 2013-01-04 17:12 UTC (permalink / raw)
  To: info-gnus-english-mXXj517/zsQ

Julien Cubizolles <j.cubizolles@free.fr> writes:

> Could anyone happy with gnus-agent-batch with an imap server post his
> configuration ?
>
> Julien.

Julien, 

I believe you also asked about my config for using gnus-agent-batch as a
cron job on the GNU Emacs help mailing list (or the gnu.emacs.help
newsgroup, as the case may be), so here it is.  I use  `GNU Emacs 24.2.1
(i486-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-09-09 on biber,
modified by Debian' and `Gnus v5.13', and I haven't experienced the
phantom duplicate messages phenomenon yet.

Other probably irrelevant details:

I am running a persistent Debian Live system based on Debian Sid and
Grml ( http://grml.org/ ).

I use an Org Babel-based modular init setup, so instead of having a
.gnus.el, I have ~/org/init-gnus.org, of which the tangled contents
(init-gnus.el) are set out below.

Perhaps it is relevant that I no longer use the Gnus demon to get
informed immediately after the cron job does its thing, but I don't
recall seeing the issue you describe when I did.

-WGG

My crontab contains:

*/12 * * * * $HOME/bin/mail

The `mail' shell script is:

#!/bin/sh
PATH=/usr/bin:/bin

if [ -f /tmp/.$USER-gnusflag ];
	then exit 0;
fi
touch /tmp/.$USER-gnusflag
emacs -batch -l "$HOME/org/init-gnus.el" -f gnus-agent-batch >> /dev/null 2>&1
rm -f /tmp/.$USER-gnusflag

My Gnus config is as follows:

(setq gnus-select-method
      '(nntp "news.gmane.org"
             (nntp-open-connection-function nntp-open-tls-stream)
             (nntp-port-number 563)
             (nntp-address "news.gmane.org"))
      gnus-secondary-select-methods
      '((nnimap "imap.pitt.edu"
                (nnimap-server-port 993)
                (nnimap-stream ssl)
                (nnir-search-engine imap))
        (nnimap "imap.gmail.com"
                (nnimap-server-port 993)
                (nnimap-stream ssl)
                (nnir-search-engine imap)))
      message-send-mail-function 'message-send-mail-with-sendmail
      message-sendmail-envelope-from 'header
      message-sendmail-f-is-evil nil
      sendmail-program "~/bin/msmtp-stub"
      user-mail-address "gardellawg@gmail.com"
      user-full-name "William Gardella"
      message-alternative-emails "pitt.edu"
      gnus-posting-styles
      '(("pitt.edu"
         (address "wgg2@pitt.edu")
         (organization "University of Pittsburgh School of Law"))
        ("gmane.*"
         (X-Archive "encrypt"))) 
      tls-checktrust 'ask
      tls-program '("gnutls-cli --x509cafile /etc/ssl/certs/ca-certificates.crt -p %p %h"
                    "gnutls-cli --x509cafile /etc/ssl/certs/ca-certificates.crt -p %p %h --protocols ssl3"
                    "openssl s_client -connect %h:%p -CAfile /etc/ssl/certs/ca-certificates.crt -no_ssl2 -ign_eof")
      gnus-agent-synchronize-flags t
      gnus-agent-queue-mail 'always
      gnus-agent-prompt-send-queue t
      gnus-asynchronous t
      gnus-agent-go-online t
      mm-text-html-renderer 'gnus-w3m
      gnus-summary-line-format
      (concat
       "%0{%U%R%z%}"
       "%4{%-20,20f%}" ;; name
       "  "
       "%3{│%}" "%1{%-20,25D%}" "%3{│%}" ;; date
       "  "
       "%1{%B%}"
       "%s\n")
      gnus-summary-display-arrow t
      gnus-completing-read-function 'gnus-ido-completing-read
      mail-user-agent 'gnus-user-agent
      read-mail-command 'gnus
      gnus-treat-display-smileys nil)
(autoload 'sendmail-send-it "sendmail")

-- 
I use grml (http://grml.org/)


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

* Re: Agent in batch mode for imap
  2013-01-04  9:08 Agent in batch mode for imap Julien Cubizolles
  2013-01-04 14:41 ` Julien Cubizolles
@ 2013-01-04 17:35 ` William Gardella
  1 sibling, 0 replies; 7+ messages in thread
From: William Gardella @ 2013-01-04 17:35 UTC (permalink / raw)
  To: info-gnus-english-mXXj517/zsQ

Julien Cubizolles <j.cubizolles@free.fr> writes:

> I'm not sure about how moving and deleting messages from an imap server
> with this setup. These aren't operations you can make while
> unplugged and I will certainly have to plug the agent from time to
> time. Won't there be a conflict between the moving/copying operations
> and the fetch from the agent in batch mode ?

None that I've noticed; maybe "conflict" in the sense that
gnus-agent-batch will simply be blithely unaware of the move/delete
operation, if you managed to time it to happen at exactly the same time
as the cron job executes.  In that case it just doesn't reflect the
changes until the next sync.  Similarly, if you use Gcc to an nnimap
group, or your mail provider automatically puts things in a Sent folder
when you use SMTP, you won't see your sent messages show up there until
the *next* gnus-agent-batch run after they're sent.  This is because
gnus-agent-batch sends the queue after it fetches articles.


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

* Re: Agent in batch mode for imap
  2013-01-04 14:41 ` Julien Cubizolles
  2013-01-04 17:12   ` William Gardella
@ 2013-01-04 17:49   ` William Gardella
  2013-01-14  9:55     ` Julien Cubizolles
  1 sibling, 1 reply; 7+ messages in thread
From: William Gardella @ 2013-01-04 17:49 UTC (permalink / raw)
  To: info-gnus-english-mXXj517/zsQ

Julien Cubizolles <j.cubizolles@free.fr> writes:
>
>> Could anyone happy with gnus-agent-batch with an imap server post his
>> configuration ?
>>
>> Julien.

Julien, 

I believe you also asked about my config for using gnus-agent-batch as a
cron job on the GNU Emacs help mailing list (or the gnu.emacs.help
newsgroup, as the case may be), so here it is.  I use  `GNU Emacs 24.2.1
(i486-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-09-09 on biber,
modified by Debian' and `Gnus v5.13', and I haven't experienced the
phantom duplicate messages phenomenon yet.

Other probably irrelevant details:

- I am running a persistent Debian Live system based on Debian Sid and
  Grml ( http://grml.org/ ).

- I use an Org Babel-based modular init setup, so instead of having a
  .gnus.el, I have ~/org/init-gnus.org, of which the tangled contents
  (init-gnus.el) are set out below.

Perhaps it is relevant that I no longer use the Gnus demon to get
informed immediately after the cron job does its thing, but I don't
recall seeing the issue you describe when I did.

-WGG

My crontab contains:

*/12 * * * * $HOME/bin/mail

The `mail' shell script is:

#!/bin/sh
PATH=/usr/bin:/bin

if [ -f /tmp/.$USER-gnusflag ];
	then exit 0;
fi
touch /tmp/.$USER-gnusflag
emacs -batch -l "$HOME/org/init-gnus.el" -f gnus-agent-batch >> /dev/null 2>&1
rm -f /tmp/.$USER-gnusflag

My Gnus config is as follows:

(setq gnus-select-method
      '(nntp "news.gmane.org"
             (nntp-open-connection-function nntp-open-tls-stream)
             (nntp-port-number 563)
             (nntp-address "news.gmane.org"))
      gnus-secondary-select-methods
      '((nnimap "imap.pitt.edu"
                (nnimap-server-port 993)
                (nnimap-stream ssl)
                (nnir-search-engine imap))
        (nnimap "imap.gmail.com"
                (nnimap-server-port 993)
                (nnimap-stream ssl)
                (nnir-search-engine imap)))
      message-send-mail-function 'message-send-mail-with-sendmail
      message-sendmail-envelope-from 'header
      message-sendmail-f-is-evil nil
      sendmail-program "~/bin/msmtp-stub"
      user-mail-address "gardellawg@gmail.com"
      user-full-name "William Gardella"
      message-alternative-emails "pitt.edu"
      gnus-posting-styles
      '(("pitt.edu"
         (address "wgg2@pitt.edu")
         (organization "University of Pittsburgh School of Law"))
        ("gmane.*"
         (X-Archive "encrypt"))) 
      tls-checktrust 'ask
      gnus-agent-synchronize-flags t
      gnus-agent-queue-mail 'always
      gnus-agent-prompt-send-queue t
      gnus-asynchronous t
      gnus-agent-go-online t
      mm-text-html-renderer 'gnus-w3m
      gnus-summary-line-format
      (concat
       "%0{%U%R%z%}"
       "%4{%-20,20f%}" ;; name
       "  "
       "%3{│%}" "%1{%-20,25D%}" "%3{│%}" ;; date
       "  "
       "%1{%B%}"
       "%s\n")
      gnus-summary-display-arrow t
      gnus-completing-read-function 'gnus-ido-completing-read
      mail-user-agent 'gnus-user-agent
      read-mail-command 'gnus
      gnus-treat-display-smileys nil)
(autoload 'sendmail-send-it "sendmail")


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

* Re: Agent in batch mode for imap
  2013-01-04 17:49   ` William Gardella
@ 2013-01-14  9:55     ` Julien Cubizolles
  2013-01-14 16:09       ` William Gardella
  0 siblings, 1 reply; 7+ messages in thread
From: Julien Cubizolles @ 2013-01-14  9:55 UTC (permalink / raw)
  To: info-gnus-english

William Gardella <gardellawg@gmail.com>
writes:

> I believe you also asked about my config for using gnus-agent-batch as a
> cron job on the GNU Emacs help mailing list (or the gnu.emacs.help
> newsgroup, as the case may be), so here it is.

Thanks a lot. I tried merging the very few differences between your conf
and mine but it didn't solve the problem. However I've finally been able
to identify the problem with mine : I was splitting the messages on this
imap account. So, in a nutshell :

- imap + gnus-agent : works fine

- imap with splitting + gnus-agent : every unread mail on the server
  gets a duplicate in the Summary buffer every time the agent fetchs
  when gnus runs unplugged. This duplicate disappears with C-g in the
  Summary buffer when running gnus plugged.


Is there a reason why splitting shouldn't be used when agent fetching ?
Are some of you successfully using the agent in this manner ?

Here are the relevant parts of my .gnus.el.

--8<---------------cut here---------------start------------->8---
(setq gnus-secondary-select-methods
      '(
	(nnimap "free"
		(nnimap-address "imap.free.fr")
		(nnir-search-engine imap)
		(nnimap-inbox "INBOX")
              )
	)
)

(setq gnus-agent-synchronize-flags t
      gnus-agent-queue-mail 'always
      gnus-agent-prompt-send-queue t
      gnus-asynchronous t
      gnus-agent-go-online t)


(setq nnmail-split-methods 'nnmail-split-fancy)
(setq nnmail-split-fancy 
      '(|
	(: gnus-registry-split-fancy-with-parent)
;;      some splitting rules...	
	(: spam-split 'spam-use-bogofilter)
	;; all the rest
	"INBOX"
	))
--8<---------------cut here---------------end--------------->8---



_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

* Re: Agent in batch mode for imap
  2013-01-14  9:55     ` Julien Cubizolles
@ 2013-01-14 16:09       ` William Gardella
  0 siblings, 0 replies; 7+ messages in thread
From: William Gardella @ 2013-01-14 16:09 UTC (permalink / raw)
  To: info-gnus-english-mXXj517/zsQ

Julien Cubizolles <j.cubizolles@free.fr> writes:

> William Gardella <gardellawg@gmail.com>
> writes:
>
>> I believe you also asked about my config for using gnus-agent-batch as a
>> cron job on the GNU Emacs help mailing list (or the gnu.emacs.help
>> newsgroup, as the case may be), so here it is.
>
> Thanks a lot. I tried merging the very few differences between your conf
> and mine but it didn't solve the problem. However I've finally been able
> to identify the problem with mine : I was splitting the messages on this
> imap account. So, in a nutshell :
>
> - imap + gnus-agent : works fine
>
> - imap with splitting + gnus-agent : every unread mail on the server
>   gets a duplicate in the Summary buffer every time the agent fetchs
>   when gnus runs unplugged. This duplicate disappears with C-g in the
>   Summary buffer when running gnus plugged.
>
>
> Is there a reason why splitting shouldn't be used when agent fetching ?
> Are some of you successfully using the agent in this manner ?

My understanding is that `nnmail-split-methods' which you're using in
your config is only for the `nnmail' backend, which (confusingly
enough), can use IMAP as a source of mail.  But if you are using IMAP,
you want to look instead at (info "(gnus) Client-Side IMAP Splitting").
Other than that I see no reason why the agent shouldn't work.

-WGG


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

end of thread, other threads:[~2013-01-14 16:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-04  9:08 Agent in batch mode for imap Julien Cubizolles
2013-01-04 14:41 ` Julien Cubizolles
2013-01-04 17:12   ` William Gardella
2013-01-04 17:49   ` William Gardella
2013-01-14  9:55     ` Julien Cubizolles
2013-01-14 16:09       ` William Gardella
2013-01-04 17:35 ` William Gardella

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).