Menu

FreeBSD problems with mailspool

Help
Peter Shih
2003-09-06
2003-09-07
  • Peter Shih

    Peter Shih - 2003-09-06

    I'm running FreeBSD 5.1 and I'm having trouble with users stored in my MySQL database receiving mail from the mailspool. It just gives me an error saying User Unknown. Is there a howto guide on the correct procedures to setup libnss-mysql in FreeBSD? Thanks.

     
    • Ben Goodwin

      Ben Goodwin - 2003-09-06

      Hrm.. please tell me that the /bin/mail (or whatever the local delivery agent is on FreeBSD) isn't statically linked (use 'file /path/to/program' to find out).  I'll fire up my copy and check into this as well.

       
    • Ben Goodwin

      Ben Goodwin - 2003-09-06

      I just tried a quick test with sendmail and the user 'cinergi' got mail fine.
      Have you restarted sendmail (or better, rebooted the system) since you installed libnss-mysql?

       
    • Peter Shih

      Peter Shih - 2003-09-07

      Hey i'm a bit confused myself. I'm relatively new to FreeBSD, but I do know how to get around and stuff. What I noticed was that there was no nsswitch.conf so I created one? I'm not really sure where the libnss-mysql.cfg file was placed, was it supposed to be in /etc or /usr/local/etc? I used the command mysql < sample_database.sql to setup mysql. User nss-user exists and has all privileges.

      Basically everything works (login, ftp, telnet) except users in the mysql database can't receive mail, and when I set chown for their homedirs or their /var/mail/username it shows their UID/GID instead of a name.

      Also is there anyway to automatically create a homedir and mailspool for users created in mysql or do i have to do this manually? and what is the correct procedure for entering new users and configuring them?

      Thanks in advance.

       
      • Ben Goodwin

        Ben Goodwin - 2003-09-07

        Hrm.. it's very possible /etc/nsswitch.conf isn't there by default.. From the looks of mine, it looks like I created it (has no comments or FreeBSD identification).  It looks like:

        hosts: files dns
        passwd: files mysql
        group: files mysql

        Are you saying mysql-based users work for login/ftp/telnet but not for sendmail?

        Using 'ls' to show ownership of files won't actually show the mysql users because the 'ls' program is statically linked :-(  Since dynamic NSS is new in FreeBSD there'll be a few problems like this that will crop up.. someone should take that issue to the maintainers.. that goes for any other static binaries that need user/group info.

        I know you can create a homedir upon login with the pam_mkhomedir module.. I'm not sure if that works in FreeBSD however.  The mailspool can't be created automatically.  I plan on writing an 'adduser' script that can create homedirs, mailspools, and do all the MySQL magic to create the user.  For now it's a manual process or a script of your own.

         

Log in to post a comment.