[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: random signature

* Sven Burgener <svenb@bluewin.ch> wrote:

> Is there a way to put some sort of random signature system to
> use in mutt?


# Version: let's call it 0.9.9, date: Tue, 25 Apr 2000 21:03:36 +0200
# Version: 0.9.9a, date: Sun, 30 Apr 2000 17:54:44 +0200
# Written by Eduard Bloch, Licence: GPL Installation is simple: copy
# this somewhere, in your home directory for example, make it executable
# (chmod +x) and start it. You may want it be started at boot time, just
# put a command like this in a init-script:
# su -c '/usr/bin/sigrot' user

# WARNING: First created the .signature fifo, don't forget to run
# sigrotate before using the client program. Otherwise you will wonder
# what the program is waiting for.

# file where the signatures are stored in
# The format is simple: many signatures separated by lines containing "-- "
# or "--<Return>"

# file to be used by news/mail agents as the signature source. If
# exists, the file will be renamed and a fifo will be created in its place

# specify a file for personal stuff like "/me is Foo Bar <foo@bar.com>"

# specify a file for personal stuff like "/me is Foo Bar <foo@bar.com>"

$parm = $ARGV[0];
if($parm =~/^-help/)
#print "Usage: sigrotate [-ps|-sp leftwidth separator rightwidth]\n"; 
exit 0;

if(-f $signatur)
{rename($signatur,$signatur.".sr".(time)) || die "Old signature found and couldn't be renamed\n" }

if(!-p $signatur){system "mkfifo $signatur" || die "couldn't create fifo file"};

sub spalten {
($text) = @_;
$text =~ s/\n|\r/ /gi;
return $text;
# Wenn nicht gelockt, dann locken
	print STDERR "Starting sigrotate using $signaturedb, forking to background." if($ARGV[0] ne "-q");
	print STDERR "Signature Rotator is already running...(exiting)\n" if($ARGV[0] ne "-q");
	exit 1;

	$i = 0;
#	chdir($ENV{"HOME"}."/testing");
#	fifo geöffnet, warten bis ein Programm liest
		$sigs[$i].=$_ if(!/^--(\n| )/);
		$i++ if(/^--(\n| )/); 

	# uncomment the following line to add "-- " if the client program doesn't do
	# this automaticaly - not needed by the the most user agents
	# print fifo "-- \n";

	# now, use this construction below to import the personal stuff from a
	# file (~/.psig)
	while(<person>){print fifo $_};


#	if($parm =~/^-/)
#	{
#		print fifo "test".spalten($sigraw);
#		# in entw.: Spalten mit Trennzeichen, Breite fest über Parameter
#		# oder variabel (so breit das der text die gleiche Länge hat)
#	}
#	else
#	{
		print fifo $sigraw;
#	};

  close fifo;
	sleep 1;
print "..done.\n"  if($ARGV[0] ne "-q");

Reply to: