Linux command
pam_mail 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Check for new mail
session optional pam_mail.so
Show standard mail path
session optional pam_mail.so standard
Custom mail directory
session optional pam_mail.so dir=~/Maildir
Quiet on empty
session optional pam_mail.so quiet
Suppress new-mail check (login MOTD only)
session optional pam_mail.so nopen
说明
pam_mail notifies users of new mail. Checks mail spool at login. The module displays mail notifications. Session login feature.
参数
- dir=_PATH_
- Mail directory (overrides the MAIL environment variable).
- standard
- Use the standard mail spool location.
- close
- Also print a notice at session close if new mail has arrived.
- empty
- Report even when the mailbox is empty.
- hash=_N_
- Look in N hashed subdirectories under `dir` (for sites with hashed spools).
- nopen
- Do not inspect any mailboxes on login (suppresses the status message).
- noenv
- Do not export the `MAIL` environment variable.
- quiet
- Only report if there is new mail (no "no mail" message).
FAQ
What is the pam_mail command used for?
pam_mail notifies users of new mail. Checks mail spool at login. The module displays mail notifications. Session login feature.
How do I run a basic pam_mail example?
Run `session optional pam_mail.so` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does dir=_PATH_ do in pam_mail?
Mail directory (overrides the MAIL environment variable).