Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7998039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:07:04+00:00 2026-06-04T15:07:04+00:00

My main problem right now is that in gnus.el i got several mail sources

  • 0

My main problem right now is that in gnus.el i got several mail sources set in a manner like:

(setq mail-sources
  '((pop :server "server.org"
     :port 995
     :user "user@server.org"
     :password "pAssWorD")

I don’t want to store passwords in a plain text file like that. What i want is:

  1. Store passwords for Gnus mail sources in a separate file with strict permissions and encrypted using gpg.
  2. When using Emacs enter passphrase once and have these passwords automatically used when fetching mail.

What is the most idiomatic/efficient way to do that?

I’m also interested in any general ideas about password management in Emacs, be it just storing them somewhere in an encrypted files or having them managed for particular Emacs packages.

Emacs version: 24.0.97

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:07:06+00:00Added an answer on June 4, 2026 at 3:07 pm

    I couldn’t make .authinfo file work with POP3, so i followed the Keeping your secrets secret blogpost (thanks to phils for the link). I created three files in my load-path. secrets.el:

    (load-library "secrets.el.gpg")
    (provide 'secrets)
    

    secrets.el.gpg:

    (setq password-alist
          '((:mbox1 . "pAsSwOrD")
            (:mbox2 . "correct horse battery staple")
            (:mbox3 . "qwfpgj")))
    

    mail.el:

    (defun load-mail-passwords ()
      "Load passwords for mail sources from secrets.el.gpg"
      (require 'secrets)
      (setq mail-sources
        `((pop :server "pop.server.org"
               :port 995
               :user "user@server.org"
               :password ,(rest (assoc :mbox1 password-alist)))
          ))
      (setq smtpmail-auth-credentials `(("smtp.server.org" "465" "user@server.org"
                                         ,(rest (assoc :mbox1 password-alist))))))
    (add-hook 'gnus-load-hook 'load-mail-passwords)
    

    And i also put (load "~/.emacs.d/mail.el") to my init file, because for some reason my ~/.emacs.d/ folder in load-path wasn’t being loaded automatically.

    The backtick is like apostrophe (quote), but it allows some expressions to be unquoted using comma. The (rest (assoc :keyword alist)) combination is to get the second part of the dotted pair in association list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm still with ndk-gdb, now trying to solve the main problem that leaded me
Here is the problem that I am dealing with right now with my Android
I'm trying to make a simple blog like page. And my main problem right
Can't understand what is a problem here: I have got main.cpp file where I
I have a reasonably complex layout problem: I would like to have a main
The web application that I am developing right now has something called quiz engine
Right now, my main just calls a gui with 10 rows. Based on how
I have got my self into a problem. I have a PreferenceManager that keeps
Right now I'm having a weird problem with my own written session class, the
I'm having a problem right now with a project I'm trying to build in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.