procmail
[Top] [All Lists]

Re: Filtering for the Network

2000-03-26 11:54:18
Ian Chilton said:

<> What I want to be able to do, is receive mail from a hostbased mailbox,
<> filter it, into separate files, and pick them up from a windows machine,
<> over the network, connecting to pop3d on the Linux box.

I don't understand what you mean by "hostbased mailbox" ...  I'll take a
stab at some of the other questions you posed.

<> Right, I recieve the mail form the ISP, and filter with a recipe like this:

I presume you are using fetchmail of something similar to retrieve mail
from a POP3/IMAP mailbox, right?

<> :0:
<> * ^TO_ian@
<> /var/spool/mail/ianmail
<> 
<> :0:
<> * ^TO_anotheruser@
<> /var/spool/mail/otheruser
<> 
<> ..etc..etc..
<> 
<> Now, when I recieve a message, it puts it into /var/spool/mail/ianmail fine,
<> but when I go from my windows POP3 client and log on to pick it up, it says
<> I have no mail.
<>                 Then, when I log on to the linux box as ianmail, mail says I
<> have no mail (Even though the message is in /var/spool/mail/ianmail !). When
<> I run elm, it says:
<> 
<> Reading in /var/spool/mail/ianmail, message,0
<> Folder is corrupt!!  I can't read it!!
<> Discarding any changes made to mail folder ...

My guess is that the ianmail file is not in strict mbox format:

Elm and the UWash POP3 (default POP server on most Linuces) look for a
specific format to seperate messages.  The "divider" is a line like this:

  From sender(_at_)host(_dot_)dom(_dot_)ain  Sun Mar 26 13:32:13 2000

(Well, more correctly "<cr><cr>From<space>" but Elm is picky about the 
entire line ...)

If the message doesn't have that "From " (Explicitly, "From<space>")
header, then elm will complain about a corrupt mailbox.  I suspect
that whatever you are using to pull those messages from your ISP is
stripping that header off for some reason -- procmail won't remove it,
but it won't (by default) create it either.

You haven't told us how you are invoking procmail on these incoming
messages.  If you can alter the invocation of procmail, you can use the
form:

  procmail -f username(_at_)ISP

to instruct procmail to add a "From " header.

<> (Is there another way to do this??)

Perhaps have whateve program you are using to download your mail from
your ISP add the header? But you haven't told us whcih program and it's
outside the scope of the procmail list anyway ...

RL
-- 
R A Lichtensteiger       rali(_at_)tifosi(_dot_)com -or- 
rali(_at_)world(_dot_)std(_dot_)com

        Holy St. Isador, preserve us from the evil of Gates!