|Mon 1998-06-22 Bernard El-Hagin
<belhagin(_at_)bya1c87(_dot_)pl(_dot_)lucent(_dot_)com> list.procmail
|
| ... account which I can't access via from outside, but I would like to read
| and *remove* mail from this account using Procmail.
I wrote a recipe to listen "pop3" requests, that sound more or less like
the task you're looking for. I haven't used the recipe for a while,
so bug me if it doesn't work. Include in pm-code.shar (See X-info File Server)
jari
Pm-japop3.rc -- Remotedly download messages by mail command request
$Id: pm-japop3.rc,v 1.4 1998/06/22 12:20:45 jaalto Exp $
File id
.Copyright (C) 1998 Jari Aalto
<jari(_dot_)aalto(_at_)poboxes(_dot_)com>
.Maintainer: Jari Aalto <jari(_dot_)aalto(_at_)poboxes(_dot_)com>
.Created: 1998-01
.Keywords: procmail pop3 emulation recipe
This code is free software in terms of GNU Gen. pub. Lic. v2 or later
You can get newest version by sending email to maintainer with
subject "send <FILENAME>"
Description
Ahem, that `pop3' is just to draw your attentions. This module has
nothing to do with pop3. The idea may resemble it though. This
recipe will listen pop3 request, and when it gets one, it sends
your whole mailbox as forwarded messages to the account from
where you sent the request.
This is kinda "empty my mailbox in account X and send the messages
to account Y"
You might have permanent forwarding on in account X, but if that
is your socondary account, you can ask what messages has been arrived
there with this recipe.
After you have configured your magic pop3 command, simply sending
message to account X, will initiate emptying your mailbox
Subject: pOp3-send [mailbox] [kill]
o mailbox, is optional folder name which you want to process.
it is $DEFAULT if not given in subject.
o if word `kill' is found, the mailbox will be meptied after
forwarding. If the word is not found, messages are preserved.
Required settings
PMSRC must point to source direcry of procmail code. This subroutine
will include
o pm-javar.rc
o pm-japop3.rc # Phew! We include ourself
Call arguments (variables to set before calling)
o JA_POP3_SUBJECT_CMD, select your personal command string.
if this is first word in subject line, forwarding starts.
This string is case sensitive.
o JA_POP3_TMP is the file where mailbox is moved before starting
to forward the messages. Do not put to point to yout $HOME,
becaus that may exceed the quota.
Return value
STATUS will contain mailbox name if valid pop3 request was received.
You may wish to save the request message to separate folder.
Example usage
You install this same setup for each site where you have account
RC_POP3 = $PMSRC/pm-japop3.rc
.. somewhere in your .procmailrc ..
JA_POP3_SUBJECT_CMD = myPoPcmd
INCLUDERC = $RC_POP3
# Save all pop3 requests to folder
:0
* STATUS ?? [a-z]
mail.pop3-req.mbox
# in account Y, this recipe stores the moved messages to
# separate folder
:0
* X-Loop-Fwd:.*\.rc +\/$NSPC+
{
# The MATCH wil lhave the host name from where the messages
# were moved
:0 :
mail.fwd.$MATCH.mbox
}