Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decrypting some mails and some not #5828

Closed
5 tasks done
semaf opened this issue Apr 5, 2024 · 4 comments
Closed
5 tasks done

Decrypting some mails and some not #5828

semaf opened this issue Apr 5, 2024 · 4 comments
Labels
bug stale Please update the issue with current status, unclear if it's still open/needed.

Comments

@semaf
Copy link

semaf commented Apr 5, 2024

Contribution guidelines

I've found a bug and checked that ...

  • ... I understand that not following the below instructions will result in immediate closure and/or deletion of my issue.
  • ... I have understood that this bug report is dedicated for bugs, and not for support-related inquiries.
  • ... I have understood that answers are voluntary and community-driven, and not commercial support.
  • ... I have verified that my issue has not been already answered in the past. I also checked previous issues.

Description

I have the same issue here..

One of the mail accounts ([email protected]) can read the mails from INBOX but not the other mail account ([email protected]). 
As both accounts are using the same key files, it can be only an issue. Updated today to 2024-04 version.

I have restored also the first instance of borgmatic backup and copied the key files manually which did not solve the issue.

Using the documentation to decrypt mails, this is the result that on some accounts it cant be decrypted. I running at the moment 4 domains and 14 mail accounts in total.


8c3a221f571c:/mail_crypt# find /var/vmail/ -type f -regextype egrep -regex '.*S=.*W=.*' | while read -r file; do
if [[ $(head -c7 "$file") == "CRYPTED" ]]; then
doveadm fs get compress lz4:1:crypt:private_key_path=/mail_crypt/ecprivkey.pem:public_key_path=/mail_crypt/ecpubkey.pem:posix:prefix=/ \
  "$file" > "/tmp/$(basename "$file")"
  if [[ -s "/tmp/$(basename "$file")" ]]; then
    chmod 600 "/tmp/$(basename "$file")"
    chown 5000:5000 "/tmp/$(basename "$file")"
    mv "/tmp/$(basename "$file")" "$file"
  else
    rm "/tmp/$(basename "$file")"
  fi
fi
done

As this is not secure enough, loosing emails, I unlikely disabled encrypting mails.

Collection of decrypt issues:
#2395
#5105
https://community.mailcow.email/d/2236-mail-cant-be-readdecrypt-after-restore/2
https://community.mailcow.email/d/2082-certain-emails-no-longer-loading-corrupted
https://community.mailcow.email/d/2266-lost-access-to-a-mailbox-but-still-receiving-mail
https://community.mailcow.email/d/955-cant-restore-to-a-new-server



### Logs:


```plain text
Error: read(/var/vmail/semaf.at/tom/Maildir/cur/1711752189.M161924P154.66ecee6179b1,S=55288,W=56569:2,) failed: Decryption error: no private key available
Error: read(/var/vmail/semaf.at/tom/Maildir/cur/1711751438.M58396P1850.4802c740a8c9,S=40489,W=41192:2,) failed: Decryption error: no private key available
Error: read(/var/vmail/semaf.at/tom/Maildir/cur/1711753621.M217592P1025.66ecee6179b1,S=109437,W=110890:2,) failed: Decryption error: no private key available
Error: read(/var/vmail/semaf.at/tom/Maildir/cur/1711752842.M184920P390.66ecee6179b1,S=476253,W=486780:2,) failed: Decryption error: no private key available
Error: read(/var/vmail/domain1.at/mike/Maildir/.Junk/new/1711753547.M240604P1025.66ecee6179b1,S=6651,W=6805) failed: Decryption error: no private key available
Error: read(/var/vmail/domain2.at/lisa/Maildir/new/1711752697.M978152P390.66ecee6179b1,S=46569,W=47647) failed: Decryption error: no private key available
Error: read(/var/vmail/domain2.at/jack/Maildir/cur/1711754825.M812922P1025.66ecee6179b1,S=44041,W=44642:2,S) failed: Decryption error: no private key available

Steps to reproduce:

1. Backup mailcow using Borgmatic
2. Restore mailcow using Borgmatic

Which branch are you using?

master

Which architecture are you using?

x86

Operating System:

Ubuntu 22.04

Server/VM specifications:

4

Is Apparmor, SELinux or similar active?

no

Virtualization technology:

VMware

Docker version:

26.0.0

docker-compose version or docker compose version:

2.25.0

mailcow version:

2024-04

Reverse proxy:

Nginx Proxy Manager

Logs of git diff:

x

Logs of iptables -L -vn:

x

Logs of ip6tables -L -vn:

x

Logs of iptables -L -vn -t nat:

x

Logs of ip6tables -L -vn -t nat:

x

DNS check:

x
@semaf semaf added the bug label Apr 5, 2024
@semaf
Copy link
Author

semaf commented Apr 7, 2024

Even new received mails cant be read from accounts with that issue if mcrypt is activated.

@xBytez
Copy link

xBytez commented Jun 5, 2024

I'm running into this as well (nightly)

I remember having this previously and I fixed it then with using an older image of dovecot decrypting everything and encrypting it all again with the latest image, that didn't seem to work this time.

@milkmaker
Copy link
Collaborator

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@milkmaker milkmaker added stale Please update the issue with current status, unclear if it's still open/needed. and removed stale Please update the issue with current status, unclear if it's still open/needed. labels Aug 5, 2024
@milkmaker
Copy link
Collaborator

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@milkmaker milkmaker added the stale Please update the issue with current status, unclear if it's still open/needed. label Oct 4, 2024
@milkmaker milkmaker closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale Please update the issue with current status, unclear if it's still open/needed.
Projects
None yet
Development

No branches or pull requests

3 participants