Re: [exim] Storing messages in Maildir format with symmetric encryption

2022-11-24 Thread Cyborg via Exim-users

Am 24.11.22 um 09:23 schrieb Andrew C Aitchison via Exim-users:



Perhaps use some sort of GPG wrapper as a transport_filter,
and do decryption client-side?


Ah.
If we use OpenPGP format then the recipient can use any
PGP-aware client to read the message.



Tried it.. It's complex and it ended with all sorts of charset issues 
within the pgp mails.


But, yes, it's the only imaginable way to make it secure for all 
local/remote attack scenarios,

after it got encrypted.

Everything else, like the dovecot mailcrypt plugin, has loopholes:

- no protection of physical theft, except password for keys is used and 
database for password was not stolen too.

- no protection against rogue admins
- no protection against system breaches
- no protection against stolen/bruteforced credentials --> imap login

- only working scenario:
  Attacker with none-root privileges on system side, with read access 
to mailbox files.
  Access should be only valid for exim and dovecot itself anyway, so 
encryption is obsolete, if access rights are restricted correctly.


Of course, these are only my opinions on the topic.

best regards,
Marius


OpenPGP_0x048770A738345DD3.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature
-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


Re: [exim] Storing messages in Maildir format with symmetric encryption

2022-11-24 Thread Kirill Miazine via Exim-users
• Heiko Schlittermann via Exim-users [2022-11-24 10:51]:
[...]
> BTW, I *think* I read that Dovecot supports encrypted mailboxes.

See my earlier post today:

https://marc.info/?l=exim-users=166928008225533=2

-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


Re: [exim] Storing messages in Maildir format with symmetric encryption

2022-11-24 Thread Heiko Schlittermann via Exim-users
Dengler, Gabriel  (Do 24 Nov 2022 00:19:42 CET):
> > somewhere for later use as encryption/decryption key?
> yeah, that's my main idea. For clearness, a "normal" communication profile
> would look like this:
> * An external sender sends an e-mail to our local Exim Server.
> * The Exim Server saves the message, e.g. via Maildir, encrypted with the
> password of the receiver.

Ok, but how does Exim know the password of the receiver? You've access
to the password hashes only, I suppose.

> * When the receiver wants to access the message, e.g., via IMAP, he/she
> encrypts the saved message again via its private password.

Wouldn't it be better to use asymmetric encryption, then Exim doesn't
need to know a shared secret, but only a public key. The mailbox user
then can decrypt the message using a private key.

Having a shared secret that's known to Exim (except during the
verification of a PLAIN or LOGIN auth), creates an unnecessary attack
surface.

> I think I have to sleep about this concept one more night, but besides:
> would the general setup be possible with transport_filter if the passwords
> are not hashed (although this is obviously a security issue)?

BTW, I *think* I read that Dovecot supports encrypted mailboxes. And in
the ideal world Exim doesn't know anything about how to store messages,
but simply passes the messages to a MDA (mail delivery agent), e.g.
directly via a local pipe (dovecot-deliver, cyrdeliver, …), or via a protocol 
like LMTP
(which is supported by Dovecot and Cyrus too).

Best regards from Dresden/Germany
Viele Grüße aus Dresden
Heiko Schlittermann
--
 SCHLITTERMANN.de  internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --- key ID: F69376CE -


signature.asc
Description: PGP signature
-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


Re: [exim] debugging tls handshake failure

2022-11-24 Thread Julian Bradfield via Exim-users
On 2022-11-23, Kirill Miazine via Exim-users  wrote:
> • Julian Bradfield via Exim-users [2022-11-23 18:25]:
> [...]
>> Kirill wrote:
>> 
>> something in base64 which got saved as such:)
>
> I wonder why...

Because when you save an article in slrn, it saves the entire
article. There doesn't appear to be a "write the decoded body" option,
and there isn't an option to follow up to multiple articles in one
post, so I just saved all the replies to a file and edited that.

>> Asking I think for any information, as he sees something similar. Will
>> do.
>
> exactly: https://marc.info/?l=exim-users=166919251811778=2

I didn't say I didn't have the original, it just wasn't in
my followup, and slrn also doesn't let you go back to the article
display while composing.

Yes, I could just use Gnus, but the Gnus interface annoys me too
much, and I've been using rn variants for 35 years ...

Maybe I'll extend slrn ...

-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


Re: [exim] Storing messages in Maildir format with symmetric encryption

2022-11-24 Thread Kirill Miazine via Exim-users
• Dengler, Gabriel via Exim-users [2022-11-23 01:16]:
> Hello everyone,
> 
> I want to store the incoming e-mails using the Maildir file format encrypted
> by using some symmetric encryption using the user's password (e.g., AES). So
> in the end, Exim should write the encrypted files directly on the disk.
> Furthermore, it would be convenient if the actual password is solely
> persistent saved as a hash (for checking at authentication), the real
> password - and therefore the en-/decryption key - is only temporarily
> available during the login session.

Why do you have Exim to make this? Why not use Dovecot's delivery
facilities to make Dovecot encrypt and store in Maildir?

https://doc.dovecot.org/configuration_manual/mail_crypt_plugin/#functional-overview

> Therefore, I wanted to modify the Exim source code directly but was
> confronted with a large amount of code, e.g., the differentiation between
> the different transport types or the many cases considered in the appendfile
> protocol. So I have some questions, where you might help me in the "big
> picture":
> * How to enforce that a user has to authenticate him-/herself with a
> password?
> * Where is a good point of "grabbing out" the password from the user and how
> to "carry" it to the point where the encryption happens?
> * Where is a good point to add the encryption, e.g., by modifying the
> transport_instance block or directly before the file is written?
> 
> Thanks for your help in advance!
> 
> Best regards,
> 
> Gabriel
> 
> -- 
> ## List details at https://lists.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://wiki.exim.org/

-- 
-- Kirill Miazine 

-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


Re: [exim] Storing messages in Maildir format with symmetric encryption

2022-11-24 Thread Andrew C Aitchison via Exim-users

On Thu, 24 Nov 2022, Jasen Betts via Exim-users wrote:


On 2022-11-23, Jeremy Harris via Exim-users  wrote:

On 23/11/2022 00:16, Dengler, Gabriel via Exim-users wrote:

I want to store the incoming e-mails using the Maildir file format encrypted by 
using some symmetric encryption using the user's password


It seems like a generally valuable concept - but I'd think that assymetric 
encryption
of the data-at-rest is more appropriate than symmetric.  The MDA (exim, here, 
receiving
a message and delivering to file) shou be able to encrypt for the destination 
user
but NOT decrypt.  So it should have access to a public key and not a private key
for the destination mailbox - and this is entirely separate from notions of
SMTP authentication.

Where to implement it in the code?  Probably pretty late in the appendfile
transport; about where it's doing actual writes to the file fd - and using
a public key supplied via a transport option (which the config pulls
from a database lookup using the username, or localpart, or whatever)
and perhaps another giving the cipher scheme.


Perhaps use some sort of GPG wrapper as a transport_filter,
and do decryption client-side?


Ah.
If we use OpenPGP format then the recipient can use any
PGP-aware client to read the message.

--
Andrew C. Aitchison  Kendal, UK
   and...@aitchison.me.uk

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/