A notificação de email do AFAIK é uma função do shell, no bash, definindo a variável de ambiente MAIL e tem pouco ou nada a ver com o comando mailx
. Em uma casca diferente, ela pode funcionar de maneira diferente.
No meu sistema RHEL, ele é configurado em /etc/profile
com MAIL="/var/spool/mail/$USER"
Um eco simples $ MAIL mostrará se está definido ou não.
À primeira vista, ele só funciona com caixas de correio com estilo mbox e não com Maildir, onde cada mensagem é armazenada em um arquivo separado.
Na página de manual do bash:
MAIL If this parameter is set to a file name and the MAILPATH vari-
able is not set, bash informs the user of the arrival of mail in
the specified file.
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.
MAILPATH
A colon-separated list of file names to be checked for mail.
The message to be printed when mail arrives in a particular file
may be specified by separating the file name from the message
with a '?'. When used in the text of the message, $_ expands to
the name of the current mailfile. Example:
MAILPATH='/var/mail/bfox?"You have mail":~/shell-mail?"$_ has
mail!"'
Bash supplies a default value for this variable, but the loca-
tion of the user mail files that it uses is system dependent
(e.g., /var/mail/$USER).
No manual do csh, no mesmo sistema, parece minúscula
The mail shell variable can be set to check for new mail periodically.
e
mail The names of the files or directories to check for incoming
mail, separated by whitespace, and optionally preceded by a
numeric word. Before each prompt, if 10 minutes have passed
since the last check, the shell checks each file and says 'You
have new mail.' (or, if mail contains multiple files, 'You have
new mail in name.') if the filesize is greater than zero in
size and has a modification time greater than its access time.
If you are in a login shell, then no mail file is reported
unless it has been modified after the time the shell has
started up, to prevent redundant notifications. Most login
programs will tell you whether or not you have mail when you
log in.