Robert R Schneck's Cygwin page

Cygwin provides a Linux-like environment on computers running Windows. It is quite pleasant; one can almost feel that one is using Linux with a very Windows-like window manager. Plus, you can run Windows executables, even from the bash command line.

I used to maintain the sSMTP package for Cygwin. sSMTP is an extremely simple sendmail replacement, which forwards messages to a mailhub (e.g. your ISP's outgoing mail server), and does nothing else.

The upstream source for sSMTP is here.


Offline Mail and News Reading with Cygwin

I suggest the following packages for offline mail reading and composing:

pine
the MUA (mail user agent); you'll use it to compose mail
fetchmail
the mail retrieval utility; it fetches your mail from a POP or IMAP server
procmail
the MDA (mail delivery agent); fetchmail will call it to put mail in your mailbox (/var/spool/username)
ssmtp
the MTA (mail transport agent); it will send your outgoing mail to an SMTP server

I also use the following scripts:

queuemail
simply adds outgoing mail to a queue (the directory /var/spool/out.going/)
outmail
sends all the messages in the queue using ssmtp
killmsgid
optionally called by outmail to strip the Message-ID: header from the outgoing mail; I prefer the SMTP server to use its own

Fetching Mail

To download your mail you'll use fetchmail. You'll need a .fetchmailrc file in your home directory. Here's mine (almost):

poll mail.math.berkeley.edu
  with proto AUTO
  user 'schneck' there is 'schneck' here 
    password "not_my_real_password"
    ssl
    mda '/usr/bin/procmail -f %F -d %T'

You should find this easy to customize. Replace mail.math.berkeley.edu with your own incoming mail server; replace schneck and schneck with your username on the mailserver and the Cywin machine, respectively; replace not_my_real_password with your real password on the mailserver; and potentially remove the ssl line. You might replace AUTO with IMAP, POP2, POP3 or some other protocol; see the fetchmail man page for more.

Now to fetch the mail just call

fetchmail

That's it! One potential improvement is to use something like

fetchmail --limit 50000; fetchmail

This will pull in small messages first, which can be nice on slow connections; you can respond to the small messages while all the messages with attachments are still downloading.

Sending Mail

Run ssmtp-config to set up the configuration file for ssmtp; the options should be well-explained. Then configure pine to queue outgoing mail, using my script above, by setting

sendmail-path=/path/to/queuemail

Now when you send a message with pine it will be stored in /var/spool/out.going/. Just run the script outmail periodically to send out those messages using ssmtp. That's it!

News

This section is under construction. I use the newsreader slrn, which comes with an offline newsfeed tool slrnpull. Currently this is not an officially maintained Cygwin package, but Gerrit P Hasse has put up some downloads here. You'll also need the S-Lang package and the UUDeview package from the same page. (Also, the openssl and libiconv official Cygwin packages.)

Here's a sample /var/spool/news/slrnpull/slrnpull.conf. The 0 means all available articles are retrieved; the 14 means the number of days before articles expire; and every other line is a newsgroup to retrieve.

default 0 14
rec.games.roguelike.nethack
alt.buddha.short.fat.guy
comp.text.tex

The following lines should be in .slrnrc in your home directory:

set server_object "spool"
set post_object "slrnpull"
set spool_inn_root "/var/spool/news/slrnpull"
set spool_root "/var/spool/news/slrnpull/news"
set spool_nov_root "/var/spool/news/slrnpull/news"

Now just run slrnpull periodically, to retrieve and post articles. You should also run slrnpull --expire even more periodically.

Personally, I use the following little script, which I call netflux; I run it as soon as I connect, and right before I disconnect, and often many times in between.

outmail &
(fetchmail --limit 50000; fetchmail) &
slrnpull &
wait

Last updated 2005-12-05.

Robert R Schneck / <schneck@gmail.com>