                ǥХåˤĤ

------------------------------------------------------------
1	

2	ǥХå⡼ɤȥǥХå٥
2.1	ǥХå⡼
2.2	ǥХå⡼ ٥룲

3	ǥХå HOW-TO 
3.1	How to debug (1)
3.2	How to debug (2)ΥǥХåΥݥȡ
3.3	ŵ printf debug 

4	ޥɥ饤 ץ
4.1	ޥɥ饤Υ󥿥å
4.2	󥰥饤󥪥ץ --\S+=\S+
4.3	եȥޥɥ饤󥪥ץ
4.4	ʰץ⡼ (󥰥饤󥪥ץ) --\S+
4.5	--ctladdr ˤĤ (ޥѤΥɥ쥹)
------------------------------------------------------------


1	

̥ͣ/ɥ饤 ϥ桼ľܻȤޥɤǤϤޤ
̾綠ϥ᡼륵СʥǡˤưץǤ

ǥХå뤿ˤϥ᡼륵ФƤ뤳Ȥ򥨥ߥ졼󤹤ɬ
פޤ

ǥХåȤäƤ¿ξfml᡼륵ФǤĤޤŤȤ
¿Ǥ

 ᡼륵ФŵŪʥ顼ˤĤƤ => 

 ᡼륵  fml Ϥ/äǤ

 SMTPΤȤΥ => smtp 3.1

 fml -> ᡼륵 إ᡼ϤΥޤ

 顼㽸 => troubleshoot 1

2	ǥХå⡼ɤȥǥХå٥

2.1	ǥХå⡼

	$debug        = 1; (default 0)

ǥХå⡼ɤΥեåǥХå⡼ɡʳꡢޥ
Ϥ٤ͭǤƥȤ˻ȤäƲꤷʤƤ
ޤ󡣥ǥХåƤSTDERRǤޤ

2.2	ǥХå⡼ ٥룲

$debug 2ʾˤȡ˥ǥХåϤ

	$DEBUG_LOGFILE (default "$DIR/log.debug")

եǤޤ

3	ǥХå HOW-TO 

3.1	How to debug (1)

in fml-support: 5282
    1. OSΥ᡼ΥĴ٤롣
    
    INSTALL file  Appendix A ߤƤߤƤ
    
    2. fml ΥĴ٤롣$DIR/log (ML's HOME ե)
    
    3. fml MTAؤϤƤ뤫ΥĴ٤롣
       ($DIR/var/log/_smtplog)
    
    4. "makefml test ML"  fml ΤưƤ뤫Ĵ٤롣
       ΥƥȤMTAȤϴ̵طưΤǤ줬ưʤMTA
    
    	makefml test ML
    
    ǤĤȥǥХå⡼ɤǤưƥȤǤޤ̤ debug 󤬰
    սФΤ emacs  shell mode ʤ /usr/bin/script ʤɤǥȤ
    ꤷƸƲmakefml test ML ưΥƥȤޥɤ
    ƥȤ򤷤Ȥޤ

3.2	How to debug (2)ΥǥХåΥݥȡ

From: fml-support: 01411

ά

  printf ǥХåʤΤ $debug = 1; ˤβ̤˽Ф륨顼
󤫤¬Τ¿Ǥ

⤷

 perl -d ץ perl debugger Ȥ

Example:

	% ($FML/bin/emumail.pl; echo something )|perl -d $FML/fml.pl $PWD
	....debugger starts ...
	<1> t
	<2> c
	.... debug information flood! ....

 ɤΥե뤫Ṳ̄ʤΤǤäݤ̾ΤȤ¿Ǥ

	ܴؿ	fml.pl
	SMTP		libsmtp.pl
	¾		lib(äݤ̾).pl

	[Naming Convention Example]
	ra  = remote administration
	fop = file operation
	...

ȤάϤ⤢뤱ɡ 

3.3	ŵ printf debug 

    From: fukachan@phys.titech.ac.jp
    X-Mail-Count: 00702 
    
    㤨мΤ褦Ŭ printf ʸĤä
    
    	print STDERR "REQ:GUIDE $Envelope{'req:guide'}";
    
    &InitConfig;			# initialize date etc..
    &Parsing;			# Phase 1(1st pass), pre-parsing here
    &GetFieldsFromHeader;		# Phase 2(2nd pass), extract headers
    
    ΤˤϤǡ
    
    	print STDERR "REQ:GUIDE $Envelope{'req:guide'}";
    &InitConfig;			# initialize date etc..
    	print STDERR "REQ:GUIDE $Envelope{'req:guide'}";
    &Parsing;			# Phase 1(1st pass), pre-parsing here
    	print STDERR "REQ:GUIDE $Envelope{'req:guide'}";
    &GetFieldsFromHeader;		# Phase 2(2nd pass), extract headers
    	print STDERR "REQ:GUIDE $Envelope{'req:guide'}";
    
    ȤƤơ
    
    % perl sbin/localtest.pl |sed 's/test/#guide/' | perl fml.pl $PWD -d 
    
    Ȥơ REQ:GUIDE ͤѲߤȤΤϤɤǤ礦
    
    Ф &Parsing Τ ˤʤä ΤޤޤΤϤǤ
    
4	ޥɥ饤 ץ

ޥɥ饤󥪥ץ /etc/aliases ƤФ include file 

	"|/usr/libexec/fml/fml.pl $DIR $LIBDIR -option" 

Υץʬ( -option)äΤȤǤ˥ǥХå˻Ȥ
ꤷƤޤݼԹͤ $DIR/cf (config.ph) ꤹ
٤Ǥ

makefml config  $DIR/cf ѿ񤭴ޤ̾򤤤
 $DIR/cf ˥ǥեȤȤϰۤʤ񤯤褦ˤƲ
(config.phcf뤳Ȥ˺줺)ޥɥ饤󥪥ץ
ǥХåʳŪǤϻȤʤȤ侩ޤ

ޥɥ饤ϻȤ(e.g. ǥХå)ˤäƤϤȤäƤǤ
Τ褯狼ʤͤϻȤʤǲ

	ա

ʤ makefml Ǻ include-ctl Ȥեˤ --ctladdr Ȥ
ץ󤬤ĤƤޤϳʤǲ Υץ
ץ˶̤ config.ph ˽񤱤ʤܤǤ

4.1	ޥɥ饤Υ󥿥å

SYNOPSIS:
   fml.pl   [ options ] $DIR [ options ]  [ $LIBDIR [ options ] ]

	fml.pl msend.pl ƱΤȤ꤫򤷤ޤ
	աfml_local.pl  MH ռƤΤǰۤʤޤ

ץȰ¸

	 -ǤϤޤʤ饪ץ
	ʳ directory ʤɤѿ

Ȳꤷޤ֤ϴطޤdirectory ˴ؤƤ  
directory ¸ߤаν $DIR$LIBDIR ˥åȤޤ

[DESCRIPTION]

	-d		ǥХå⡼
			ʣ̤ͣؤʳ٤Ƥ¹Բǽ
	-d2		debug mode level 2
			debug message is logged to $DEBUG_LOGFILE
			(== $DIR/log.debug in default).

	-bt   		ɥ쥹ƥȥ⡼	(Become Test)
			СåΤȤޤǼ¹Ԥ롣
			̤ͣؤ䥳ޥɤϼ¹Ԥʤ
			ޤΤȤ debug mode Ȥؤͤ:-)

	-bd		ǡ⡼	(Become Daemon)

	-sOPT 		$OPT 򥻥åȤ(e.g. -sdebug == -d)
	-uOPT 		$OPT 򥪥դ(e.g. -udebug  $debug = 0; Ʊ
	-lfile		file  $LOAD_LIBRARY ѿ 
			e.g. -llibfml.pl 

**:-btΤ褦ˡض̵٤Ǥ(äƤɤñ:-)**

:
	-llibfml.pl Ȥȡޥѥɥ쥹ΤǤǤ
	 CONTROL_ADDRESS Ȥʤ̣Ǥ

	-llibftpmail.pl ftpmail ѥɥ쥹
	-sdebug		debug mode
	-sUSE_MIME	$USE_MIME = 1; Ʊ

ȤǤ櫓Ǥ

㡧

"|/usr/local/fml/fml.pl /Baycity /Baycity/lib -d -sUSE_MIME --DUMPVAR"

ǥХå⡼  $USE_MIME =1;  ѿΥפԤʤ

4.2	󥰥饤󥪥ץ --\S+=\S+

:
Example: eval( $MAINTAINER = "fukachan@sapporo.iij.ad.jp" ); essentially

	--MAINTAINER=fukachan@sapporo.iij.ad.jp

$MAINTAINER ͤ fukachan@sapporo.iij.ad.jp  Overwrite ޤ
config.ph θɾΤǡ󥰥饤󥪥ץȤäƤͤ
ѹ뤳ȤǽǤ

4.3	եȥޥɥ饤󥪥ץ

ƣ̤ͣξ config.ph ֤ FML Υ饤֥꤬֤Ƥ
 config.ph ⤷ sitedef.ph ҤȤĤ֤Ƥݼ餹
ΤǤξɾ֤ϼΤ褦ˤʤޤ
̤ program Ʊ褦˥ޥɥ饤󤬰ֺǸɾޤ

   0     ǥե(program ˥ϡɥ)
   1    (⤷) directory  site_init.ph  loading
   2	$DIR/config.ph (Υեɬ)
   3	(⤷) directory  sitedef.ph  loading
   4	θ女ޥɥ饤󥪥ץɾ

4.4	ʰץ⡼ (󥰥饤󥪥ץ) --\S+

		--mode

η ñ˺ư⡼ɤѹ뤳ȤޤƱȤ config.ph 
Ǥ

		--mode

		&DEFINE_MODE('mode');

ˤʤޤʤޥɥ饤 --mode  config.ph ǻꤹ 
$Envelope{"mode:$mode"} Ʊ̣ˤʤޤǥХåʳǤϻȤʤ
Ǥ礦(developer )

:
		fml.pl --ctladdr

4.5	--ctladdr ˤĤ (ޥѤΥɥ쥹)

ߤ makefml ǤϤ٤Ƥ config.ph ͤľȤǹԤʤ
ޤΤᥳޥɥ饤󥪥ץϤޤ

ҤȤĤ㳰ޤޥѤΥɥ쥹 listname-ctl  
include-ctl ƤӤޤ include-ctl ˤ

		--ctladdr

ȤإޥѤΥɥ쥹Υ᡼Ȥ̣fml.pl 
뤿Υޥɥ饤󥪥ץ٤ޤץ
̤ config.ph ˤϵҤǤޤ
 --ctladdr Ͼäʤǲ

ޥѤΥޥ fmlcommand.pl ƤӽФ褦ˤƤƱȤǤ
ʣΥեݼ餹ΤϷʤΤǡFML 2.1 ʹߤǤ fml.pl Ѥ 
--ctladdr ǵưѤˤƤޤ
ˤꡢbackward ǽˤʤȤͳ⤢ޤ


		INDEX

--ctladdr                                  ...   4.5 
$debug                                     ...   2.1 
debug                                      ...   3.2 
debug: printf                              ...   3.3 
&DEFINE_MODE('mode')                       ...   4.4 
&DEFINE_SUBJECT_TAG                        ...   4.4 
--mode                                     ...   4.4 
ޥɥ饤Υ󥿥å               ...   4.1 
ޥɥ饤 ץ                  ...   4 
ǥХå⡼                             ...   2.1 
