Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Password sending mail only once
@ 2009-10-08  6:24 Torben Knudsen
  2009-10-08  7:54 ` Richard Riley
  2009-10-08 19:24 ` Ted Zlatanov
  0 siblings, 2 replies; 7+ messages in thread
From: Torben Knudsen @ 2009-10-08  6:24 UTC (permalink / raw)
  To: info-gnus-english

Some time ago I was asked for a password when sending mail only the
first time in a gnus session.  Now I am asked every time I send a
mail.  

How can I get back to only given the password once?  

I prefer solutions with out storing password anywhere.  Given it once
is what I prefer.

I have found some info on the net but nothing I could handle with my
limited skills.

-- 
Associate Prof. Ph.D Torben Knudsen	Mobile	: (+45) 2787 9826
Section of Automation and Control,	Direct	: 6 8694
Department of Electronic Systems,	Email	: tk@es.aau.dk   
Aalborg University 
Fredrik Bajersvej 7 
DK-9220 Aalborg Ø
Denmark 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Password sending mail only once
  2009-10-08  6:24 Password sending mail only once Torben Knudsen
@ 2009-10-08  7:54 ` Richard Riley
  2009-10-10 13:44   ` Torben Knudsen
  2009-10-08 19:24 ` Ted Zlatanov
  1 sibling, 1 reply; 7+ messages in thread
From: Richard Riley @ 2009-10-08  7:54 UTC (permalink / raw)
  To: info-gnus-english


Torben Knudsen <tk@es.aau.dk> writes:

> Some time ago I was asked for a password when sending mail only the
> first time in a gnus session.  Now I am asked every time I send a
> mail.  
>
> How can I get back to only given the password once?  
>
> I prefer solutions with out storing password anywhere.  Given it once
> is what I prefer.
>
> I have found some info on the net but nothing I could handle with my
> limited skills.

With emacs 23 I have the following set up:

,----
| ;; encryption stuff
| (require 'auth-source)
| (require 'epa-file)
| (setq epa-file-cache-passphrase-for-symmetric-encryption t) ;;VERY Important
| (if (file-exists-p "~/.authinfo.gpg")
|     (setq auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t)))
|     (setq auth-sources '((:source "~/.authinfo" :host t :protocol t))))
| ;; no idea whats needed with mm2015 : the documentation is sparse
| (setq 
|       mml2015-encrypt-to-self t
|       mml2015-cache-passphrase t
|       mml2015-passphrase-cache-expiry 60
|       mml2015-verbose t)
`----

And in my gnus-posting-style something like

,----
| (setq gnus-posting-styles `((".*"
| 			    (name "Richard Riley")
| 			    (from "Richard Riley <riley-r-g@gmail.com>")
| 			    (eval(setq gnushush-user-agent-header (quote real)))
| 			    (signature-file "~/.emacs.d/.sigs/rgr.sig")
| 			    (eval (setq mml2015-signers '("b39d104a")))
| 			    (organization "aich tea tea pea dicky riley dot net"))))
`----

It's been a while since I went through to remove the wheat from the
chaff but the mml2025 (what!?) set are key for signing I think.

For caching the password my setup uses gpg-agent. The only messy thing I
found was the need to export the required environment variables in order
that things like emacs knew which cache process to talk to. For that I
used 

,----
| keychain && . $HOME/.keychain/$HOSTNAME-sh-gpg > /dev/null 2>&1 
`----

keychain takes care of using an existing agent or starting one if
necessary in .bash_env on my system. It might be unnecessary on a cleaner set
up. It caused quite a lot of frustration back when I got this
working. Hopefully enough to get you going,

regards

r.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Password sending mail only once
  2009-10-08  6:24 Password sending mail only once Torben Knudsen
  2009-10-08  7:54 ` Richard Riley
@ 2009-10-08 19:24 ` Ted Zlatanov
  2010-01-12 13:13   ` Torben Knudsen
  1 sibling, 1 reply; 7+ messages in thread
From: Ted Zlatanov @ 2009-10-08 19:24 UTC (permalink / raw)
  To: info-gnus-english

On Thu, 08 Oct 2009 08:24:04 +0200 Torben Knudsen <tk@es.aau.dk> wrote: 

TK> Some time ago I was asked for a password when sending mail only the
TK> first time in a gnus session.  Now I am asked every time I send a
TK> mail.  

TK> How can I get back to only given the password once?  

TK> I prefer solutions with out storing password anywhere.  Given it once
TK> is what I prefer.

TK> I have found some info on the net but nothing I could handle with my
TK> limited skills.

I think you want to `M-x customize-group password'

Specifically, `password-cache' and `password-cache-expiry'

This is, I believe, what's used by smtpmail.el if it can't get the
password from auth-source.  I encourage you to use auth-source instead,
though.  You'd be storing the password in a PGP-encrypted file and you
can use the same file for IMAP, POP3, NNTP, etc. passwords.

Ted

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Password sending mail only once
  2009-10-08  7:54 ` Richard Riley
@ 2009-10-10 13:44   ` Torben Knudsen
  2009-10-11  6:12     ` Richard Riley
  0 siblings, 1 reply; 7+ messages in thread
From: Torben Knudsen @ 2009-10-10 13:44 UTC (permalink / raw)
  To: info-gnus-english

Richard Riley <rileyrgdev@gmail.com> writes:

Thanks for the below advice.  I am a bit squared that it will take me
some time to make the below work for me.  Isn't there a simpler
solution?

> Torben Knudsen <tk@es.aau.dk> writes:
>
>> Some time ago I was asked for a password when sending mail only the
>> first time in a gnus session.  Now I am asked every time I send a
>> mail.  
>>
>> How can I get back to only given the password once?  
>>
>> I prefer solutions with out storing password anywhere.  Given it once
>> is what I prefer.
>>
>> I have found some info on the net but nothing I could handle with my
>> limited skills.
>
> With emacs 23 I have the following set up:
>
> ,----
> | ;; encryption stuff
> | (require 'auth-source)
> | (require 'epa-file)
> | (setq epa-file-cache-passphrase-for-symmetric-encryption t) ;;VERY Important
> | (if (file-exists-p "~/.authinfo.gpg")
> |     (setq auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t)))
> |     (setq auth-sources '((:source "~/.authinfo" :host t :protocol t))))
> | ;; no idea whats needed with mm2015 : the documentation is sparse
> | (setq 
> |       mml2015-encrypt-to-self t
> |       mml2015-cache-passphrase t
> |       mml2015-passphrase-cache-expiry 60
> |       mml2015-verbose t)
> `----
>
> And in my gnus-posting-style something like
>
> ,----
> | (setq gnus-posting-styles `((".*"
> | 			    (name "Richard Riley")
> | 			    (from "Richard Riley <riley-r-g@gmail.com>")
> | 			    (eval(setq gnushush-user-agent-header (quote real)))
> | 			    (signature-file "~/.emacs.d/.sigs/rgr.sig")
> | 			    (eval (setq mml2015-signers '("b39d104a")))
> | 			    (organization "aich tea tea pea dicky riley dot net"))))
> `----
>
> It's been a while since I went through to remove the wheat from the
> chaff but the mml2025 (what!?) set are key for signing I think.
>
> For caching the password my setup uses gpg-agent. The only messy thing I
> found was the need to export the required environment variables in order
> that things like emacs knew which cache process to talk to. For that I
> used 
>
> ,----
> | keychain && . $HOME/.keychain/$HOSTNAME-sh-gpg > /dev/null 2>&1 
> `----
>
> keychain takes care of using an existing agent or starting one if
> necessary in .bash_env on my system. It might be unnecessary on a cleaner set
> up. It caused quite a lot of frustration back when I got this
> working. Hopefully enough to get you going,
>
> regards
>
> r.
>

-- 
Associate Prof. Ph.D Torben Knudsen	Mobile	: (+45) 2787 9826
Section of Automation and Control,	Direct	: 6 8694
Department of Electronic Systems,	Email	: tk@es.aau.dk   
Aalborg University 
Fredrik Bajersvej 7 
DK-9220 Aalborg Ø
Denmark 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Password sending mail only once
  2009-10-10 13:44   ` Torben Knudsen
@ 2009-10-11  6:12     ` Richard Riley
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Riley @ 2009-10-11  6:12 UTC (permalink / raw)
  To: info-gnus-english


The basics of the password caching are bits with "cache" in them below -
as with all systems (well, Linux ones..) the devil is in the details of
how they deal with things like gpg-agent. Unfortunately Linux distros
tend to do things differently but the "same" kind of ... I battled like
hell with gpg-agent because of the way apps pick up how to talk to
it. 

Bottom line : you need a caching agent. Google up "password cache
agent" with your distro name and throw in emacs too and ...

The mml2015 stuff really confused me a while back because documentation
was thin on the ground and I really didnt know whether to use epa or
whatever. It was kind of in a transition phase at the time.

I suspect if you post your emacs version someone out there will have a
set up for you.

regards

r.



Torben Knudsen <tk@es.aau.dk> writes:

> Richard Riley <rileyrgdev@gmail.com> writes:
>
> Thanks for the below advice.  I am a bit squared that it will take me
> some time to make the below work for me.  Isn't there a simpler
> solution?
>
>> Torben Knudsen <tk@es.aau.dk> writes:
>>
>>> Some time ago I was asked for a password when sending mail only the
>>> first time in a gnus session.  Now I am asked every time I send a
>>> mail.  
>>>
>>> How can I get back to only given the password once?  
>>>
>>> I prefer solutions with out storing password anywhere.  Given it once
>>> is what I prefer.
>>>
>>> I have found some info on the net but nothing I could handle with my
>>> limited skills.
>>
>> With emacs 23 I have the following set up:
>>
>> ,----
>> | ;; encryption stuff
>> | (require 'auth-source)
>> | (require 'epa-file)
>> | (setq epa-file-cache-passphrase-for-symmetric-encryption t) ;;VERY Important
>> | (if (file-exists-p "~/.authinfo.gpg")
>> |     (setq auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t)))
>> |     (setq auth-sources '((:source "~/.authinfo" :host t :protocol t))))
>> | ;; no idea whats needed with mm2015 : the documentation is sparse
>> | (setq 
>> |       mml2015-encrypt-to-self t
>> |       mml2015-cache-passphrase t
>> |       mml2015-passphrase-cache-expiry 60
>> |       mml2015-verbose t)
>> `----
>>
>> And in my gnus-posting-style something like
>>
>> ,----
>> | (setq gnus-posting-styles `((".*"
>> | 			    (name "Richard Riley")
>> | 			    (from "Richard Riley <riley-r-g@gmail.com>")
>> | 			    (eval(setq gnushush-user-agent-header (quote real)))
>> | 			    (signature-file "~/.emacs.d/.sigs/rgr.sig")
>> | 			    (eval (setq mml2015-signers '("b39d104a")))
>> | 			    (organization "aich tea tea pea dicky riley dot net"))))
>> `----
>>
>> It's been a while since I went through to remove the wheat from the
>> chaff but the mml2025 (what!?) set are key for signing I think.
>>
>> For caching the password my setup uses gpg-agent. The only messy thing I
>> found was the need to export the required environment variables in order
>> that things like emacs knew which cache process to talk to. For that I
>> used 
>>
>> ,----
>> | keychain && . $HOME/.keychain/$HOSTNAME-sh-gpg > /dev/null 2>&1 
>> `----
>>
>> keychain takes care of using an existing agent or starting one if
>> necessary in .bash_env on my system. It might be unnecessary on a cleaner set
>> up. It caused quite a lot of frustration back when I got this
>> working. Hopefully enough to get you going,
>>
>> regards
>>
>> r.
>>

-- 
googletalk/jabber : rileyrgdev@googlemail.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Password sending mail only once
  2009-10-08 19:24 ` Ted Zlatanov
@ 2010-01-12 13:13   ` Torben Knudsen
  2010-01-13 21:31     ` Ted Zlatanov
  0 siblings, 1 reply; 7+ messages in thread
From: Torben Knudsen @ 2010-01-12 13:13 UTC (permalink / raw)
  To: info-gnus-english

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Thu, 08 Oct 2009 08:24:04 +0200 Torben Knudsen <tk@es.aau.dk> wrote: 
>
> TK> Some time ago I was asked for a password when sending mail only the
> TK> first time in a gnus session.  Now I am asked every time I send a
> TK> mail.  
>
> TK> How can I get back to only given the password once?  
>
> TK> I prefer solutions with out storing password anywhere.  Given it once
> TK> is what I prefer.
>
> TK> I have found some info on the net but nothing I could handle with my
> TK> limited skills.
>
> I think you want to `M-x customize-group password'
>
> Specifically, `password-cache' and `password-cache-expiry'
>
> This is, I believe, what's used by smtpmail.el if it can't get the
> password from auth-source.  I encourage you to use auth-source instead,
> though.  You'd be storing the password in a PGP-encrypted file and you
> can use the same file for IMAP, POP3, NNTP, etc. passwords.

I am trying the below

; To avoid password on sending begin
;; (require 'auth-source)
(require 'auth-source "/home/tk/Emacs/ngnus-0.10/lisp/auth-source")
;; ;(require 'epa-file "~/elisp/epa-file.el")
(require 'epa-file)
;; (epa-file-enable)
;; ;(setq gnus-verbose 10)
;; (setq epa-file-cache-passphrase-for-symmetric-encryption t) ; VERY important
;; ;(setq epa-file-cache-passphrase-for-symmetric-encryption-timeout 60)
;; (if (file-exists-p "~/.authinfo.gpg")
;;     (setq auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t)))
;;     (setq auth-sources '((:source "~/.authinfo" :host t :protocol t))))
; To avoid password on sending end

However, I didn't have auth-sources in my path so I changed to the
above.  Now also I don't have epa-file.el and I can't find it.  Where
can I download it ?

Moreover, is the above at all right?  I have just paste it from
somewhere but I dont really know what it is doing.

-- 
Associate Prof. Ph.D Torben Knudsen	Mobile	: (+45) 2787 9826
Section of Automation and Control,	Direct	: 6 8694
Department of Electronic Systems,	Email	: tk@es.aau.dk   
Aalborg University 
Fredrik Bajersvej 7 
DK-9220 Aalborg Ø
Denmark 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Password sending mail only once
  2010-01-12 13:13   ` Torben Knudsen
@ 2010-01-13 21:31     ` Ted Zlatanov
  0 siblings, 0 replies; 7+ messages in thread
From: Ted Zlatanov @ 2010-01-13 21:31 UTC (permalink / raw)
  To: info-gnus-english

On Tue, 12 Jan 2010 14:13:06 +0100 Torben Knudsen <tk@es.aau.dk> wrote: 

TK> Ted Zlatanov <tzz@lifelogs.com> writes:
>> On Thu, 08 Oct 2009 08:24:04 +0200 Torben Knudsen <tk@es.aau.dk> wrote: 
>> 
TK> Some time ago I was asked for a password when sending mail only the
TK> first time in a gnus session.  Now I am asked every time I send a
TK> mail.  
>> 
TK> How can I get back to only given the password once?  
>> 
TK> I prefer solutions with out storing password anywhere.  Given it once
TK> is what I prefer.
>> 
TK> I have found some info on the net but nothing I could handle with my
TK> limited skills.
>> 
>> I think you want to `M-x customize-group password'
>> 
>> Specifically, `password-cache' and `password-cache-expiry'
>> 
>> This is, I believe, what's used by smtpmail.el if it can't get the
>> password from auth-source.  I encourage you to use auth-source instead,
>> though.  You'd be storing the password in a PGP-encrypted file and you
>> can use the same file for IMAP, POP3, NNTP, etc. passwords.

TK> I am trying the below
... omitted for brevity ...
TK> ; To avoid password on sending end

Try this (I just put something like this together recently for Richard
Riley in this group):

(require 'epa-file)
(require 'auth-source)
(require 'cl)
(epa-file-enable)
(setq auth-source-debug t ; use `message' to log messages
      epa-file-cache-passphrase-for-symmetric-encryption t
      auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t)))
(auth-source-user-or-password "login" "yourserver.com" "smtp")

...but you need to have the ~/.authinfo.gpg file.  Do you?

If it's set up properly, the last line should give you the user name
you've specified in your authinfo file.  If you say "password" instead
of "login" you'll get the password.  See the auth-source Info manual
that comes with Emacs 23.1 and newer if you have trouble setting the
authinfo file up.

TK> However, I didn't have auth-sources in my path so I changed to the
TK> above.  Now also I don't have epa-file.el and I can't find it.  Where
TK> can I download it ?

You should have it if you're running a recent Emacs.  23.1 should work.

TK> Moreover, is the above at all right?  I have just paste it from
TK> somewhere but I dont really know what it is doing.

It's always better to understand things, but I realize you just want it
to work.  Thanks for being patient.

Ted

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-01-13 21:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-08  6:24 Password sending mail only once Torben Knudsen
2009-10-08  7:54 ` Richard Riley
2009-10-10 13:44   ` Torben Knudsen
2009-10-11  6:12     ` Richard Riley
2009-10-08 19:24 ` Ted Zlatanov
2010-01-12 13:13   ` Torben Knudsen
2010-01-13 21:31     ` Ted Zlatanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).