6

I have compiled alpine 2.20 with option --with-passfile=/home/fuji/.alpine.pwd and when I type the imap password of gmail, I get my mails but when it comes to save the password, i get the following debug messages:

14:05:34.653790
Looking for passfile "/home/fuji/.alpine.pwd"

14:05:34.655538
q_status_message(Attempting to encrypt password file)

14:05:34.656276
q_status_message(Refusing to write non-encrypted password file)

14:05:34.656322
IMAP DEBUG 14:05:34.656322: <suppressed>

and

ll ~/.alpine.pwd
-rw------- 1 fuji opera 0 Dec 20 17:42 .alpine.pwd

How can I save that password?

Thanks.

Michael Mrozek
  • 91,316
  • 38
  • 238
  • 232
Fuji San
  • 395
  • 2
  • 6
  • 15
  • Well, your `--with-passfile` option is wrong, it's supposed to be relative to your home dir, so just `--with-passfile=.alpine.pwd`. Not sure if that's the cause, though. – derobert Dec 21 '16 at 14:20
  • 1
    No, absolute path is fine. I had to create a ssl certificate and install the file in ~/.alpine-smime/private, ~/.alpine-smime/public and ~/.alpine-smime/ca. Only then will the imap password be saved in .alpine.pwd . – Fuji San Dec 21 '16 at 15:46
  • @FujiSan Nice find! Could you please [answer this question yourself](http://unix.stackexchange.com/help/self-answer) and close it? Thanks! – Gaurav Dec 26 '16 at 23:11

4 Answers4

2

I had to create a ssl certificate and install the file in ~/.alpine-smime/private, ~/.alpine-smime/public and ~/.alpine-smime/ca. Only then will the imap password be saved in .alpine.pwd .

Fuji San
  • 395
  • 2
  • 6
  • 15
2

For me it works (with the Debian standard build version 2.20), using the commandline flag -passfile.

touch .yourpassfile
alpine -passfile .yourpassfile

After giving your password for IMAP authentication it will now ask you if you want to save this to the given passfile. Say Y. Now everytime run alpine with the command above (or make a shortcut for it) and it will automatically authenticate to your IMAP server.

nobody
  • 21
  • 2
1

Alpine needs an ssl certificate to save passwords. Here's what I did to make it work (careful, change the pass:x value to something you consider secure; you can also omit the argument and type it when requested. Alpine will ask you some times for this password).

cd
touch .pine-passfile
mkdir ~/temp-ssl
cd ~/temp-ssl
openssl genrsa -des3 -passout pass:x -out server.key 1024
openssl req -new -passin pass:x -key server.key -out server.csr
openssl x509 -req -passin pass:x -days 3650 -in server.csr -signkey server.key -out server.crt
mkdir -p ~/.alpine-smime/private ~/.alpine-smime/public ~/.alpine-smime/ca
mv server.key ~/.alpine-smime/private
cp server.crt ~/.alpine-smime/ca
mv server.crt ~/.alpine-smime/public
rm server.csr
cd
rmdir ~/temp-ssl

For the second openssl command you have to enter at least one field, like the Country Name. You can leave the Challenge Password field empty when asked by the end of that same command.

This time Alpine should save your credentials.

Andres
  • 121
  • 3
  • 2
    This doesn't seem to be a complete answer. It still refuses to write the password file. – rgov Feb 03 '20 at 15:56
0

I found it depends on the correct compiled passfile name to use. To find out, issue

$ alpine -version

[..]
--with-passfile=.alpine.passfile
[...]

So touch ~/.alpine.passfile. Then reopen alpine, enter password. It will prompt for saving it.

KFL
  • 259
  • 1
  • 10