procmail
[Top] [All Lists]

RE: Forward Mail Spool on Demand (2nd attempt)

2003-07-01 15:39:14
Look into using POP3 (or IMAP) instead of forwarding with an MTA like
sendmail.  The MTA is built upon the assumption of store-and-forward one
copy of each message.  A lot of work goes into making sure that mail is
kept safe while forwarding and neither lost nor replicated into multiple
copies.  POP and IMAP leave it up to you if you want store-and-forward
or forward-a-copy.

There are lots of clients and programs you can find to use POP3, some of
them scriptable.  If you have a windows desktop at work, one of the
easiest things to do is to use a different mail client from the
*official* one (netscape if Outlook is official, for example) and
configure it the way you want.

Another common technique is to use a web interface to the mail spool
since http is one of the last ports to be closed by management.


Dana Bourgeois


-----Original Message-----
From: procmail-bounces(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE 
[mailto:procmail-bounces(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE] On Behalf Of 
Nikolaus Hiebaum
Sent: Tuesday, July 01, 2003 4:48 AM
To: procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
Subject: Forward Mail Spool on Demand (2nd attempt)


Hello again -

A second attempt (original post on 06/21
<http://www.xray.mpe.mpg.de/mailing-lists/procmail/2003-06/msg
00262.html>)
- maybe someone gives me some input this time.

From work I cannot access my private e-mail account. I was 
looking for 
a
solution that would forward my mail spool upon a trigger 
message. Some search on Google produced a solution that was 
discussed here 
<http://www.xray.mpe.mpg.de/mailing-lists/procmail/1998-08/msg
00361.html>.
It works, but it bothers me that the spool is deleted once it 
is mailed.

Here is my recipe:
---BOF---
ORGMAIL=/var/mail/hiebaum

:0 D
* ^From: .*(work(_at_)company\(_dot_)com)
* ^Subject: .*(+FWMAIL)
{
LOCKFILE=$ORGMAIL$LOCKEXT

      :0 c:
      IN.webmaster

      :0 frw
      * ? test -s $ORGMAIL
      | cat $ORGMAIL
      :0 Arc
      | formail -I "X-Forwarded: from $LOGNAME(_at_)$HOST" -es \
      $SENDMAIL -oi -t work(_at_)company(_dot_)com

      :0 Arc
      | cat > .sentspool
      :0 Ahi
      | true > $ORGMAIL # safer to empty it than to rm it

      :0 bfw
      | (formail -i "From: my(_at_)account(_dot_)com" ; \
      echo "\$ORGMAIL was empty.  There was nothing to forward." )
      :0
      ! work(_at_)company(_dot_)com
}
---EOF---


I found that that if I delete or comment the lines
:0 Ahi
| true > $ORGMAIL
out, then $ORGMAIL won't be deleted, but the newest message 
in $ORGMAIL is mailed to me twice *plus* some messages loop. 
I haven't yet quite understood why only some messages loop 
and despite having addedd respective "X-Loop:" headers.

Any ideas? :)

-- 
CU, Nick
*Draft beer, not people*





_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE 
http://MailMan.RWTH-> Aachen.DE/mailman/listinfo/procmail



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>