Unexistent user

Christian Schulte cs at schulte.it
Sat Apr 26 19:04:48 EDT 2003


dimon at intellinetinc.com wrote:

>Quoting Igor Brezac <igor at ipass.net>:
>
>  
>
>>If you have define(`_VIRTUSER_STOP_ONE_LEVEL_RECURSION_', `1')dnl and a
>>mailertable entry for domain.com, this will work.
>>
>>    
>>
>
>I did that and that's what I've got:
>
>Mar 31 16:45:21 mail sm-mta[90664]: h2VNjL2r090664: SYSERR(root): rewrite: map 
>macro not found
>
If you

define(`_VIRTUSER_STOP_ONE_LEVEL_RECURSION_', `true')dnl

you also have to

define(`_NEED_MACRO_MAP_',`1')dnl


I only needed that for sendmail-8.12.9. All other things seem to be ok. 
Of course my setup differs from yours. Here is the main difference from 
my sendmail.mc. I copied the needed m4-files for debian to the right 
places and now build sendmail.cf and submit.cf myself.

bash-2.05a$ cat sendmail-8.12.9/cf/cf/sendmail.mc
define(`_USE_ETC_MAIL_')dnl
VERSIONID(`$Id: sendmail.mc, v 8.12.3-4 2003-04-24 02:30:20 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-mta')dnl
LOCAL_CONFIG
FEATURE(`masquerade_envelope')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`use_cw_file')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`redirect')dnl
FEATURE(`nouucp', `reject')dnl
FEATURE(`mailertable')dnl
FEATURE(`virtusertable')dnl
FEATURE(`dnsbl')dnl
FEATURE(`smrsh')dnl
include(`/etc/mail/tls/starttls.m4')dnl
define(`confLOCAL_MAILER', `cyrusv2')dnl
define(`confSEVEN_BIT_INPUT', `false')dnl
define(`confEIGHT_BIT_HANDLING', `mime')dnl
define(`confCHECK_ALIASES', `true')dnl
define(`_VIRTUSER_STOP_ONE_LEVEL_RECURSION_', `true')dnl
define(`_NEED_MACRO_MAP_',`1')dnl
MAILER_DEFINITIONS
MAILER(cyrusv2)dnl
MAILER(smtp)dnl

In order to use

define(`confLOCAL_MAILER', `cyrusv2')dnl

correctly (...make virtusertable and aliases expand correctly...) I have 
to patch cf/m4/proto.m4! This patch  (changes two lines and adds one 
line) influences heavily and makes sendmail recognize user at domain.tld a 
local user. I attached it ! It works for sendmail-8.12.9 but you should 
be warned that it changes the internal representation of sendmails local 
users to user at machinename or user at domain! After that I put all domains 
which are to be delivered locally into /etc/mail/local-host-names and 
have the full routing in virtusertable and aliases.

These two:

define(`_VIRTUSER_STOP_ONE_LEVEL_RECURSION_', `true')dnl
define(`_NEED_MACRO_MAP_',`1')dnl

have a huge influence on the meaning of the virtusertable. Here it goes:

virtusertable:

@cyrus-virtual-domain    otheruser at cyrus-virtual-domain
@local-domain.tld    localuser at cyrus-virtual-domain


LHS:
cyrus-virtual-domain and local-domain.tld are both local domains. They 
are both configured in local-host-names file

RHS:
These are both email accounts! They are both POP/IMAP logins also


If you do not make the above two definitions the behaviour is as follows:

-Mail arrives for something at local-domain.tld
-gets rewritten to  localuser at cyrus-virtual-domain
-gets rewritten to otheruser at cyrus-virtual-domain
-endlessly gets rewritten to otheruser at cyrus-virtual-domain

Does not work! So at some place you now change your virtusertable to:

@cyrus-virtual-domain    otheruser at cyrus-virtual-domain
@local-domain.tld    localuser at cyrus-virtual-domain
otheruser at cyrus-virtual-domain    otheruser at cyrus-virtual-domain


But that does not change the behaviour in rewriting!

-Mail arrives for something at local-domain.tld
-gets rewritten to  localuser at cyrus-virtual-domain
-gets rewritten to otheruser at cyrus-virtual-domain
-endlessly gets rewritten to otheruser at cyrus-virtual-domain

And now you have to add:

define(`_VIRTUSER_STOP_ONE_LEVEL_RECURSION_', `true')dnl

to your sendmail.mc which does exactly what it is named after! It 
influences rewriting in virtusertable to stop if an entry does recurse 
to itself which is not standard behaviour! In sendmail-8.12.9 one now 
has to also add

define(`_NEED_MACRO_MAP_',`1')dnl

to get it working correctly ! Hope this is helpful...

--Christian--
-------------- next part --------------
--- proto.m4.original	Sun Apr 27 01:00:00 2003
+++ proto.m4	Fri Apr 25 22:00:03 2003
@@ -1098,8 +1098,10 @@
 dnl $H empty (but @$=w.)
 R< > $+ + $* < $+ >	$#_LOCAL_ $: $1 + $2		plussed name?
 R< > $+ < $+ >		$#_LOCAL_ $: @ $1			nope, local address',
-`R$=L < @ $=w . >	$#_LOCAL_ $: @ $1			special local names
-R$+ < @ $=w . >		$#_LOCAL_ $: $1			regular local name')
+`R$=L < @ $=w . >	$#_LOCAL_ $: @ $1`@'$2			secial local names
+R$+ < @ $j . >		$#_LOCAL_ $: $1				leave untouched if @$j
+R$+ < @ $=w . >		$#_LOCAL_ $: $1`@'$2			regular local name')
+
 
 ifdef(`_MAILER_TABLE_', `dnl
 # not local -- try mailer table lookup


More information about the Info-cyrus mailing list