
		how to use fml under virtual domains

------------------------------------------------------------
1	Overview
1.1	makefml can read configuration via -f option

2	virtual domain

Appendix A	Example: postfix and virtual domains
Appendix B	sendmail
Appendix B.1	Example: CF's USERTABLE_MAPS
------------------------------------------------------------


1	Overview

If you want to run ML under virtual domain, you can use fml, off
course. 

Firstly you can install plural fml systems. For example,

    virtual-1
    	/usr/local/fml-virtual-1/
    	/var/spool/ml-virtual-1/
    
    virtual-2
    	/usr/local/fml-virtual-2/
    	/var/spool/ml-virtual-2/
    
    virtual-3
    	/usr/local/fml-virtual-3/
    	/var/spool/ml-virtual-3/

/usr/local/fml-virtual-1/ directory has execlutables.
/var/spool/ml-virtual-1/ directory has ML's home directories

If you can share /usr/local/fml over several virtual domains, 
the disk requires smaller areas.

1.1	makefml can read configuration via -f option

You can use configuration file in this way. 

      makefml -f /some/where/virtual-domain-1 install
      makefml -f /some/where/virtual-domain-2 install

/some/where/virtual-domain-1, the option of -f, is the configuration
file. The format is the same as /usr/local/fml/.fml/system.
For example:

      makefml -f /usr/local/fml-virtual-1/.fml/system install
      makefml -f /usr/local/fml-virtual-2/.fml/system install
      makefml -f /usr/local/fml-virtual-3/.fml/system install

2	virtual domain

Example:

       info@domain1.org
       info@domain2.org 

       DOMAIN NAME               [domain1.org] 
       FQDN                      [domain1.org] 
       EXEC FILES DIRECTORY      [/usr/local/fml] 
       TOP LEVEL ML DIRECTORY    [/var/spool/ml] 

       DOMAIN NAME               [domain2.org] 
       FQDN                      [domain2.org] 
       EXEC FILES DIRECTORY      [/usr/local/fml2] 
       TOP LEVEL ML DIRECTORY    [/var/spool/ml2] 

	% makefml -U install 

	% /usr/local/fml/makefml newml info

	% /usr/local/fml2/makefml newml info

    	info: :include:/var/spool/ml/info/include
    
    	info-domain2: :include:/var/spool/ml2/info/include

    	info-domain1: :include:/var/spool/ml/info/include
    
    	info-domain2: :include:/var/spool/ml2/info/include
    ~.q
    
    [postfix]
    
    [sendmail]
    
Appendix A	Example: postfix and virtual domains

    /etc/postfix/virtual:
    
    	elena@domain-1.org	elena-1
    	elena@domain-2.org	elena-2
    
    /etc/aliases:
    
    	elena-1: :include:/var/spool/ml-virtual-domain-1/elena/include
    	elena-2: :include:/var/spool/ml-virtual-domain-2/elena/include

Appendix B	sendmail

	http://www.sendmail.org/virtual-hosting.html

Appendix B.1	Example: CF's USERTABLE_MAPS

See doc/MANUAL.jpn of CF package.

* changes of .def file

    -##                ut.dom1=btree:/etc/ut.dom1:error \
    -##                ut.dom2=dbm:/etc/ut.dom2 \
    -##                ut.dom3=nis:usertable3'
    +USERTABLE_MAPS='fml.org=hash:/root/test/fml'
    +
    ~.q
    
    * /root/test/fml
    
    fukachan:maildrop       fukachan@enkai.org

* make db file

    # makemap hash /root/test/fml.db < /root/test/fml

* sendmail test mode

    % sendmail -bt -C virtual.cf
    > 3,0 fukachan@fml.org
    rewrite: ruleset   3   input: fukachan @ fml . org
    rewrite: ruleset  96   input: fukachan < @ fml . org >
    rewrite: ruleset  96 returns: fukachan < @ fml . org >
    rewrite: ruleset   3 returns: fukachan < @ fml . org >
    rewrite: ruleset   0   input: fukachan < @ fml . org >
    rewrite: ruleset  91   input: fukachan < @ fml . org >
    rewrite: ruleset  91 returns: fukachan @ enkai . org @ < @ fml . org >
    rewrite: ruleset  97   input: fukachan @ enkai . org
    rewrite: ruleset   3   input: fukachan @ enkai . org
    rewrite: ruleset  96   input: fukachan < @ enkai . org >
    rewrite: ruleset  96 returns: fukachan < @ enkai . org >
    rewrite: ruleset   3 returns: fukachan < @ enkai . org >
    rewrite: ruleset   0   input: fukachan < @ enkai . org >
    rewrite: ruleset  88   input: < smtp : enkai . org > . fukachan < @ enkai . org >
    rewrite: ruleset  88 returns: $# smtp $@ enkai . org . $: fukachan < @ enkai . org >
    rewrite: ruleset   0 returns: $# smtp $@ enkai . org . $: fukachan < @ enkai . org >
    rewrite: ruleset  97 returns: $# smtp $@ enkai . org . $: fukachan < @ enkai . org >
    rewrite: ruleset   0 returns: $# smtp $@ enkai . org . $: fukachan < @ enkai . org >


		INDEX

