#64 allow mail feature to be configurable
Opened by sakib. Modified

Creating a new user on a embedded system that does not have /var/mail or /var/spool/mail/ directory results in an error, however, checking /etc/passwd file we can see that the user was in fact created, see below:
......
root@intel-x86-64:~# rpm -qa | grep libuser
libuser-0.64-r0.corei7_64
root@intel-x86-64:~#
root@intel-x86-64:~# luseradd t1
Error creating mail spool: couldn't open `/var/mail/t1': No such file or directory
root@intel-x86-64:~# echo $?
8
root@intel-x86-64:~#
root@intel-x86-64:~# tail -n1 /etc/passwd
t1:x:1000:1000:t1:/home/t1:/bin/sh
root@intel-x86-64:~#
......
The above error is generated from file apps/luseradd.c:
/ If we don't have the the don't-create-home flag, create the user's
* home directory.
/
if (!dont_create_home) {
...
/ Create a mail spool for the user. /
if (lu_mail_spool_create(ctx, ent, &error) != TRUE) {
fprintf(stderr, _("Error creating mail spool: %s\n"),
lu_strerror(error));
result = 8;
goto done;
}
}

I also thought about enabling the dont_create_home flag, but I did not see any such option in the configure script. I am wary that not creating the home directory for the user might result in undesired side-effects.

I am, as a result, asking for the mailing feature to be made configurable.


Metadata