gnu.mail.providers.nntp newsrc

151 views Asked by At

Referencing the API docs for gnu.mail.providers.nntp, I'm trying to generate a list of folders on localhost nntp where I run leafnode.

However, it seems that ${user.home}/.newsrc isn't loading correctly because I'm getting a zero length array with:

store = session.getStore(new URLName(props.getProperty("nntp.host")));
store.connect();
root = store.getDefaultFolder();
Folder[] f = root.list();
LOG.warning("folders array " + f.length);

How can I debug whether the newsrc is loading correctly for the store?

properties file:

mail.smtp.auth=true
mail.smtp.host=smtp.gmail.com
mail.smtp.port=589
mail.smtp.auth=true
mail.imap.host=imap.gmail.com
mail.imap.port=993
mail.imap.connectiontimeout=5000
mail.imap.timeout=5000
[email protected]
nntp.group=gwene.com.economist
nntp.host=nntp://localhost/
mail.nntp.newsrc.file=/home/thufir/.newsrc
jdbc.user=java
jdbc.password=password
jdbc.url=jdbc:mysql://localhost:3306/nntp?autoReconnect=true
jdbc.jndiName=jdbc:mysql://localhost:3306/nntp?autoReconnect=true

Incidentally, the connection to the store is fine for the group specified in the properties file.

setting debug to true gives:

May 05, 2012 2:22:33 AM net.bounceme.dur.nntp.model.PropertiesReader getProps
INFO: NNTP.loadMessages...
DEBUG: nntp: newsrc loading /home/thufir/.newsrc
DEBUG: nntp: newsrc load: 0 groups in 1ms
May 05, 2012 2:22:35 AM net.bounceme.dur.nntp.controller.Usenet connect
WARNING: folders array 0
May 05, 2012 2:22:35 AM net.bounceme.dur.nntp.controller.Usenet loadFoldersList
WARNING: folders 0
May 05, 2012 2:22:35 AM net.bounceme.dur.nntp.controller.MessagesEnum <init>
INFO: starting controller..

So it looks like the newsrc is loading, but has 0 groups. Yet the newsrc in question is like so:

thufir@dur:~$ 
thufir@dur:~$ cat .newsrc
gwene.com.economist 1-1000000
thufir@dur:~$ 
1

There are 1 answers

0
Thufir On BEST ANSWER

Malformed newsrc, fixed to:

thufir@dur:~$ 
thufir@dur:~$ cat .newsrc
gwene.com.economist: 1-100
thufir@dur:~$ 

works fine.