Normally I get the hint "You have new mail", when I log in and there are new mails in /var/mail for my account (bash shell). But not with DietPi v6.33.3 (running on a ZeroPi).
I've set in my /etc/bash.bashrc the follwing environment variables:
I do not expect any mail. The mail is already sitting in /var/mail. I just want the bash shell to give me a notification, when I log in.
Under Raspbian-Buster I get this notification, but not with DietPi. Both use the same configurations in /etc/bash.bashrc and /etc/pam.d/login (see my original post).
What configuration and/or package do I need, to get the same behaviour as in Raspbian-Buster?
still I don't get what mails you are expecting to see. Quite confusing that you don't expect a mail but you are looking for a mail notification. DietPi is a diet version of Raspberry OS with reduced amount of packages. Probably this functionality is not availably as the package was removed.
Maybe @MichaIng knows what you are looking for
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
If you don't understand my problem, you should read the bash man page (especially the chapter about the environment variables MAIL and MAILCHECK).
MAIL
If this parameter is set to a file or directory name and the MAILPATH variable is not set, bash informs the user of the arrival of mail in the specified file or Maildir-format directory.
MAILCHECK
Specifies how often (in seconds) bash checks for mail. The default is 60 seconds. When it is time to check for mail, the shell does so before displaying the primary prompt. If this variable is unset, or set to a value that is not a number greater than or equal to zero, the shell disables mail checking.
The above mentioned environment variables are correctly set and pam loads the module pam_mail.so, but the bash shell does not behave as expected (as it does with Raspbian-Buster). I think, something is broken or missing in DietPi.
Linux rpi 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l
No mail.
Last login: Fri Feb 12 18:38:51 2021 from 10.91.25.13
With DietPi the first output line after the ssh command is the command prompt of the remote host. Maybe it's related to the missing "You have new mail" message.
Ah lol, probably it's simply overwritten/moved up by the login banner. Did you try to scroll up to see if the mail hint is shown above the DietPi banner?
/etc/issue[.net] are btw not shown "after" the login, but before the login credentials prompt. On boot, we have an own login prompt which is printed after /etc/issue print. It's on the list to merge this, so that the little extra info are added/updated in /etc/issue itself. However, on a new login prompt, like a dedicated TTY or logging out from console, /etc/issue is shown as expected.
/etc/motd is what is shown after login, but it's moved up into scroll buffer by the DietPi banner. Probably we should find a way to do it the other way round, print DietPi-Banner first and /etc/motd (+ other info like mail hints) afterwards, or merge our banner into /etc/motd, if it supports colour codes .
I've installed libpam-systemd, but it didn't change anything. I get no hint "You have new mail".
During the last days I created on a new sdcard a plain vanilla armbian system. Et voilà : I get the hint "You have new mail".
I suppose, that the DietPi configuration on top of the armbian system has broken this regulary behaviour.
Regarding the /etc/issue[.net] issue I noticed, that DietPi uses dropbear as SSH server, while Raspbian-Buster uses OpenSSH. In DietPi's dropbear configuration the output of /etc/issue[.net] was disabled. That's the reason for the different behaviour.