1

this is my first SF question, so please be gentile:

Is there an easy way to force dovecot pop3 server to ignore "delete messages" commands after being fetched by the MUA?

Here are the issues I'm facing:

  • my boss wants to force everyone into a server-side "no delete message"-policy, for archiving, auditing and backup&recovery purposes
  • the requisite here is pop3, so imap is out
  • the mailusers are virtual users (held in a mysql db)
  • don't have the budget to set up a separate mail-arvhing server
  • don't want to use shaggy way (aka immutable flag, r/w permissions for Maildirs, etc)

One way to solve it (my guess) is to setup a postfix-forwarding rule to a separate MANAGER account, but there will be problems later in effective email recovering (aka clearly disseminate emails for different users)

Help? Thanks!

Edit: Will be asking same question on dovecot-dedicated forums, just thinking to broaden my tech scope :) dovecot 2.0.15

faker
  • 17,496
  • 2
  • 60
  • 70
user91170
  • 11
  • 3
  • This question is probably better asked over at the dovecot-users mailing list: . You also fail to specify which Dovecot version you are using. There are many differences between the various versions, some of them quite drastic. – daff Dec 21 '11 at 16:14
  • Make a copy of every incoming mail in the MTA/MDA. Then you can comply to the policy, and users will be able to digest their emails. – user77376 Aug 29 '14 at 12:26
  • Don't do pop3 deployments today. Use IMAP. And set up a sane archival solution. – vidarlo Jun 15 '21 at 06:33

2 Answers2

6

Shortest answer

No

Short answer

Get sources of dovecot, grok code edit and remove DELE command. Compile, install and be ready to "upgrade nightmare"

Longer anser

NEVER ignore and violate RFC, according to which DELE in POP3-session must delete message in spool. Tell boss to fund technical solution, because it give in future alot less headache and problems

Solution for you task, not answer on question

Change MTA configuration and extend every mail-user on host into "dual-user" alias-system, i.e. ordinary user@yourdomain.com will transform into something like

user: user-m, user-b

there user-m & user-b are identical users (for MTA and Dovecot) with one difference: user-m have POP3-access, user-b have not.

You have to have *2 space for mail, but get manageable and full archives per user

Lazy Badger
  • 3,137
  • 15
  • 13
1

While I know this is an old question, I'm updating it with current information.

The file:

/etc/dovecot/config.d/20-pop3.conf

contains the following section:

# This option changes POP3 behavior so that it's not possible to actually
# delete mails via POP3, only hide them from future POP3 sessions. The mails
# will still be counted towards user's quota until actually deleted via IMAP.
# Use e.g. "$POP3Deleted" as the value (it will be visible as IMAP keyword).
# Make sure you can legally archive mails before enabling this setting.
#pop3_deleted_flag =

So by enabling this with something like

pop3_deleted_flag = $Pop3Deleted

Would achieve the required effect.

  • While trying this I got below error `doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/20-pop3.conf line 66: Unknown variable: $POP3Deleted` – user1372488 Feb 21 '22 at 08:04