1
1
I have a file in my Linux system that's called ".fetchmailrc" and it's used to configure the email address that fetchmail will get the mails from. Hence, I have to type my password and email address in plain text.
Here is how the .fetchmailrc file looks like:
set daemon 1
set logfile /home/user/.fetchmail.log
set no bouncemail
poll pop.gmail.com proto POP3 auth password no dns user "MY_EMAIL" password "MY_PASSWORD" is user keep ssl
mda "/usr/bin/procmail -d %T"
I believe there must be a better way to do this, since if a hacker get access to my server, he can easily read the file and get my credentials.
I heard that in Linux systems there is PAM (Pluggable Authentication Modules) but I don't know if that is related to what I'm trying to do.
getting fetchmail to use the kernel keyring might be a bit of work, though. – dirkt – 2018-12-05T12:15:09.077
It should accept a password some other way than as a command line argument (those are visible to everyone through
ps
). Accepting through a pipe / stdin is very common. – Xen2050 – 2018-12-05T12:20:55.337