map-storage

Look for changes in the file CHANGES.

The map-storage is included in the map-regex distribution.

How to install

  1. copy map_storage to sendmail-?.?.?/src.
  2. Apply the conf.c.patch
  3. Edit your Makefile in sendmail-8.8.?/src/Makefiles/
    DBMDEF= -DMAP_STORAGE ...
    
    # additional .o files needed
    OBJADD=map_storage.o ...
    
  4. ./makesendmail (if it does not work "rm -r src/obj*")
  5. Test: ./sendmail -d73 -bt -Ctest_sendmail.cf
  6. Send bug-reports to: Jan.Krueger+map@stud.uni-hannover.de

How does it work

It knows the following options in K-Line: It knows the following options in lookup ($@):

Examples

Define a map-storage:
Kfriend storage STARTUP_VALUE
Store a value:
...
R$*		$: $(spam_friends $1 $)
R$*@SPAMFRIEND	$: $(friend YES $)
...
Lookup a value:
...
R$*	$: $(friend $)
RYES	$@ is_friend
...
Clear the storage
...
R$*	$: $(friend $@ c $)
...
Match local subnets:
# file containing IPs in "binary" format @ = 1, . = 0
# e.g. 130.75.128.0/255.255.128.0 = @.....@..@..@.@@@
F{localsubnets}/etc/mail/localsubnets

Kip2bin storage

...
R$*			$: $(ip2bin $&{client_addr} $@ b $)
R$={localsubnets}$* 	$@ ok_is_local
...
Add a header-field
Kspam_head -hX-Spam-Header

...
R@JUNK		$: $(spam_head is_junk $)
...
Add no header-field, if it's no spam
Kspam_head -hX-Spam-Header is_junk

...
R$*		$@ $(spam_head $@ c $)

Jan Krüger, Jan.Krueger+map@stud.uni-hannover.de