
	pass articles to other services/programs

------------------------------------------------------------
1	MAIL to IRC (Internet Relay Chat)
1.1	Relay to IRC
1.2	Variables
1.3	A configuration example
1.4	stdin2irc.pl

2	Mail2news (ML -> News)
2.1	How to set up mail2news
2.2	Mail2news configurations

3	Pager calling pre-filter
3.1	euc2jiskuten.pl 
3.2	How to call pager through FML
------------------------------------------------------------


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

2	Mail2news (ML -> News)

This is beta test phase. You require perl 5 if you use this function.

mail2news injects mail (distributed in a mailing list) to NetNews.
We use NNTPClient.pm as NNTP engine to implement it. Please see
contrib/mail2news/.

2.1	How to set up mail2news

Install contrib/mail2news/libnntp.pl to the search path of perl
include path or FML installed directory (e.g. fml.pl lib*pl). 

2.2	Mail2news configurations

Configure $FML_EXIT_HOOK in config.ph like

Example:

	$FML_EXIT_HOOK .= q#;
		&use('nntp');
		&NntpPost(*Envelope);
	#;

Please define following variables:

    $NEWS_SERVER

	news server to post

    $DEFAULT_NEWS_GROUP

	default newsgroup to post. It is used if Newsgroup: field does
	not exist in the input mail. If this variable is not defined and
	Newsgroup: field does not exist, mail2news routine returns an error.

    @NEWS_HDR_FIELDS_ORDER

	Header fields mail2news use when posted to $NEWS_SERVER.

	("from", "newsgroups", "subject", "supersedes", "references")

	Please use small characters "subject" if you use the original
	fields in a posted article, whereas Capital "Subject" if you
	use a Net news article is the same content of a ML article.

   %NEWS_FIELD_DEFAULT

	Hash of contents of Non-usual fields in the header of a
	mail. e.g. Organization?

   %NEWS_FIELD_TO_OVERWRITE

	Hash of contents of overwritten fields. e.g. Organization?

3	Pager calling pre-filter

Here we introduce a pre-processing program which converts Japanese to
codes recognized by a pager.  Please do not ask me the detail around
between an operating system and a modem. The details depend on your
pager, modems and so on.

3.1	euc2jiskuten.pl 

   ftp://ftp.iij.ad.jp/pub/IIJ/dist/fukachan/calling-pager/

We need to translate Japanese to JIS Kuten codes for sending the mail
content to a pager.

We translate the mail content to EUC codes, and then to JIS Kuten
codes by euc2jiskuten.pl. You have only to send JIS Kuten codes to
a pager.

3.2	How to call pager through FML

1	prepare calling modem program (call it "modem2pager").

2	Configure $START_HOOK as the following example:

	open(PAGER, "| euc2jiskuten.pl | modem2pager");
	print PAGER $Envelope{'Body'}:
	close(PAGER);
	$DO_NOTHING = 1;

FML sends the mail body to euc2jiskuten.pl and then to modem2pager.
Modem2pager should queue and send it via e.g. /dev/tty01 to a modem.
You must tune queuing codes of modem2pager, which must be difficult.


		INDEX

$DEFAULT_NEWS_GROUP                        ...   2.2 
euc2jiskuten.pl                            ...   3.1 
$IRC_CHANNEL                               ...   1.2 
$IRC_NAME                                  ...   1.2 
$IRC_NICK                                  ...   1.2 
$IRC_PORT                                  ...   1.2 
$IRC_SERVER                                ...   1.2 
$IRC_SIGNOFF_MSG                           ...   1.2 
mail2news (ML -> News)                     ...   2 
mail2pager                                 ...   3 
%NEWS_FIELD_DEFAULT                        ...   2.2 
%NEWS_FIELD_TO_OVERWRITE                   ...   2.2 
@NEWS_HDR_FIELDS_ORDER                     ...   2.2 
$NEWS_SERVER                               ...   2.2 
pager                                      ...   3 
