Can I force dovecot to ignore pop3 requests to delete received email?

Solution 1:

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 [email protected] 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

Solution 2:

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.