A Pine password file is a small plain-text file, conventionally named .pinepass, that holds the password (or a list of passwords) the Pine email client tries when it needs to authenticate to a mail server. You create it by making a text file in your home directory containing each candidate password on its own line, then restricting its permissions to owner-only (mode 600 on Unix-like systems) so other users can't read it. The file is optional and only works in configurations where Pine reads it automatically—typically a local mailbox or Unix mail spool—so the first condition to check is whether your setup actually uses it.

Pine, the text-based mail and news client that began at the University of Washington, has been superseded by Alpine, its actively maintained successor. Both programs share the same configuration lineage and the same broad approach to credential files, so the steps below apply to either, though exact prompts and environment behavior vary by version. This guide covers how the file is structured, how to create and lock it down, how to make Pine or Alpine look for it, and where the approach quietly fails.

What Problem the Password File Solves

When Pine opens a mailbox on a mail server—via IMAP or POP—it needs a password. Normally it either prompts you interactively or relies on the server accepting a passwordless login (for example, a local spool where your Unix account is already authenticated). Passing -p on the command line lets you supply a password for that session, but typing it into a terminal has obvious downsides: it lands in your shell history and can be visible on screen. The .pinepass file is a way to pre-stage one or more passwords so authentication happens without typing, while keeping them in a file whose permissions you control.

The trade-off is straightforward: you're storing a credential in plain text on disk. That makes the file permission settings the single most important part of the whole exercise. If you can't keep the file readable only by you, the file isn't worth using—overwrite the password interactively instead.

Prerequisites to Confirm First

Before creating anything, verify four things, because getting these wrong produces a file that looks right and does nothing.

Which client you're running. Run pine -v or alpine -v to see the version banner. The two programs are close relatives, but configuration paths and some prompts differ, and guides written for one may not match the other exactly. Whether your server accepts tried passwords at all. The .pinepass mechanism is associated with local mail access and Unix mail spools rather than being a general drop-in for every IMAP server. If you're connecting to a remote IMAP service that requires interactive authentication each time, the file won't trigger and you'll need another credential method—OAuth for providers that require it, for instance. Your home directory. The file is conventionally placed at ~/.pinepass. Confirm the path of your home directory with echo $HOME so you're writing to the right place, especially if you work on shared or multi-account systems. Whether a file already exists. Run ls -l ~/.pinepass. If something is already there, don't overwrite it blindly—read the file, because it may already contain passwords you'd be destroying.

If any of these checks leaves you unsure whether the mechanism applies to your setup, stop here and use interactive password entry. The file can't add capability your mail configuration doesn't already have.

Step-by-Step: Creating the File

The actions below assume a Unix-like environment (Linux, macOS, or a BSD) where Pine or Alpine is installed.

1: Create the file with safe permissions from the start. Rather than creating it normally and fixing permissions afterward, create it in a way that is private from the first byte:

(umask 077; touch ~/.pinepass)

The umask 077 makes the new file mode 600—readable and writable only by you. Running the commands in a subshell means the restrictive mask doesn't affect anything else you do in that terminal session. Check with ls -l ~/.pinepass; the permissions column should read -rw-------.

2: Add each candidate password on its own line. Open the file in an editor and type one password per line, nothing else:

vi ~/.pinepass

or

nano ~/.pinepass

Save with a trailing newline after the final password—editors do this by default, and it avoids the last entry being merged or truncated depending on how the client reads the file.

3: Save and close. If you used vi, press Esc, type :wq, and press Enter. With nano, press Ctrl-O then Enter to write, then Ctrl-X to exit.

4: Confirm the contents and permissions. Run wc -l ~/.pinepass to count lines—this should equal the number of passwords you entered—and ls -l ~/.pinepass again to confirm the mode is still 600. If the mode is anything like 644 or 664, fix it immediately with chmod 600 ~/.pinepass.

5: Test authentication with the client. Start Pine or Alpine and open the mailbox that requires the password. Watch whether it authenticates without prompting. If it still prompts, note which account and server it's contacting—that tells you whether the file is being consulted for that specific configuration.

Check your work

Success looks like this: the file has exactly as many lines as passwords you intended, permissions read 600, and the client authenticates to the targeted mailbox without an interactive prompt. Failure signals worth taking seriously include a repeated password prompt, an authentication error after an attempt (which suggests the password in the file is wrong, not that the file is missing), or a warning from the client that it cannot read the password file—a permissions or path problem.

How Pine and Alpine Consume the File

Understanding the mechanism explains both why it works and when it won't. The client reads the password file only in specific authentication contexts, and it tries entries in the order they appear, stopping at the first that succeeds. That's why multiple lines are allowed: you might have different passwords for different accounts on the same system, or you might have rotated a password and want the old one kept temporarily as a fallback.

Two behaviors follow from this. First, ordering matters; put the password you expect to work first so the client doesn't waste failed attempts. Second, a wrong password in the file is not usually dangerous in itself—a failed authentication attempt is simply refused—but repeated failed attempts against some servers trigger lockout or rate-limiting policies, so don't stuff the file with guesses. Treat each line as a password you genuinely believe might be correct.

If you pass a password on the command line with -p, that takes precedence for that invocation and the file is not the deciding factor. This is useful for one-off testing without committing anything to disk permanently.

Securing the File: Permissions, Backups, and Traps

The file is only as private as its permissions and the environment around it. A few practical rules keep the arrangement sound.

Permissions are the whole security model. Mode 600 means only your user account can read or write it. If the file sits on a system where other users have root access, they can read it regardless—which is a reason not to use this approach on machines you don't administer or fully trust.

Backups and sync tools will copy it. A home-directory backup, a dotfile repository, or a cloud sync folder that covers your home directory will sweep up .pinepass along with everything else, moving your plain-text password to another location with possibly weaker controls. Before creating the file, think about what reads your home directory, and exclude the file from those processes.

Editors and shells can leak it. Shell history doesn't capture the file's contents if you use an editor, but pasting a password into a command line does. Use the editor route rather than echo 'password' > ~/.pinepass, which is both a history leak and a permissions hazard if the shell's umask is loose.

Plain text is plain text. No amount of permission discipline turns this into encryption at rest. If the credential is valuable and you need at-rest protection, the right answer is a credential manager that hands the password to the client, not a file in your home directory.

When the File Doesn't Work: A Troubleshooting Order

Start with the most reversible checks, and stop short of changes that touch server-side authentication policy.

1: Re-read the permissions. ls -l ~/.pinepass should show -rw-------. A group- or world-readable file is the most common cause of a client refusing to use it. 2: Confirm the path. The client looks in your home directory. If you run it under a different user—through sudo, a service account, or a cron job with a different HOME—the file it checks is that user's, not yours. Inspect with echo $HOME while running as the same account that starts the client. 3: Check for invisible characters. Passwords pasted from a document can carry carriage returns or trailing spaces. Open the file and verify line endings are plain newlines; a stray \r turns a correct password into a wrong one. 4: Test the client directly. Start Pine or Alpine in a terminal and open the mailbox. The prompt behavior tells you whether the file is consulted at all; an immediate authentication failure means the password itself is wrong. 5: Confirm the server accepts the mechanism. If the client prompts every time despite a correct, private file, your configuration likely isn't one where the password file applies—common with remote IMAP services requiring interactive or provider-specific authentication. At this point, stop and consult your mail administrator or provider documentation rather than experimenting with server settings; authentication policy is not something to guess at.

Stop condition: if accounts begin locking after repeated attempts, stop testing immediately and reset the credential through your provider's official channel. Continuing to retry against a lockout policy makes the situation worse.

Pine, Alpine, and the Modern Credential Landscape

Pine is no longer actively developed, and modern mail providers have largely moved away from simple password authentication toward OAuth-based sign-in, app-specific passwords, or token mechanisms. That shift matters for anyone reaching for .pinepass: the file works in the mode where the client is responsible for supplying a password to a server that accepts one, and it does nothing to help you satisfy a provider that demands an interactive OAuth flow. If you're setting up mail today and your provider requires OAuth, the password file isn't the right tool, and no amount of correct file creation will substitute for the provider's required flow.

Within its lane, though, the mechanism is simple and dependable: one password per line, owner-only permissions, a client that reads it. That's the entire recipe, and the checks in this guide are the difference between a file that quietly authenticates you and one that sits in your home directory doing nothing.

Frequently Asked Questions

Can I have multiple passwords in one .pinepass file?

Yes. One password per line, tried in order, with the first success ending the attempt. Keep the expected-correct password first and avoid piling in guesses that could trip lockout policies.

Does the file work with IMAP servers or only local mail?

Its documented use centers on local mailbox and Unix spool authentication. Remote IMAP setups often don't consult it, and providers using OAuth or app-specific passwords require a different mechanism entirely. Verify your server's behavior rather than assuming.

What happens if someone else reads the file?

They have your password. The file is plain text; mode 600 is the only protection. If permissions have ever been looser than owner-only, treat the password as exposed and rotate it.

Can I keep the password out of the file and still avoid typing it?

Yes—use the interactive prompt, or on setups that support it, a credential manager that supplies the secret at authentication time. The .pinepass file is one option among several, not a requirement.