mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread martin f krafft
Dear list,

our E-mail-Server uses dovecot, which delivers mail to and from
a folder containing subfolders names e.g.
~/Maildir/.lists.mutt-users.

There are good reasons to use mutt directly on the machine from time
to time. Unfortunately, these folder names aren't exactly suitable
for mutt use. It works, but the leading dot is a pain, and tab
completion only honours '/' as a delimiter for folders, not '.'.

I have a complex shell script to maintain a symlink farm, but it's
suboptimal and hackish.

Do you have alternative approaches? I do not want to use mutt's IMAP
for localhost access, nor do I want to set up offlineimap on
localhost.

How can I map the IMAP folder names to proper folder names arranged
in a proper hierarchy (~/Maildir/.lists.mutt-users
→ ~/mail/lists/mutt-users)?

Thanks for any comments,

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
the duration of passion is proportionate
 with the original resistance of the woman.
   -- honoré de balzac
 
spamtraps: madduck.bo...@madduck.net


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)


Re: change profile on the fly

2012-08-16 Thread Marco Giusti
On Wed, Aug 15, 2012 at 09:50:15AM -0300, Marcelo Laia wrote:
 Hi,
 
 How I would change the current profile on the fly?
 
 I have 3 account and I would like to send mails with my username
 according to current account.

maybe this approach is a bit rude, but:

macro compose H 'enter-commandset sendmail=~/bin/msmtpQ -a 
hotmailenteredit-fromMarco Giusti 
marco.giu...@hotmail.comenteredit-reply-tomarco.giu...@hotmail.comenter'
 Send email with hotmail account
macro compose G 'enter-commandset sendmail=~/bin/msmtpQ -a 
gmailenteredit-fromMarco Giusti 
marco.giu...@gmail.comenteredit-reply-tomarco.giu...@gmail.comenter' 
Send email with gmail account

in addiction to some send-hooks.

m.


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Nicolas KOWALSKI
On Thu, Aug 16, 2012 at 01:07:36PM +0200, martin f krafft wrote:
 Do you have alternative approaches? I do not want to use mutt's IMAP
 for localhost access, nor do I want to set up offlineimap on
 localhost.

My home server runs a dovecot server, and I always use Mutt's IMAP to 
access folders locally; it works pretty well.

Is there a special reason to not use this combination?

-- 
Nicolas


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread martin f krafft
also sprach Nicolas KOWALSKI nicolas.kowal...@gmail.com [2012.08.16.1757 
+0200]:
 Is there a special reason to not use this combination?

I find it slow and cumbersome to work with.

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
sobald man über niveau spricht
 ist man längst darüber hinweg.
  -- thomas krafft
 
spamtraps: madduck.bo...@madduck.net


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Nicolas KOWALSKI
On Thu, Aug 16, 2012 at 06:11:26PM +0200, martin f krafft wrote:
 also sprach Nicolas KOWALSKI nicolas.kowal...@gmail.com [2012.08.16.1757 
 +0200]:
  Is there a special reason to not use this combination?
 
 I find it slow and cumbersome to work with.

For the slowness I activated the header cache feature (one file per 
folder):

set header_cache=~/.hcache

With this setup, on this server (Athlon XP 1500, 512M RAM), opening a 
15k mails folder takes from 3 to 5 seconds.

-- 
Nicolas


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread martin f krafft
also sprach Nicolas KOWALSKI nicolas.kowal...@gmail.com [2012.08.16.1823 
+0200]:
 For the slowness I activated the header cache feature (one file per 
 folder):
 
 set header_cache=~/.hcache
 
 With this setup, on this server (Athlon XP 1500, 512M RAM), opening a 
 15k mails folder takes from 3 to 5 seconds.

Hm, you are right, I just did

  set folder=imap://madduck@localhost/

and once I authenticated, it all seems to work.

What do you do about the password? I don't want to store that in
.muttrc!

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
quidquid latine dictum sit, altum viditur.
 
spamtraps: madduck.bo...@madduck.net


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread martin f krafft
also sprach martin f krafft madd...@madduck.net [2012.08.16.1829 +0200]:
 and once I authenticated, it all seems to work.

(except for change-folder tab-completion)

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
no, 'eureka' is greek for 'this bath is too hot.'
-- dr. who
 
spamtraps: madduck.bo...@madduck.net


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Thomas Wallrafen
Hi,

On Thu, Aug 16, 2012 at 06:29:42PM +0200, martin f krafft wrote:
 also sprach Nicolas KOWALSKI nicolas.kowal...@gmail.com [2012.08.16.1823 
 +0200]:
  For the slowness I activated the header cache feature (one file per 
  folder):
  
  set header_cache=~/.hcache
  
  With this setup, on this server (Athlon XP 1500, 512M RAM), opening a 
  15k mails folder takes from 3 to 5 seconds.
 
 Hm, you are right, I just did
 
   set folder=imap://madduck@localhost/
 
 and once I authenticated, it all seems to work.
 
 What do you do about the password? I don't want to store that in
 .muttrc!

You could enter the password manually, of course.

For me, a small shell script is does the trick  that decrypts a file via gpg
and echoes the necessary config directives into mutt.

Bye,

Thomas


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Nicolas KOWALSKI
On Thu, Aug 16, 2012 at 06:29:42PM +0200, martin f krafft wrote:
 What do you do about the password? I don't want to store that in
 .muttrc!

I enter it manually. Thanks to screen, my mutt session never ends (until 
server reboot), so this is not a problem.

-- 
Nicolas


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Luis Mochan
I used to have my password in the .muttrc file; bad mistake (I found
out after mailing my rc file to this list). After introducing it
manually for awhile, I wrote it in a small file with restricted
permissions (set imap_pass='my_password')  which I source 
from the rc file (source ~/my/password/file). The password file is
onle readable and writable by me. This setup is convenient, as I don't
have to type my password every session, though that is not a big
inconvenience.  Would this be considered unsafe?
Regards,
Luis



On Thu, Aug 16, 2012 at 06:36:11PM +0200, Thomas Wallrafen wrote:
 Hi,
 
 On Thu, Aug 16, 2012 at 06:29:42PM +0200, martin f krafft wrote:
  also sprach Nicolas KOWALSKI nicolas.kowal...@gmail.com [2012.08.16.1823 
  +0200]:
   ...
  What do you do about the password? I don't want to store that in
  .muttrc!
 
 You could enter the password manually, of course.
 
 For me, a small shell script is does the trick  that decrypts a file via gpg
 and echoes the necessary config directives into mutt.
 
 Bye,
 
 Thomas

-- 

  o
W. Luis Mochán,  | tel:(52)(777)329-1734 /(*)
Instituto de Ciencias Físicas, UNAM  | fax:(52)(777)317-5388 `/   /\
Apdo. Postal 48-3, 62251 |   (*)/\/  \
Cuernavaca, Morelos, México  | moc...@fis.unam.mx   /\_/\__/

O ascii ribbon campaign - stop html mail - www.asciiribbon.org 




Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Thomas Wallrafen
Hi,

On Thu, Aug 16, 2012 at 11:50:24AM -0500, Luis Mochan wrote:
 I used to have my password in the .muttrc file; bad mistake (I found
 out after mailing my rc file to this list). After introducing it
 manually for awhile, I wrote it in a small file with restricted
 permissions (set imap_pass='my_password')  which I source 
 from the rc file (source ~/my/password/file). The password file is
 onle readable and writable by me. This setup is convenient, as I don't
 have to type my password every session, though that is not a big
 inconvenience.  Would this be considered unsafe?

You can surely do it this way. But, still, the file is in plaintext on
the filesystem, which may be an attack vector. It all depends on your
security needs. It would be a definitive no-go on a laptop with an
unencrypted harddisk (but that does not seem to be the case for the OP,
so it is off-topic here).

Bye,

Thomas

 On Thu, Aug 16, 2012 at 06:36:11PM +0200, Thomas Wallrafen wrote:
  Hi,
  
  On Thu, Aug 16, 2012 at 06:29:42PM +0200, martin f krafft wrote:
   also sprach Nicolas KOWALSKI nicolas.kowal...@gmail.com 
   [2012.08.16.1823 +0200]:
...
   What do you do about the password? I don't want to store that in
   .muttrc!
  
  You could enter the password manually, of course.
  
  For me, a small shell script is does the trick  that decrypts a file via gpg
  and echoes the necessary config directives into mutt.
  
  Bye,
  
  Thomas
 
 -- 
 
   o
 W. Luis Mochán,  | tel:(52)(777)329-1734 /(*)
 Instituto de Ciencias Físicas, UNAM  | fax:(52)(777)317-5388 `/   /\
 Apdo. Postal 48-3, 62251 |   (*)/\/  \
 Cuernavaca, Morelos, México  | moc...@fis.unam.mx   /\_/\__/
 
 O ascii ribbon campaign - stop html mail - www.asciiribbon.org   
   
 
 


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread martin f krafft
also sprach Luis Mochan moc...@fis.unam.mx [2012.08.16.1850 +0200]:
 Would this be considered unsafe?

To store the password clear-text in a file? Yes.

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
one should never do anything that
 one cannot talk about after dinner.
-- oscar wilde
 
spamtraps: madduck.bo...@madduck.net


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Mark H. Wood
On Thu, Aug 16, 2012 at 06:29:42PM +0200, martin f krafft wrote:
 What do you do about the password? I don't want to store that in
 .muttrc!

Well, what *I* do is use Kerberos so I authenticate once when I
login.  Mutt (suitably configured) picks this up and gets the
necessary ticket.  But I'm crazy enough to run a complete Kerberos
setup in my home.

-- 
Mark H. Wood, Lead System Programmer   mw...@iupui.edu
Asking whether markets are efficient is like asking whether people are smart.


pgpFWCH8wtoi8.pgp
Description: PGP signature


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Christian Brabandt
Hi martin!

On Do, 16 Aug 2012, martin f krafft wrote:

 also sprach Luis Mochan moc...@fis.unam.mx [2012.08.16.1850 +0200]:
  Would this be considered unsafe?
 
 To store the password clear-text in a file? Yes.

What exactly is the problem with entering the password manually?


regards,
Christian
-- 
Humor in the Court:
Q: (Showing man picture.) That's you?
A: Yes, sir.
Q: And you were present when the picture was taken, right?


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Luis Mochan
 What exactly is the problem with entering the password manually?
Laziness. Not a very strong reason, but I just wondered if restricting
the permissions of the file would be enough protection. From the
answers so far, I gather not.

Related to my previous question, I have a text file,
/etc/exim4/passwd.client  with the password for accesing my
'smarthost' mail server from my laptop. I guess this presents similar
risks. 

Best regards,
Luis


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Andre Klärner
Hi Martin,

On Thu, Aug 16, 2012 at 01:07:36PM +0200, martin f krafft wrote:
 our E-mail-Server uses dovecot, which delivers mail to and from
 a folder containing subfolders names e.g.
 ~/Maildir/.lists.mutt-users.
 
 There are good reasons to use mutt directly on the machine from time
 to time. Unfortunately, these folder names aren't exactly suitable
 for mutt use. It works, but the leading dot is a pain, and tab
 completion only honours '/' as a delimiter for folders, not '.'.

I also use dovecot and this line in 10-mail.conf:

| mail_location = maildir:%h/Maildir:LAYOUT=fs

On the MTA side I got exim4 that drops into the INBOX or via .forward into
the folders. On my hosting site I choose to simply use the dovecot LDA that
will do the Sieve stuff and then save properly into folders.

The only downside is of cause, that there are subfolders and namecollisions
programmed if you use maildir-folders cur, new or tmp as foldernames.

I for myself decided that the extra stuff needed to prevent this is nothing
worth, as all my clients are german and would never come up with these
foldernames.

Hope it helps,

Andre

-- 
Andre Klärner

Telefon: 0351/79666546
Fax: 0351/79688547
Mobil:   0172/9838653


smime.p7s
Description: S/MIME cryptographic signature


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread martin f krafft
also sprach Christian Brabandt cbli...@256bit.org [2012.08.16.1937 +0200]:
  To store the password clear-text in a file? Yes.
 
 What exactly is the problem with entering the password manually?

I don't know my password. I use asymmetric authentication
everywhere, including IMAP, using a preauth-SSH-tunnel.

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
a bachelor is a man who never made the same mistake once.
 
spamtraps: madduck.bo...@madduck.net


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Tim Gray

On Aug 16, 2012 at 08:29 PM +0200, martin f krafft wrote:

also sprach Christian Brabandt cbli...@256bit.org [2012.08.16.1937 +0200]:
I don't know my password. I use asymmetric authentication
everywhere, including IMAP, using a preauth-SSH-tunnel.


Out of curiosity, how do you implement this?


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Patrick Ben Koetter
* martin f krafft madd...@madduck.net:
 also sprach Christian Brabandt cbli...@256bit.org [2012.08.16.1937 +0200]:
   To store the password clear-text in a file? Yes.
  
  What exactly is the problem with entering the password manually?
 
 I don't know my password. I use asymmetric authentication
 everywhere, including IMAP, using a preauth-SSH-tunnel.

Haven't had time to look into this, but I kept it for something worthy to play
with:

http://www.df7cb.de/blog/2010/Using_multiple_IMAP_accounts_with_Mutt.html

Putting passwords in configs isn't something I like, so I pull them 
from the
Gnome keyring:

set my_pw_example=`gnome-keyring-query get mutt_example`
set my_pw_otherdomain=`gnome-keyring-query get mutt_otherdomain`
account-hook example.org 'set imap_user=me imap_pass=$my_pw_example'
account-hook otherdomain.tld 'set imap_user=myself
imap_pass=$my_pw_otherdomain'

Here's the tool:
http://www.gentoo-wiki.info/HOWTO_Use_gnome-keyring_to_store_SSH_passphrases

Maybe that's a way to go.

p@rick

-- 
Postfix - Einrichtung, Betrieb und Wartung
http://www.postfix-buch.com
saslfinger (debugging SMTP AUTH):
http://postfix.state-of-mind.de/patrick.koetter/saslfinger/


signature.asc
Description: Digital signature


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread martin f krafft
also sprach Tim Gray lists+m...@protozoic.com [2012.08.16.2040 +0200]:
 Out of curiosity, how do you implement this?

http://git.madduck.net/v/etc/offlineimap.git/blob/HEAD:/.offlineimaprc#l45

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
consciousness: that annoying time between naps.
 
spamtraps: madduck.bo...@madduck.net


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread martin f krafft
also sprach Patrick Ben Koetter p...@state-of-mind.de [2012.08.16.2044 +0200]:
 Putting passwords in configs isn't something I like, so
 I pull them from the Gnome keyring:

Not a bad idea, but now an attacker with access to the filesystem
doesn't have to run 'cat ~/.muttrc' but 'gnome-keyring-query get mutt' instead.

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
fitter, healthier, more productive
like a pig, in a cage, on antibiotics
  -- radiohead
 
spamtraps: madduck.bo...@madduck.net


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Tim Gray

On Aug 16, 2012 at 08:58 PM +0200, martin f krafft wrote:

http://git.madduck.net/v/etc/offlineimap.git/blob/HEAD:/.offlineimaprc#l45


I see.  Not something you'd probably be able to do if you didn't have 
login access to the IMAP server.


Off topic - you must be the same Martin Krafft who went to Swarthmore.  
If so, we went there the same year.




Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Patrick Ben Koetter
* martin f krafft madd...@madduck.net:
 also sprach Patrick Ben Koetter p...@state-of-mind.de [2012.08.16.2044 
 +0200]:
  Putting passwords in configs isn't something I like, so
  I pull them from the Gnome keyring:
 
 Not a bad idea, but now an attacker with access to the filesystem
 doesn't have to run 'cat ~/.muttrc' but 'gnome-keyring-query get mutt' 
 instead.

If mutt can use a TLS client certificate, you can use that to auth against
Dovecot.

p@rick


-- 
Postfix - Einrichtung, Betrieb und Wartung
http://www.postfix-buch.com
saslfinger (debugging SMTP AUTH):
http://postfix.state-of-mind.de/patrick.koetter/saslfinger/


signature.asc
Description: Digital signature


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Andre Klärner
Hi Patrick,

On Thu, Aug 16, 2012 at 09:10:18PM +0200, Patrick Ben Koetter wrote:
 * martin f krafft madd...@madduck.net:
  also sprach Patrick Ben Koetter p...@state-of-mind.de [2012.08.16.2044 
  +0200]:
   Putting passwords in configs isn't something I like, so
   I pull them from the Gnome keyring:
  
  Not a bad idea, but now an attacker with access to the filesystem
  doesn't have to run 'cat ~/.muttrc' but 'gnome-keyring-query get mutt' 
  instead.
 
 If mutt can use a TLS client certificate, you can use that to auth against
 Dovecot.

Do you have a running setup that can use password and cert for one user?
(e.g. via password for the webmail, and certificate for the MUA).

Thanks, Andre

-- 
Andre Klärner

Telefon: 0351/79666546
Fax: 0351/79688547
Mobil:   0172/9838653


smime.p7s
Description: S/MIME cryptographic signature


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Andre Klärner
Hi Martin,

On Thu, Aug 16, 2012 at 09:01:16PM +0200, martin f krafft wrote:
 also sprach Patrick Ben Koetter p...@state-of-mind.de [2012.08.16.2044 
 +0200]:
  Putting passwords in configs isn't something I like, so
  I pull them from the Gnome keyring:
 
 Not a bad idea, but now an attacker with access to the filesystem
 doesn't have to run 'cat ~/.muttrc' but 'gnome-keyring-query get mutt' 
 instead.

isn't one of the purposes of gnome-keyring daemon to store the passwords
encrypted on disk while they are unused and unlock that keyring once the
user want's to do so?

Btw: Does anyone have a cool setup that is less dependent on gnome? I'm
using awesome for a while now and want to avoid more dependancies on gnome.

Regards, Andre


-- 
Andre Klärner

Telefon: 0351/79666546
Fax: 0351/79688547
Mobil:   0172/9838653


smime.p7s
Description: S/MIME cryptographic signature


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Patrick Ben Koetter
* Andre Klärner kan...@ak-online.be:
 Hi Patrick,
 
 On Thu, Aug 16, 2012 at 09:10:18PM +0200, Patrick Ben Koetter wrote:
  * martin f krafft madd...@madduck.net:
   also sprach Patrick Ben Koetter p...@state-of-mind.de [2012.08.16.2044 
   +0200]:
Putting passwords in configs isn't something I like, so
I pull them from the Gnome keyring:
   
   Not a bad idea, but now an attacker with access to the filesystem
   doesn't have to run 'cat ~/.muttrc' but 'gnome-keyring-query get mutt' 
   instead.
  
  If mutt can use a TLS client certificate, you can use that to auth against
  Dovecot.
 
 Do you have a running setup that can use password and cert for one user?
 (e.g. via password for the webmail, and certificate for the MUA).

I have to apologize! Postfix can do that for sender, and looking at dovecots
SSL params I assumed it can do that too, but reading through the docs
http://wiki2.dovecot.org/PasswordDatabase it seems I was wrong.

But IF we really wanted that Timo would probably implement it. I'd contribute
€ 250.-.

p@rick

-- 
Postfix - Einrichtung, Betrieb und Wartung
http://www.postfix-buch.com
saslfinger (debugging SMTP AUTH):
http://postfix.state-of-mind.de/patrick.koetter/saslfinger/


smime.p7s
Description: S/MIME cryptographic signature


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Cameron Simpson
On 16Aug2012 13:07, martin f krafft madd...@madduck.net wrote:
| I have a complex shell script to maintain a symlink farm, but it's
| suboptimal and hackish.

I have a not very complex script; it uses the mutt tree as reference and
makes symlinks for dovecot:

  https://bitbucket.org/cameron_simpson/css/src/tip/bin/mkdovecotmap

Cheers,
-- 
Cameron Simpson c...@zip.com.au

...the problem is not what is in front of the eyepiece but is often what is
behind it.  - Don Farra


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Cameron Simpson
On 16Aug2012 20:23, Andre Klärner kan...@ak-online.be wrote:
| I also use dovecot and this line in 10-mail.conf:
| 
| | mail_location = maildir:%h/Maildir:LAYOUT=fs

Oh. Oh!
-- 
Cameron Simpson c...@zip.com.au

Motorcycles are like peanuts... who can stop at just one?
- Zebee Johnstone ze...@zip.com.au aus.motorcycles Poser Permit #1