[Exim] very strange problem with NIS and localuser

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: KOEN BREUGELMANS
Data:  
Para: exim-users
CC: kbr
Asunto: [Exim] very strange problem with NIS and localuser
Ok, I posted this problem already on this list, but now I tried to do
some other things...

My setup is: I have one computer running Linux, which is connected to
Internet and receives mail for my domain sjc.dhis.org. There is
another computer (also Linux) which is connected to the first with a
network.
Now all the users of my school do have an entry in the /etc/passwd
file on the second computer. This file is shared over NIS (Network
Information System) to the first computer.

NIS is configured on the first PC, and the users can log in
succesfully. I made the following programm to asure that NIS
functioned with /etc/passwd:

=====
#include <stdio.h>
#include <pwd.h>
#include <sys/types.h>

int main (int argc, char *argv[])
{
struct passwd *pw;

  if(argc != 2)
  {
    fprintf(stderr, "Usage: getpwnam username\n");
    exit(1);
  }
  pw = getpwnam(argv[1]);
  if (pw != NULL)
  {
    printf("username:\t%s\n",pw->pw_name);
    printf("password:\t%s\n",pw->pw_passwd);
    printf("uid:\t%d\n",pw->pw_uid);
    printf("gid:\t%d\n",pw->pw_gid);
    printf("gecos field:\t%s\n",pw->pw_gecos);
    printf("homedir:\t%s\n",pw->pw_dir);
    printf("shell:\t%s\n",pw->pw_shell);
  } else
    fprintf(stderr, "User \"%s\" not found!\n", argv[1]);
  exit(0);
}
=====


Ok, when I run this,

first on a normal user (which got a 'real' line in /etc/passwd)
=====
kvack:~# ./getpwnam kbr
username:    kbr
password:    x
uid:    1000
gid:    1000
gecos field:    koen breugelmans,,,
homedir:    /home/kbr
shell:    /bin/bash
kvack:~#
=====


and then on a user which exists only on the second computer, and is
known on the first one using NIS:
=====
kvack:~# ./getpwnam test
username:    test
password:    x
uid:    1002
gid:    100
gecos field:    testgebruiker,,,
homedir:    /home/users/test
shell:    /bin/nologin
=====


Ok, it seems to me that this is working like it should.


Now, the exim part...
For local delivery, exim looks up the user using the getpwnam()
function (at least this is what I read in the documentation). The
programm I used to show wheter NIS works, also uses getpwnam().
So I assume there is no difference...

But when I try to send mail to for example 'test' (the NIS user), I
get the following:

=====
kvack:~# echo -en "blabla\n.\n" | exim -d9 test@???
Exim version 3.03 debug level 9 uid=0 gid=0
probably Berkeley DB version 1.8x (native mode)
kvack.sjcnet in local_domains? no (end of list)
Actual local interface address is 127.0.0.1
Actual local interface address is 192.168.249.10
Actual local interface address is 62.112.3.215
user name "root" extracted from gecos field "root"
sender address = root@???
set_process_info: 15569 3.03 accepting a local non-SMTP message from
<root@???
his.org>
Sender: root@???
Recipients:
test@???
search_tidyup called
>>Original headers (size=6):


blabla
search_tidyup called
>>Final headers:

P Received: from root by kvack.sjcnet with local (Exim 3.03 #1
(Debian))
        id 11mEZi-000437-00
        for <test@???>; Fri, 12 Nov 1999 12:09:02 +0100
I Message-Id: <E11mEZi-000437-00@???>
F From: root <root@???>
T To: test@???
  Date: Fri, 12 Nov 1999 12:09:02 +0100


blabla
Data file written for message 11mEZi-000437-00
Writing spool header file
Size of headers = 286
LOG: 0 MAIN
<= root@??? U=root P=local S=294
exec /usr/sbin/exim -d9 -Mc 11mEZi-000437-00
Exim version 3.03 debug level 9 uid=8 gid=8
probably Berkeley DB version 1.8x (native mode)
kvack.sjcnet in local_domains? no (end of list)
Actual local interface address is 127.0.0.1
Actual local interface address is 192.168.249.10
Actual local interface address is 62.112.3.215
set_process_info: 15570 3.03 delivering specified messages
delivering message 11mEZi-000437-00
set_process_info: 15570 3.03 delivering 11mEZi-000437-00
Opened spool file 11mEZi-000437-00-H
user=root uid=0 gid=0 sender=root@???
sender_local=1 resent=no ident=root
Non-recipients:
Empty Tree
---- End of tree ----
recipients_count=1
body_linecount=1 message_linecount=7
Delivery address list:
test@???
locked /var/spool/exim/db/retry.lockfile
opened DB file /var/spool/exim/db/retry: flags=0
>>>>>>>>>>>>>>>>>>>>>>>>

Considering: test@???
sjc.dhis.org in local_domains? yes (matched sjc.dhis.org)
sjc.dhis.org in percent_hack_domains? no (end of list)
unique = test@???
dbfn_read: key=D:test@???
test@???: queued for directing
>>>>>>>>>>>>>>>>>>>>>>>>

directing test@???
real_local director skipped: prefix mismatch
calling system_aliases director
system_aliases director: lsearch key=test
file="/etc/aliases"
search_open: lsearch "/etc/aliases"
search_find: file="/etc/aliases"
key="test" partial=-1
LRU list:
6/etc/aliases
End
internal_search_find: file="/etc/aliases"
type=lsearch key="test"
file lookup required for test
in /etc/aliases
lookup failed
system_aliases director failed for test:
calling userforward director
userforward director failed for test (not a user)
calling localuser director
localuser director failed for test: no such user
post-process test@???
LOG: 0 MAIN
** test@???: unknown local-part "test" in domain
"sjc.dhis.org"
>>>>>>>>>>>>>>>>>>>>>>>>

After directing:
  Local addresses:
  Remote addresses:
  Failed addresses:
    test@???
  Addresses to be routed:
  Deferred addresses:
search_tidyup called

>>>>>> Local deliveries >>>>>>

search_tidyup called
>>>>>> Remote deliveries >>>>>>

set_process_info: 15570 3.03 tidying up after delivering
11mEZi-000437-00
Processing retry items
Succeeded addresses:
Failed addresses:
test@???: no retry items
Deferred addresses:
end of retry processing
sending error message to: root@???

...(and then it sends the error message)
=====

Ok, the localuser director failed...
and this is what I don't understand... it uses getpwnam(), which works
like it should, and still localuser don't works. (PS it does works for
users listed in /etc/passwd on the system itself, like 'kbr' in the
first example...).

Finally, the lines in my /etc/exim.conf for localuser and
local_delivery:

=====
local_delivery:
driver = appendfile
group = mail
mode = 0660
mode_fail_narrower = false
envelope_to_add = true
file = /var/spool/mail/${local_part}

...

localuser:
driver = localuser
transport = local_delivery
=====


If somebody can help me , I would like to hear about it...
Thank you very much...

Greetings
Koen Breugelmans