Configuring LeafNode on OSX
Getting LeafNode to work on OSX is a bit of a pain, messing with that today I found that little exists in terms of documentation on how to make this happen. The real problem isn’t specifically with the base install of LeafNode, but getting it configured is where the problem is at:
Installing Leafnode:
port install leafnode
Once leafnode is installed, you have a few commands that you can use at this point:
fetchnews – This will be used to get the listing of groups, which once read, will start pulling the actual documents themselves
leafnode – This can be run a few different ways, but with the macports option it’s really not a bad idea to run this through launchctl (assuming you’re on a later version of OSX).
Once it’s installed, your configuration file that you’ll need to edit is in /opt/local/etc/leafnode/config. Most of the stuff in the config.example will help in configuring leafnode. The important elements that should be edited are:
server – The server name itself
username – Obvious
password – Again, obvious
expire – I personally wanted everything that a newsgroup had, and to continue to fetch as much as possible since I want to be able to search off archived messages. I set this really high, I’d recommend the same.
hostname – This can be configured from your newsreader, but I added this as something if I forgot to configure it correctly.
maxfetch – Similar to expire, just sets the max number of initial articles to fetch. I set this insanely high as well.
The plists for launchctl are located in /opt/local/etc/LaunchDaemons/org.macports.leafnode
One way to load this right away is:
sudo launchctl load /opt/local/etc/LaunchDaemons/org.macports.leafnode/org.macports.leafnode.plist
I’ve also created a symlink from the above location to /Library/LaunchDaemons
cd /Library/LaunchDaemons
ln -s /opt/local/etc/LaunchDaemons/org.macports.leafnode/org.macports.leafnode.plist .
At this point, you can use emacs to connect to your server. Much of the stuff left is to configure your emacs variables. Some example stuff I use is:
;; GNUS Setup
(setq user-mail-address “youremail@domain”)
(setq user-full-name “Your Name”)
(setq gnus-select-method ‘(nntp “localhost”
(nntp-address “127.0.0.1″)
(nntp-authinfo-file “~/.authinfo”)
(nntp-port-number 119)))
(setq gnus-summary-make-false-root ‘dummy)
(setq gnus-build-sparse-threads ’some)
(setq gnus-fetch-old-headers ’some)
(setq gnus-posting-styles
‘((“.“
(signature-file “~/.signature”)
(x-url “http://www.thedarktrumpet.com/”)
(organization “The Dark Trumpet”))))
I do have a ~/.authinfo file, but the contents aren’t that important for leafnode.
In your news reader, or in GNUS, you can get the full newsgroup listing after running the initial fetchnews. Subscribe and view each newsgroup you want, then rerun the fetchmail again after. I use:
“fetchmail -v -n” to accomplish this.
The last thing that really needs to be done is setting up your crontab. I used the root crontab to do this, using “crontab -e” as root, then I have the following line:
/60 /opt/local/sbin/fetchnews -v -n