<!--
   $FML: merge.fml4to8.sgml,v 1.1 2005/07/23 01:57:36 fukachan Exp $
-->


<chapter id="mergeml.fml4to8">
	<title>
	Convert &fml4; Style ML To &fml8; Style ML
	</title>

<para>
2004/03: We have implemented a converter which converts ML HOME
DIRECTORY ($DIR) such as /var/spool/ml/elena ($ml_home_dir in &fml8;)
from &fml4; style to &fml8; style.
It is incomplete but is being developed.
</para>

<para>
2004/11: 
<link linkend="mergeml.fml4.overview">
You can replace fml.pl of &fml4; with fml.pl of &fml8;.
</link>
now.
It means that &fml8; directly emulates &fml4;.
It enables easy upgrade from &fml4; to &fml8;.
</para>


<sect1 id="mergeml.fml4to8.overview">
	<title>
	Overview: &fml4; To &fml8; (1)
	</title>

<para>
It is a little wrong that &fml8; works if &fml8; overwrites &fml4;
programs. Currently &fml8; can work but it needs automatic conversion
in the background. Hence, &fml8; modifies &fml4; to emulate &fml4;.
</para>

<para>
Firstly there is a problem. You want to upgrade all ML's at the same
time from &fml4; to &fml8;? It is better to upgrade from one to one ?
When something fails, you want to downgrade your system if could.
</para>

<para>
We want to support both types. So it is available that some ML's are
&fml8;, other ML's are &fml4; in one domain
simultaneously. Downgrading if needed are supported.
</para>

<para>
One example of upgrade operation follows:
<screen>
1. install &fml8;

2. (in the case of Postfix) add &fml8; aliases to postfix's alias_maps.

   Example:
	alias_maps	=	hash:/etc/mail/aliases
				hash:/var/spool/ml/etc/aliases (fml4)
				hash:/var/spool/ml/etc/mail/aliases (fml8)


3. convert &fml4; ML to &fml8; one.

   fml $ml mergeml fml4's$DIR 
for example,
   fml elena mergeml /var/spool/ml/elena
</screen>
Apply 3. for ML's which would be converted to &fml8;.
</para>

<para>
You can use "makefml mergeml" command to convert aliases, include
files, &fml4; configuration files and member lists from &fml4; to
&fml8;.
</para>

<para>
It is not easy to convert difficult &fml4;'s config.ph file. Now we
can convert simple config.ph to &fml8; config.cf style file
automatically. We suppose this simple config.ph is generated by
&fml4;'s "makefml config" command.
</para>

</sect1>


<sect1 id="mergeml.fml4.overview">
	<title>
	Overview: Convert &fml4; To &fml8; (2)
	</title>

<para>
2004/11: you can replace &fml4;'s fml.pl with &fml8;'s fml.pl.
</para>

<para>
Configure like this.
<screen>
[1. Install &fml8;]

% su fml
% sh configure
% su root
# make install

[2. Emulate &fml4;]

# mv /usr/local/fml/fml.pl /usr/local/fml/fml.pl.orig
# ln -s /usr/local/libexec/fml/fml.pl   /usr/local/fml/fml.pl
# ln -s /usr/local/libexec/fml/msend.pl /usr/local/fml/msend.pl
# ln -s /usr/local/libexec/fml/mead.pl  /usr/local/fml/libexec/mead.pl
</screen>
</para>

<para>
Precisely &fml8; can not read &fml4; configuration file.  If &fml8;'s
fml.pl cannot find config.cf, it tries to convert config.ph in ML's
home directory to &fml8; config.cf, read it and starts to run.
</para>

<para>
The conversion is incomplete but &fml8; can convert simple
configurations manipulated by &fml4; CUI or GUI.
</para>

</sect1>


<sect1 id="mergeml.fml4to8.config.diff">
	<title>
	Overview: Difference Between &fml4; and &fml8;
	</title>

<para>
There are several &fml8; variables and functions not related with
&fml4; since &fml8; is re-designed and re-coded from scratch.
</para>

<para>
Also not one to one even if the relation found.
</para>

<para>
Let's see a few examples below.
</para>


<sect2>
	<title>
	Anyone Can Post
	</title>

<para>
Users registered as members can post ML by default.  
This default behaviour is common between &fml4; and &fml8;.
To set "anyone can post", in the case of &fml4;,
<screen>
$PERMIT_POST_FROM = "anyone";
</screen>
in the case of &fml8;, 
<screen>
article_post_restrictions = reject_system_special_accounts
                            permit_anyone
                            reject
</screen>
.
</para>

</sect2>

<sect2>
	<title>
	Subject Tag
	</title>

<para>
No subject tag defined by default.
This is common between &fml4; and &fml8;
To set the tag such as '[ML_NAME:00100]', in the case of &fml4;,
<screen>
$SUBJECT_TAG_TYPE = '[:]';
</screen>
This corresponds to the following &fml8; configuration:
<screen>
article_header_rewrite_rules = rewrite_article_subject_tag

article_subject_tag           = [$ml_name:%05d]
</screen>
&fml8; configuration concepts are more orthogonal.
</para>

</sect2>

<sect2>
	<title>
	Disable Specific Command In Command Mail
	</title>

<para>
Commands such as "members" are prohibited in &fml8; by default.
&fml4; needs the following configurations to disable dangerous commands:
<screen>
&amp;DENY_PROCEDURE('member');
&amp;DENY_PROCEDURE('active');
&amp;DENY_PROCEDURE('members');
&amp;DENY_PROCEDURE('actives');
&amp;DENY_PROCEDURE('status');
&amp;DENY_PROCEDURE('stat');
</screen>
</para>

<para>
Old &fml4; use no filter by default but &fml8; uses filter by default.
</para>

<para>
&fml8; applies confirmation for subscribe, chaddr, unsubscribe
commands by default. &fml4; not. Currently &fml8; always applies
confirmation, which can not be disabled by configuration.
</para>

</sect2>

</sect1>


<sect1 id="mergeml.fml4to8.boot">
	<title>
	Discussion
	</title>

<para>
"makefml mergeml" command processes the following steps automatically.
</para>

<para>
To clarify details more, explain conversion of aliases and include
files below.
</para>

<para>
Our purpose is to run &fml8; anyway.
If &fml8; runs, converter of config.ph runs too.
So, we need MTA runs &fml4; and &fml4; runs &fml8;.
</para>

<para>
Explain more details. Consider
<link linkend="overview.ml">
ML driver internal
</link>
section.
</para>

<para>
For example, when you use Postfix, Postfix reads aliases and
recognizes it needs to read include file. By reading include file,
Postfix knows how to call &fml8; process. Finally, postfix runs
/usr/local/libexec/fml/distribute command.
</para>

<para>
Executed distribute command reads config.cf and knows the location of
member lists and processes et.al.
</para>

<para>
That is, when &fml8; process starts, 
the following two phases
<screen>
aliases (MTA configuration)
include 
</screen>
ends.
</para>

<para>
It is mandatory that no duplication in aliases files.
For example, 
if /etc/postfix/main.cf contains the following configuration:
<screen>
alias_maps	=	hash:/etc/mail/aliases
			hash:/var/spool/ml/etc/aliases (fml4)
			hash:/var/spool/ml/etc/mail/aliases (fml8)
</screen>
aliases of &fml4; and &fml8; should not have duplication.
</para>

<para>
In othe words, in the case of &fml4; process,
<screen>
MTA -> fml4's aliases -> fml4's include -> fml4 (fml.pl) runs
</screen>
in the case of &fml8; process, 
<screen>
MTA -> fml8's aliases -> fml8's include -> fml8 runs
</screen>
So we need the following condition:
<screen>
remove the ml from fml4's aliases file.
add the ml to fml8's aliases file.
</screen>
</para>

<para>
If no duplication in aliases, 
both &fml4; and &fml8; runs on the same host.
</para>

</sect1>


</chapter>
