[______TOC_______]
[NEXT CHAPTER]
1 MAIL to IRC (Internet Relay Chat)
Hmm ... meaningless must be nice :D one idea is
-----------------------------------------------------
ML -> mail2irc -> irc server
ML <- pirc <-----
?
-----------------------------------------------------
1.1 Relay to IRC
Mail2irc enters an IRC server, write and get out from it:).
1.2 Variables
# irc server
$IRC_SERVER = "irc.server";
# irc port
$IRC_PORT = 6667;
# irc channel to write
$IRC_CHANNEL = '#test';
# Your Name
$IRC_NAME = "test";
# Nickname
$IRC_NICK = "test";
# the last message of the end of irc session
1.3 A configuration example
Relaying mail to IRC and put the mail body to the channel "#test".
$IRC_SERVER = "hikari.sapporo.iij.ad.jp";
$IRC_PORT = 6667;
$IRC_CHANNEL = '#test';
$IRC_NAME = "test";
$IRC_NICK = "test";
$FML_EXIT_HOOK = q!
local($buf);
$IRC_SIGNOFF_MSG = "End of Article $ID";
require 'contrib/irc/libirc.pl';
$buf .= "From: $Envelope{'h:From:'}\n";
$buf .= "Subject: $Envelope{'h:Subject:'}\n";
$buf .= "Article: $ID\n";
$buf .= "\n";
$buf .= $Envelope{'Body'};
&Write2Irc($buf);
!;
1.4 stdin2irc.pl
stdin2irc.pl writes strings from STDIN to IRC.
stdin2irc.pl continues to connect IRC and writes inputs to IRC.
e.g.
tail -f logfile |perl stdin2irc.pl -f config-file
where a logfile is /var/log/messages and so on. Is it useful?:D
[______TOC_______]
[NEXT CHAPTER]