[PREVIOUS CHAPTER] [NEXT CHAPTER]
4 Automatic Registration


4.1	Overview of Automatic Registration


From the first check in time of fml (1993), the design policy has been
same. The default policy is as follows:
	* A mailing list is a private communication.
	* Only members can post and use commands of ML.
	* Manually edit member lists.


* FML's automatic registration assumes that

FML member authentication follow.

	1 compare From: address and entries in @MEMBER_LIST 
	  which is composed of
		$FILE_TO_REGIST
		$MEMBER_LIST
		...

	2 If the address is already a member, O.K.

	3 If not a member, append the address to $FILE_TO_REGIST
	  which is the same as $MEMBER_LIST in default.

	4 notifies the registration to the requester and $MAINTAINER

In "confirmation" type, fml.pl asks the From: address's person on
confirmation of subscription request in stage 3. I RECOMMEND
"confirmation" type today against a trick.


"confirmation" type differs from others is a little. We explain this
in 5.9. We explain other types here.


* Address to regist
The target address to register is the address in From: or address in
subscription request (when $AUTO_REGISTRATION_TYPE is "subject" or
"body").

or


fml.pl does not consider Reply-To: field for the address to
regist. Not to use It must be safe. Reply-To: usage is invalid from
users to users today, so we cannot trust the field. For example a user
sends a request mail with Reply-To: $MAIL_LIST. It causes mail loop if
FML adds ML itself to a member. In fact FML checks loop possibility,
so does not add ML's.


* When a user is registered, fml.pl sends the welcome file back to
him/her.

	$WELCOME_FILE	= "$DIR/guide";	# could be "$DIR/welcome"
	$WELCOME_STATEMENT = 
	"Welcome to our $ML_FN\n You are added automatically\n";


The mail body is the file $WELCOME_FILE and the subject is
$WELCOME_STATEMENT.


$WELCOME_FILE is a welcome statement. The subject in default is

	Subject: Welcome to our (Elena ML)
	 You are added automatically


where $ML_FN = "(Elena ML)".

4.2	Enable Automatic Registration


If $PERMIT_COMMAND_FROM == "members_only" and mail (subscribe
request) comes from a not member, fml.pl calls
$REJECT_COMMAND_HANDLER function. In default $REJECT_COMMAND_HANDLER
is "reject", so fml.pl notifies denial of service for a not member.
If $REJECT_COMMAND_HANDLER == "auto_regist", fml.pl calls auto_regist
hander to sets in the automatic registration routine.


in config.ph(default)

	$MAIL_LIST                     = "elena\@$DOMAINNAME";
	$PERMIT_POST_FROM              = "members_only";
	$REJECT_POST_HANDLER           = "reject";

	$CONTROL_ADDRESS               = "elena-ctl\@$DOMAINNAME";
	$PERMIT_COMMAND_FROM           = "members_only";
	$REJECT_COMMAND_HANDLER        = "reject";


re-configured config.ph for automatic registration

	$MAIL_LIST                     = "elena\@$DOMAINNAME";
	$PERMIT_POST_FROM              = "members_only";
	$REJECT_POST_HANDLER           = "reject";

	$CONTROL_ADDRESS               = "elena-ctl\@$DOMAINNAME";
	$PERMIT_COMMAND_FROM           = "members_only";


	$CONTROL_ADDRESS               = "elena-ctl\@$DOMAINNAME";
	$PERMIT_COMMAND_FROM           = "members_only";


Now FML permits only members can post to ML and reject mail from a
not member. FML permits commands from a member and do automatic
registration for a subscriber request mail from a not member.


	$REJECT_POST_HANDLER           = "auto_regist";


enables that $MAIL_LIST can provide the service of automatic
registration.

4.3	Restriction On Addresses To Register

 
This $REGISTRATION_ACCEPT_ADDR variables can restrict registration
routine in both cases, remote-administration and automatic
registration. This variable cannot restrict "makefml add".


In default automatic registration routine can accept all addresses
except for $REJECT_ADDR. $REGISTRATION_ACCEPT_ADDR restricts
acceptable addresses to register in automatic registration.  This
restriction is used in such that you can accept only a domain users as
a ML member.

Example 1; accept subscribe request from domain.co.jp
	$REGISTRATION_ACCEPT_ADDR = 'domain.co.jp';

Example 2;
	$REGISTRATION_ACCEPT_ADDR = 'domain1.co.jp|domain2.co.jp';


4.4	Restrict persons who can post to ML assuming automatic registration


$REJECT_COMMAND_HANDLER can have a value 'auto_asymmetric_regist'. If
defined, FML uses delivery list controlled by automatic registration
and authentication list edited by hand (or makefml).


	elena/actives	delivery list (automatic registration)
	elena/members	authentication list (edit by hand)

4.5	Type Of Automatic Registration


	$AUTO_REGISTRATION_TYPE 


controls automatic registration type. The available configuration is
one of them:

	confirmation
	body
	subject
	no-keyword


See 5.9 for more details on confirmation type.

4.6	$AUTO_REGISTRATION_TYPE: no-keyword


NOT REQUIRE SPECIAL KEYWORDS NOR PROCEDURES. If From: is a new comer,
FML adds it to a member automatically. I have used this style for a
party ML since almost all articles for this ML are "I joined the
party." mails and this temporary ML is used for a few weeks.

	$AUTO_REGISTRATION_TYPE = "no-keyword";


	Extract an Email address from From: field, compare and register it
	to a member if it is a new comer. If you change the address to add 
	explicitly, you can use the syntax

		subscribe your-mail-address 


	The "subscribe" keyword is defined in

		$AUTO_REGISTRATION_KEYWORD


4.7	$AUTO_REGISTRATION_TYPE: subject


A keyword in Subject: is required. To use this type, please set

	$AUTO_REGISTRATION_TYPE = "subject";


The address to register comes from
	* address if "Subject: subscribe address"
   or
	* From: address if just "Subject: subscribe"


	If Subject: does not match this format, FML returns the error mail.

4.8	$AUTO_REGISTRATION_TYPE: body


A keyword in the mail body is required. To use this type, set  

	$AUTO_REGISTRATION_TYPE = "body";


The address to register comes from
	* address if the body is "subscribe address"
   or
	* From: address if the body has only "subscribe"


	If a request mail does not match this format, 
	FML returns the error mail.

4.9	$AUTO_REGISTRATION_TYPE: confirmation (RECOMMENDED)


If the type

	$AUTO_REGISTRATION_TYPE = "confirmation";


is defined, FML tries to verify the user (From: address)'s will.  FML
sends a confirmation mail back for a subscribe request. The flow is as
follows:

1	subscribe request


The subscribe request phrase is "subscribe Family-name First-Name".
This "subscribe" is defined as $CONFIRMATION_SUBSCRIBE.  We expect
this format causes psychological trick.


	Example: subscribe Ken'ichi Fukamachi


2	reply from fml server


A confirmation request mail is sent to From: address. If the user
agrees it, the user needs to send back a phrase

	confirm 84682771 Ken'ichi Fukamachi


This is "confirmation" request of the users'will and also against
From: fabrication. FML ignores citation, so e.g. ">confirm 84682771
Ken'ichi Fukamachi" is accepted.


In sending back, the confirmation mail includes $CONFIRMATION_FILE
($DIR/confirm in default).

3	confirmation 


If a use receives the confirmation request, he/she sends back a phrase


	confirm password(identifier) your name


to an address

	$CONFIRMATION_ADDRESS


In default $CONTROL_ADDRESS must be either listname-ctl or fmlserv.


If FML receives the confirmation, it adds From: address to a member.
"confirm" keyword is defined as $CONFIRMATION_KEYWORD.


If a user fails the confirmation, please try it again from the first
"subscribe" request. For example when you lost the confirmation
request mail (so you not have a password of confirmation), ...


If so, please start again by sending

	subscribe Ken'ichi Fukamachi


____________________________________________________________________________
user				server

subscribe		->	receives subscribe request 
			<-	confirmation request
				"confirm identifier name"

sends 			->	
"confirm identifier name"
				If "confirm identifier name" is valid
				automatic registration routine adds the 
				From: address.

			<-	send "you are added to this ML." mail
____________________________________________________________________________

4.10	&Confirm internal hook functions

	$CONFIRM_REPLAY_TEXT_FUNCTION		for test
	$CONFIRM_REPLAY_SUBJECT_FUNCTION	for subject


This function hook is to generate each subject and text in each phase
transition of confirmation routine. "unsubscribe confirmation"~is an
application of this function.


4.11	[fml 1.x, fml 2.x] File to use in automatic registration

[fml 3.0]
fml 3.0 always uses member lists as follows:

		actives		recipient list
		members		authentication list

[fml 1.x, 2.x]


Which file to regist in is defined 

	$FILE_TO_REGIST ($MEMBER_LIST in default)


$FILE_TO_REGIST is the same as $MEMBER_LIST in default. However
authentication is based on files defined in an array 

	@MEMBER_LIST


It is useful to split up delivery lists and authentication lists.  For
example, create "members-admin" and adds remote maintainers to
it. members-admin is included in @MEMBER_LIST, so FML authenticates
them even if members and actives do not exist. After this, all
operations can be done under remote administration.


In default fml.pl defines @MEMBER_LIST as

    @MEMBER_LIST = ($MEMBER_LIST, $ADMIN_MEMBER_LIST);


The default authentication lists cover member list and remote
maintainers list. It enables that you set up remote maintainers in the
first, and set up all other by remote.


Requests log is logged in

	$CONFIRMATION_LIST


The request is expired after

	$CONFIRMATION_EXPIRE


4.12	Forward a request mail to mailing list when automatic-ly added?


I want not to read only "subscribe" phrase mail;_; In default FML does
not forward subscribe request mails to ML itself but notifies "added"
to ML maintainers. If the type is "confirmation", it must be of no mean:)


It ie apparently independent between forwarding and which address to
regist. When you do not want forwarding, set 


	$AUTO_REGISTERED_UNDELIVER_P = 1;


Comment: when an address is AUTOmatic REGISTERED, UNDELIVER-PREDICATE ?;-)
Naming convention is historical.


Even when $AUTO_REGISTERED_UNDELIVER_P == 1, only "subscribe" mail is
not forwarded. Forwarding depends on the number of lines. The limit is
8, which is considered, 3 main lines + 1 null line + signature 4
lines. This parameter is defined in 


	$AUTO_REGISTRATION_LINES_LIMIT = 8; 


If lines > 8, forwarding is done. If <= 8, it is not forwarded.


If $AUTO_REGISTRATION_LINES_LIMIT = -1, all request mails are
forwarded.


4.13	+ trick; not member check nor automatic registration


Historically "+" trick technique has been existed. Today "permit
anyone to post" config is 

	$PERMIT_POST_FROM	= "anyone";


"permit anyone to use commands" config is

	$PERMIT_COMMAND_FROM	= "anyone";


4.14	One recipient address for plural sender addresses when auto registration

One recipient address is fukachan@phys.titech.ac.jp but you can post
from plural senders e.g. fukachan@phys.titech.ac.jp,
elena@phys.titech.ac.jp, Pollyanna@phys.titech.ac.jp.

If member check mode == not automatic registration, $MEMBER_LIST is
for authentication, $ACTIVE_LIST is for delivery. Hence $ACTIVE_LIST
has fukachan@phys.titech.ac.jp, $MEMBER_LIST contains fukachan, elena
and Pollyanna.

In automatic registration mode, $MEMBER_LIST == $ACTIVE_LIST.  So
asymmetric list is not available in this mode.  When automatic
registration mode, in the member list (authentication list) you can
write in the following:

	fukachan@phys.titech.ac.jp
	# 3lena@phys.titech.ac.jp	
	# Pollyanna@phys.titech.ac.jp


fukachan@phys.titech.ac.jp	matome


4.15	Automatic registration fails for request mails from localhost


FML accepts From: user@domain form not From: user without domain.  It
is based on RFC822, in which not user@domain address is invalid.


$PeerAddr which log smtp connection source address may be also
available if you permit user form within localhost smtp connection.


* hack sendmail.cf. For example, in rule set 10 


R$+			$@$1<@$S>			user w/o host


[sendmail.cf Example]

S10
R<@>			$n				errors to mailer-daemon

# append local address
R$*			$:$>11 $1

S11
R$*<@$*>$*		$@$1<@$2>$3			already qualified

# output local host as user@host.domain
R$=S			$@$1<@$j>			show exposed names
R$+			$@$1<@$S>			user w/o host


* MH configuration


* force the requester to use "subscribe address" format. However this
is unavailable in "confirmation" type.


	subscribe uja@localhost-name.uja.jp 


* Hook adjustment (trick). It is not recommended. DO THIS BY YOUR OWN
  RISK.


$START_HOOK  = q#
	if ($From_address !~ /\@/) {
	}
#;


$START_HOOK  = q#
	if ($From_address !~ /\@/) {
		$From_address = "$From_address\@LOCAL_DOMAIN";
	}
#;


4.16	Delivery Mode In Automatic Registration


	address $AUTO_REGISTRATION_DEFAULT_MODE


can set the mode default configuration for From: address user. You
need to write $AUTO_REGISTRATION_DEFAULT_MODE using FML internal
representation.


* default is "skip"

	$AUTO_REGISTRATION_DEFAULT_MODE	= "s=1"; 


* default is digest delivery once in 3 hours, with file format
MIME/Multipart.

	$AUTO_REGISTRATION_DEFAULT_MODE	= "m=3mp"; 


4.17	$AUTO_REGISTRATION_HOOK


Example: a hook

$AUTO_REGISTRATION_HOOK = q#
    $e{'GH:Reply-To:'} = $MAINTAINER;
#;


Reply-To: $MAINTAINER for welcome mail when automatic registration.


[PREVIOUS CHAPTER] [NEXT CHAPTER]