{
    "mode": "man",
    "parameter": "pam_mail",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/pam_mail/8/json",
    "generated": "2026-06-03T01:36:37Z",
    "synopsis": "pammail.so [close] [debug] [dir=maildir] [empty] [hash=count] [noenv] [nopen] [quiet]\n[standard]",
    "sections": {
        "NAME": {
            "content": "pammail - Inform about available mail\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pammail.so [close] [debug] [dir=maildir] [empty] [hash=count] [noenv] [nopen] [quiet]\n[standard]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The pammail PAM module provides the \"you have new mail\" service to the user. It can be\nplugged into any application that has credential or session hooks. It gives a single message\nindicating the newness of any mail it finds in the user's mail folder. This module also sets\nthe PAM environment variable, MAIL, to the user's mail directory.\n\nIf the mail spool file (be it /var/mail/$USER or a pathname given with the dir= parameter) is\na directory then pammail assumes it is in the Maildir format.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "close",
                    "content": "Indicate if the user has any mail also on logout.\n"
                },
                {
                    "name": "debug",
                    "content": "Print debug information.\n\ndir=maildir\nLook for the user's mail in an alternative location defined by maildir/<login>. The\ndefault location for mail is /var/mail/<login>. Note, if the supplied maildir is prefixed\nby a '~', the directory is interpreted as indicating a file in the user's home directory.\n"
                },
                {
                    "name": "empty",
                    "content": "Also print message if user has no mail.\n\nhash=count\nMail directory hash depth. For example, a hashcount of 2 would make the mail file be\n/var/spool/mail/u/s/user.\n"
                },
                {
                    "name": "noenv",
                    "content": "Do not set the MAIL environment variable.\n"
                },
                {
                    "name": "nopen",
                    "content": "Don't print any mail information on login. This flag is useful to get the MAIL\nenvironment variable set, but to not display any information about it.\n"
                },
                {
                    "name": "quiet",
                    "content": "Only report when there is new mail.\n"
                },
                {
                    "name": "standard",
                    "content": "Old style \"You have...\" format which doesn't show the mail spool being used. This also\nimplies \"empty\".\n"
                }
            ]
        },
        "MODULE TYPES PROVIDED": {
            "content": "The session and auth (on establishment and deletion of credentials) module types are\nprovided.\n",
            "subsections": []
        },
        "RETURN VALUES": {
            "content": "PAMBUFERR\nMemory buffer error.\n\nPAMSERVICEERR\nBadly formed arguments.\n\nPAMSUCCESS\nSuccess.\n\nPAMUSERUNKNOWN\nUser not known.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "Add the following line to /etc/pam.d/login to indicate that the user has new mail when they\nlogin to the system.\n\nsession  optional  pammail.so standard\n\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pam.conf(5), pam.d(5), pam(7)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "pammail was written by Andrew G. Morgan <morgan@kernel.org>.\n\n\n\nLinux-PAM Manual                             06/08/2020                                  PAMMAIL(8)",
            "subsections": []
        }
    },
    "summary": "pammail - Inform about available mail",
    "flags": [],
    "examples": [
        "Add the following line to /etc/pam.d/login to indicate that the user has new mail when they",
        "login to the system.",
        "session  optional  pammail.so standard"
    ],
    "see_also": [
        {
            "name": "pam.conf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/pam.conf/5/json"
        },
        {
            "name": "pam.d",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/pam.d/5/json"
        },
        {
            "name": "pam",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/pam/7/json"
        }
    ]
}