is there a mail app that does this?

John Voigt jvoigt
Mon Jan 3 07:46:12 PST 2005


On 01/03/2005 01:28 AM, dep eloquently noted:

> quoth A. Khattri:
> 
> | I am using the fortune program to select from a Jargon file database
> | (as below). Im using Pine (which allows you to pull a signature from
> | a program).
> 
> kmail apparently does also, so fortune might well be the ticket. is 
> there any trick format involved in the database -- need it be done with 
> some special app, or can it be put together in a text editor?

Happy New Year All!

I also use fortune for this, and call a script from cron every five minutes to 
generate a new .sig file. Basically there are four files needed: the text 
version of your fortune file, the random-access fortune file, the .siggen script 
and the .signature file itself.

The fortune text file is just a text file of all of the quotes separated by a 
line containing only a % (percent) character. You can then use strfile (should 
be included with fortune) to create the random access file which fortune 
actually reads. There are a few options for strfile - see the man page. There 
are also a few notes and a readme included with fortune providing more detail.

1010[jvoigt at tux]~> strfile -ir fortunes fortunes.dat

The .dat file is the one fortune actually uses. Then cron calls my .siggen 
script to generate the .signature file:

Linewrap warning!

----snip----

#!/bin/bash
echo "  _/- John Voigt - K9GBO -----|- Registered Linux User #38558 --_/" > 
.signature
echo " _/- System Administrator ----|- IN Dept of Natural Resources -_/" >> 
.signature
echo "_/- jvoigt at reclamation.dnr.state.in.us - (812)665-2207 -------_/" >> 
.signature
/usr/bin/fortune /home/jvoigt/misc/fortunes >> .signature

----snip----

Kmail IIRC can call the .siggen script directly, but I use Mozilla here, so I 
use cron to generate the .signature file. There are probably better ways to do 
this, but it works for me(tm).

HTH,

John V.
-- 
   _/- John Voigt - K9GBO -----|- Registered Linux User #38558 --_/
  _/- System Administrator ----|- IN Dept of Natural Resources -_/
_/- jvoigt at reclamation.dnr.state.in.us - (812)665-2207 -------_/
Whoever said you can't buy happiness forgot about little puppies.
		-- Gene Hill


More information about the Linux-users mailing list