justina colmena ~biz
2022-Nov-30 17:34 UTC
moving messages between namespaces go into purge
Mails stored as individual files in a "Maildir/" can conceivably be "moved" within the O/S file system rather than copied, but the default flatfile Mailbox format does require a copy-and-purge, as far as I know. /etc/postfix/main.cf: # DELIVERY TO MAILBOX # # The home_mailbox parameter specifies the optional pathname of a # mailbox file relative to a user's home directory. The default # mailbox file is /var/spool/mail/user or /var/mail/user. Specify # "Maildir/" for qmail-style delivery (the / is required). # #home_mailbox = Mailbox home_mailbox = Maildir/ On Wednesday, November 30, 2022 8:24:40 AM AKST, Marc wrote:> I think it would be nice to have an option where the moving of > messages between namespaces (by automated server scripts) would > not result in messages ending up in the 'purge' queue. > > Currently when you move these copied messages, they end up in > the purge queue combined with messages that users deleted. I am > more or less forced to purge the mailbox after moving GB's while > I prefer not to do this, because I would like to keep the > opportunity to recover from the purge queue. > > Maybe there is a way to 'deduplicate' this purge queue? > >
The reason is that MOVING a mail is same COPYING and EXPUNGING a mail. mdbox format retains deleted messages, even if they result from moving. It's not a queue as such. With mdbox format you are supposed to run purge periodically in any case. I am not sure what justina is again rambling about... Aki> On 30/11/2022 19:34 EET justina colmena ~biz <justina at colmena.biz> wrote: > > > Mails stored as individual files in a "Maildir/" can conceivably be "moved" > within the O/S file system rather than copied, but the default flatfile > Mailbox format does require a copy-and-purge, as far as I know. > > /etc/postfix/main.cf: > # DELIVERY TO MAILBOX > # > # The home_mailbox parameter specifies the optional pathname of a > # mailbox file relative to a user's home directory. The default > # mailbox file is /var/spool/mail/user or /var/mail/user. Specify > # "Maildir/" for qmail-style delivery (the / is required). > # > #home_mailbox = Mailbox > home_mailbox = Maildir/ > > > On Wednesday, November 30, 2022 8:24:40 AM AKST, Marc wrote: > > I think it would be nice to have an option where the moving of > > messages between namespaces (by automated server scripts) would > > not result in messages ending up in the 'purge' queue. > > > > Currently when you move these copied messages, they end up in > > the purge queue combined with messages that users deleted. I am > > more or less forced to purge the mailbox after moving GB's while > > I prefer not to do this, because I would like to keep the > > opportunity to recover from the purge queue. > > > > Maybe there is a way to 'deduplicate' this purge queue? > > > >
I am aware of this, and I am aware that I should use the purge only for optimizing iops use. But currently I purge every 2 months or so, so it is easier to use this to recover with an accidental delete. If then on the server an archive runs that moves messages, it is annoying that these messages are also ending up with the users expunged mail. Because you can't differentiate between the messages that were moved by 'the server' and the one a user expunged. If a command such as this had an extra flag '-direct' doing a direct purge doveadm move -u $account Archive/$year mailbox "$mbox" SENTBEFORE $nyear-01-01 SENTSINCE $year-01-01 It has been a while since I made these scripts. Is it possible to get a list of unique id's of the moved messages and then do a purge on those unique id's only?> > The reason is that MOVING a mail is same COPYING and EXPUNGING a mail. > mdbox format retains deleted messages, even if they result from moving. > It's not a queue as such. > > With mdbox format you are supposed to run purge periodically in any > case. >> > > > > I think it would be nice to have an option where the moving of > > > messages between namespaces (by automated server scripts) would > > > not result in messages ending up in the 'purge' queue. > > > > > > Currently when you move these copied messages, they end up in > > > the purge queue combined with messages that users deleted. I am > > > more or less forced to purge the mailbox after moving GB's while > > > I prefer not to do this, because I would like to keep the > > > opportunity to recover from the purge queue. > > > > > > Maybe there is a way to 'deduplicate' this purge queue? > > > > > >