Re: cyr_expire

Nic Bernstein <[email protected]>
Newsgroups gmane.mail.imap.cyrus
Message-ID <[email protected]>
Vladas,
While you haven't told us which OS or distribution you're running Cyrus 
on, this looks like Debian or Ubuntu, or another distro which follows 
the same practice of installing the Cyrus binaries outside of the normal 
path, and then uses a wrapper script, /usr/sbin/cyrus, to run those.

In your previous message you included this snippet from your cyrus.conf 
file:

    deleteprune     cmd="/usr/sbin/cyrus expire -E 4 -D 28" at=0430

Here's what that file looks like on my Ubuntu server:

    $*file /usr/sbin/cyrus*
    /usr/sbin/cyrus: POSIX shell script, ASCII text executable

And this is what running it without an argument will show:

    $*/usr/sbin/cyrus*
    ERROR: Command cannot be empty

    usage: cyrus COMMAND [ARGS]

    The most commonly used cyr commands are:
        reconstruct   reconstruct mailboxes
        quota         report and optionally fix quota usage
        squatter      reindex mailboxes
        mbpath        translate mailbox names to filesystem paths
        mboxlist      perform operations on the mailbox list database
        check         perform a consistency check of the cyrus mailstore
        tls_prune     prune expired sessions from the TLS sessions database
        ctl_cyrusdb   perform operations common to all Cyrus databases
        expire        expire messages and duplicate delivery database entries
        arbitron      arbitron mailboxes
        cvt_cyrusdb   convert a database file between cyrus database formats
        arbitronsort  sorts arbitron(8) output
        ipurge        delete mail from IMAP mailbox or partition based on age or size
        makedirs      Sets up the Cyrus IMAPd system directories (spools)

    You can get manpages for respective command by prepending cyrus-
    prefix to the command name, f.e.:

        man 8 cyrus-reconstruct

So on your system you would use "/usr/sbin/cyrus expire" wherever you 
see an example using "cyr_expire".  In fact the /usr/sbin/cyrus script 
is just going to run cyr_expire from the install directory. On my Ubuntu 
system that is /usr/lib/cyrus/bin, like so:

    $ ls /usr/lib/cyrus/bin/
    arbitron             ctl_mboxlist          cyrdump          httpd         makedirs   ptdump       sivtest
    arbitronsort         ctl_zoneinfo          cyr_expire       httptest      master     ptexpire     smmapd
    backupd              cvt_cyrusdb           cyr_info         idled         mbexamine  ptloader     smtptest
    calalarmd            cvt_xlist_specialuse  cyr_sequence     imapd         mbpath     quota        squatter
    chk_cyrus            cyr_backup            cyr_userseen     imtest        mbtool     reconstruct  synctest
    ctl_backups          cyr_buildinfo         cyr_virusscan    installsieve  nntptest   restore      timsieved
    ctl_conversationsdb  cyr_dbtool            dav_reconstruct  ipurge        notifyd    sievec       tls_prune
    ctl_cyrusdb          cyr_deny              deliver          lmtpd         pop3d      sieved       unexpunge
    ctl_deliver          cyr_df                fud              lmtptest      pop3test   sieveshell   upgrade-db

For Debian/Ubuntu systems this is all explained in 
/usr/share/doc/cyrus-common/README.Debian.gz, which includes this paragraph:

    The Debian packaging of Cyrus has a few quirks which are important to know
    about:

    1. Relocation of many Cyrus IMAP files

        The default Cyrus install scatters files all over the place.  The
        Debian package installs only a few files in /usr/bin (cyradm).  All
        other programs are installed into /usr/lib/cyrus/bin with
        convenience tool called /usr/sbin/cyrus which can be used to call
        all cyrus utilities.  Invoke /usr/sbin/cyrus --help without any
        argument to learn more.

If you're going to administer a complex system like Cyrus IMAP, and you 
choose to use someone else's packaging, then you need to take some time 
to learn the quirks of that packaging.

If you are not using Debian/Ubuntu, then the packages you installed 
might be very different from mine, so take the above as only one example 
of how this could be done.

The purpose of /usr/sbin/cyrus is twofold.  1) It gives one a single 
command, with several sub-commands, to get things done with; and 2) it 
ensures that the proper effective UID is used when running those 
commands, so as not to corrupt the mailstore or databases.  This is very 
important, and easy to get wrong otherwise.

Armed with this information, you should be able to figure out how to 
expire the expunged messages.  Please check out 
https://www.cyrusimap.org/ if you have further questions about Expunge.

Cheers,
     -nic

On 11/8/22 13:26, vladas via Info wrote:
> I am newbie here, although I have installed Cyrus 3.4.3 (and then 
> upgraded it to 3.4.4) successfully, just thousands of old letters have 
> already piled up the trash bin yet.
>
> Switching |expunge_mode| from |delayed| to |immediate| in /imapd.conf/ 
> did not start cleaning, and |whereis cyr_expire| finds 
> //usr/local/cyrus/man/man8/cyr_expire.8.gz/ only — is it not installed 
> yet? EVENTS{} are left unchanged in /cyrus.conf/:
>
> EVENTS {
>    # this is required
>    checkpoint    cmd="ctl_cyrusdb -c" period=30
>
>    # this is only necessary if using duplicate delivery suppression,
>    # Sieve or NNTP
>    delprune      cmd="cyr_expire -E 3" at=0400
>   
>    # Expire data older than 28 days.
>    deleteprune   cmd="cyr_expire -E 4 -D 28" at=0430
>    expungeprune  cmd="cyr_expire -E 4 -X 28" at=0445
>   
>    # this is only necessary if caching TLS sessions
>    tlsprune      cmd="tls_prune" at=0400
> }
>
>
> *Cyrus <https://cyrus.topicbox.com/latest>* / Info / see discussions 
> <https://cyrus.topicbox.com/groups/info> + participants 
> <https://cyrus.topicbox.com/groups/info/members> + delivery options 
> <https://cyrus.topicbox.com/groups/info/subscription> Permalink 
> <https://cyrus.topicbox.com/groups/info/T320efe9c3aa52a54-Mb9534ae1b2e4a9bc5d5c5681> 
>

-- 
Nic [email protected]
https://www.nicbernstein.com

------------------------------------------
Cyrus: Info
Permalink: https://cyrus.topicbox.com/groups/info/T320efe9c3aa52a54-M749a9e3d00e7ff7fcb7bc96b
Delivery options: https://cyrus.topicbox.com/groups/info/subscription
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.