Alexander Gromnitsky's Blog

Gmail to NNTP

Latest update:

How to read a mailing list via nntp if you already have a local INN installed & running.

Reqs:

  • fetchmail
  • procmail

The recipe is one-way only: you won't be able to respond to the list from your news reader.

  1. Create a label that's going to serve as a sink for all mailing lists. Then create a filter to catch emails from a particular mailing list:

    gmail filters

    The idea is not to clog you Inbox folder.

  2. Add to ~/.fetchmailrc:

     poll imap.gmail.com protocol IMAP port 993
          user bob@gmail.com is bob
          folder "Mailing Lists"
          keep
          ssl
    

    Gmail maps label names to IMAP folders.

  3. Create a newsgroup:

     # /usr/libexec/news/ctlinnd newgroup local.coff
    

    Then make sure your have

     server: localhost
    

    set in inn.conf. Otherwise expect warning: What server? errors from INN.

  4. Add to ~/.procmailrc:

     MY_CACHE=$HOME/.cache/procmail
     MY_MAILPOST_DB=$MY_CACHE/mailpost
    
     :0
     * ^TO.*coff@(minnie.)?tuhs.org
     |/usr/libexec/news/mailpost -b $MY_MAILPOST_DB local.coff
    

    You'll also need to manually create $MY_MAILPOST_DB dir.

  5. Run fetchmail!


Tags: ойті
Authors: ag