9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] archive outgoing mail
@ 2004-01-26 18:56 Matthias Teege
  2004-01-26 19:17 ` mirtchov
  0 siblings, 1 reply; 2+ messages in thread
From: Matthias Teege @ 2004-01-26 18:56 UTC (permalink / raw)
  To: 9fans

Moin,

I want to archive outgoing mail in a monthly
mbox. I read the 9fans archive and found some
hints about acme mail. But what about mail
created whith nedmail.

Is pipefrom the place I'm looking for? Should
I use upas/deliver or can I simply copy the
mail to an mbox?

Many thanks
Matthias


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9fans] archive outgoing mail
  2004-01-26 18:56 [9fans] archive outgoing mail Matthias Teege
@ 2004-01-26 19:17 ` mirtchov
  0 siblings, 0 replies; 2+ messages in thread
From: mirtchov @ 2004-01-26 19:17 UTC (permalink / raw)
  To: 9fans

the following archives outgoing mail daily, easy to modify for monthly
archival:

% cat /mail/box/andrey/pipefrom
#!/bin/rc

rfork e
ramfs

TMP=/tmp/pipefrom.$pid
datum=`{mdate}
fileto=/mail/box/$user/sent/$datum

test -e $fileto || {touch $fileto; chmod +a $fileto}

cat > $TMP

cat $TMP >> $fileto
echo '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%' >> $fileto

# collect upas/send options
options=()
while (! ~ $#* 0 && ~ $1 -*) {
	options=($options $1);
	shift
}

# collect addresses and add them to my patterns
dests=()
while (! ~ $#* 0) {
	dests=($dests $1);
	shift
}

# send mail
upas/send $options $dests < $TMP
%

you need to mkdir /mail/box/$user/sent for this to work...

mdate is a very simple program that prints the date in a format that's
easily sortable:

% cat $home/src/cmd/mdate.c
#include <u.h>
#include <libc.h>


void
main(int argc, char *argv[])
{
	Tm *t;

	USED(argc, argv);

	t = localtime(time(0));

	print("%4.4d-%2.2d-%2.2d", t->year+1900, t->mon+1, t->mday);

	exits(0);
}
%

one problem with this scheme -- the you can't use upas/fs on the
sorted emails (they have different format than the one in your inbox).
I haven't bothered to fix it, though a bit of sed-ing would suffice.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-01-26 19:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-26 18:56 [9fans] archive outgoing mail Matthias Teege
2004-01-26 19:17 ` mirtchov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).