look something like::
:0
- * ^Subject: *(Re:)* [PyRisk*
- | >> /path/to/named/pipe
-
-Then just add your EmailPlayers to your game and go::
-
- import pyrisk.base as b;
- import pyrisk.player.email as e;
+ * ^Subject:.*\[PyRisk.*
+ {
+ :0 wc
+ /path/to/named/pipe
+
+ :0
+ | /bin/echo -e '\000' >> /path/to/named/pipe
+ }
+
+The echo command appends a NULL byte to the FIFO, which (I think), helps
+the read() in _get_msg break at the appropriate point.
+
+Once you have the procmail rule setup, just add your EmailPlayers to
+your game and go::
+
+ from pyrisk.base import generate_earth, Player, Engine
+ from pyrisk.player.email import IncomingEmailDispatcher, \
+ OutgoingEmailDispatcher, EmailPlayer
world = generate_earth()
- players = [EmailPlayer('Alice', 'alice@example.com', 'server@example.com'),
- EmailPlayer('Bob', 'bob@big.edu', 'server@example.com'),
+ ied = IncomingEmailDispatcher(fifo_path='/tmp/pyrisk.in')
+ oed = OutgoingEmailDispatcher(return_address='server@example.com')
+ players = [EmailPlayer('Alice', 'alice@big.edu', ied, oed),
+ EmailPlayer('Bob', 'bob@fish.net', ied, oed),
Player('Charlie')]
e = Engine(world, players)
e.run()
-
+ ied.close()