SYNOPSIS

       qmail-mfrules



DESCRIPTION

       qmail-mfrules  reads the	addresses provided in /var/qmail/control/mail-
       fromrules,  converts  them  into	 lowercase,  and  writes   them	  into
       /var/qmail/control/mailfromrules.cdb  in	 a  binary  format  suited for
       quick access by qmail-smtpd.

       If there	is a problem with  control/mailfromrules,  qmail-mfrules  com-
       plains and leaves control/mailfromrules.cdb alone.

       qmail-mfrules  ensures that control/mailfromrules.cdb is	updated	atomi-
       cally, so qmail-smtpd never has to wait for  qmail-mfrules  to  finish.
       However,	qmail-mfrules makes no attempt to protect against two simulta-
       neous updates of	control/mailfromrules.cdb.

       The  binary  control/mailfromrules.cdb  format	is   portable	across
       machines.



RULE FORMAT

       A  rule is one line. A file containing rules may	also contain comments:
       lines beginning with # are ignored. All addresses are  evaluated	 case-
       insensitive.

       Each  rule  contains  an	 address, an ampersend sign '&', and a list of
       strings separated by commas to be used for 'Mail	From: Address  Verifi-
       cation'	(MAV).	When  qmail-smtpd(8)  receives	a connection from that
       address,	it checks whether the received envelope	sender address	corre-
       spondes with a MAV string (from the right to the	left).	The MAV	string
       for an address may be NULL  in  order  to  allow	 any  envelope	sender
       address.	NULLSENDER envelope addresses are not subject of the MAV.



RULE BASE

       qmail-smtpd(8)  looks for rules with various addresses in the following
       order:

       1      $TCPREMOTEINFO, if $TCPREMOTEINFO	is set (e.g. by	SMTP Authenti-
	      cation);

       2.     $TCPREMOTEINFO@$TCPREMOTEIP, if $TCPREMOTEINFO is	set;

       3.     $TCPREMOTEINFO@=$TCPREMOTEHOST,  if  $TCPREMOTEINFO  is  set and
	      $TCPREMOTEHOST is	set;

       4.     the dotted decimal $TCPREMOTEIP address;

       5.     the compactified $TCPREMOTEIP6 address;


       For example, here are some rules:

	 jsmith@virtualdomain.com&john.smith@virtualdomain.com
	 joe@18.23.0.32&joe@example.com
	 18.23&@example.com
	 =.heaven.mil&God@heaven.mil,st.peter@heaven.mil,-angles@heaven.mil
	 fe80:&user@myhost.local
	 2001::feh:abc9:&me@fehnet.com



IP-ADDRESSES

       qmail-mfrules recognizes	the dotted-decimal IPv4	and  the  compactified
       IPv6 addresses tokenized	by the 'dot' or	the 'colon' character and com-
       pares the respective parts from	right  to  left.   However,  the  CIDR
       address format is not supported (yet).




SEE ALSO

       qmail-smtpd(8)



				       8	       s/qmail:(qmail-mfrules)

Man(1) output converted with man2html