delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/07/11/03:26:44

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Mon, 11 Jul 2005 00:26:06 -0700
From: George <d1945 AT sbcglobal DOT net>
To: cygwin AT cygwin DOT com
Subject: Re: Use Fetchmail/procmail on winxp
Message-ID: <20050711072606.GA304@home>
Reply-To: George <d1945 AT sbcglobal DOT net>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <uwto279j4 DOT fsf AT newsguy DOT com>
Mime-Version: 1.0
In-Reply-To: <uwto279j4.fsf@newsguy.com>
User-Agent: Mutt/1.4.2.1i
X-IsSubscribed: yes
Note-from-DJ: This may be spam

On Thu, Jul 07, 2005 at 01:31:27PM -0500, reader AT newsguy DOT com wrote:

> I've found quite a lot of info about fetchmail and procmail on google
> but didn't really find something describing how to make them work with
> winxp native mail tools. (My reader is not native winxp but Emacs news
> reader Gnus).
> 
> I'm well acquainted with setting both up under a sendmail system but
> really pretty lost about how winxp handles mail when not using thunder
> bird or outlook or other win tools.
> 
> My aim is to retrieve from a pop3 server using fetchmail and deliver
> using procmail to wherever it needs to go for gnus to slurp the mail.
> 
> I'm running winxp home with a recent `full' cygwin install.

It appears some hand-holding is in order.  Below are some instructions
that should help you understand things better and give you a working
setup on which to build.  Once everything is in place, please do go back
and read then re-read the relevant documentation as has already been
suggested.  There is also an excellent procmail mailing list to which
you can subscribe or access through gmane.  Also, try comp.mail.misc.
For everything else, Google is your friend. 

POP3 Server -> fetchmail -> procmail -> mbox -> email client

Assuming the following values:

   - your name: reader
   - your pop3 account name: reader AT newsguy DOT com
   - your pop3 server address: pop.newsguy.com
   - your pop3 account password: secret

   - you want all Cygwin list mail delivered to ~/mail/cygwin
   - you want all mail addressed to you delivered to ~/mail/personal

1. Create the following two files (below), editing each as appropriate,
and ensuring the correct permissions are set on your 'procmailrc'.

2. With the files in place, you can now retrieve your email by invoking
fetchmail with one of the following: 

    $ fetchmail -v           # verbose output
    $ fetchmail -vk          # verbose output, leave copies on server
    $ fetchmail -d 900       # daemon mode, poll every 900 seconds

The second option is useful when testing.  The fetchmail program will
authenticate with your server and begin retrieving messages, handing
them off one at a time to procmail for processing/delivery.

3. You can read your email at any time during the process using your
favorite client, reviewing the contents of the logs and running
'mailstat' as needed.  Note that the 'mbox' is simply a text file in a
generic format to which new messages are appended.  You can do whatever
you want with it as you would with any text file.

4. Windows virus scanners, if set to scan incoming/outgoing mail, will
work just fine using this setup.  Alternatively, you can use procmail to
pipe messages to clamav for virus/attachment checking. 

5. Your fetchmail configuration will generally be straightforward, but
your procmail configuration can be as simple or as complex as you need.
For example, I process all messages with scripts to remove
unsubscribe/advertising footers from mailing lists and perform other
general cleanup, in addition to the more typical deliver, forward,
add/rewrite headers, etc. actions procmail is used for.

6. And before you ask, yes you can use standard tools found in the
Cygwin distribution to send mail as well.  The following line if placed
in the configuration file for your email client should suffice: 

   set sendmail="/usr/sbin/ssmtp -audreader AT newsguy DOT com -apsecret"

See 'man ssmtp' for more information on that subject.

# ======================================================================
# ~/.fetchmailrc
# ======================================================================

set logfile "/var/log/fetchmail.log"
set invisible
set no bouncemail

# retrieve all messages from your pop server
poll "pop.newsguy.com" protocol POP3 username "reader AT newsguy DOT com" \
	password "secret" fetchall

# set procmail as your mail delivery agent
mda "/usr/bin/procmail -f %F -d %T"

#=======================================================================
# ~/.procmail/procmailrc
#=======================================================================

SHELL=/bin/sh
VERBOSE=off
DEFAULT=/var/spool/mail
MAILDIR=$HOME/mail
PMDIR=$HOME/.procmail
LOGFILE=$PMDIR/log

# Recipe 1 - move any Cygwin messages into an mbox named 'cygwin-users'
# located in '~/mail/' 

:0:
* ^TO_cygwin AT cygwin DOT com
cygwin-users

# Recipe 2 - move any messages addressed to you into an mbox named
# 'personal' located in '~/mail/'

:0:
* ^TO_.*reader AT newsguy DOT com
personal

-- 
George

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019