Hello!
I would like to expunge Inbox mailbox every 60 days
This mailbox is not in the config any I try to use "doveadm expunge".
But my sh configs doesn't works: Fatal: Invalid search date parameter: 60d
If I enter the contents of the config directly into the console -
everything works correctly
the same code in sh - ends with an error.

It is bug or I do mistake?


root@mail:~# doveconf -n
# 2.3.16 (7e2e900c1a): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.16 (09c29328)
# OS: Linux 5.15.0-84-generic x86_64 Ubuntu 22.04.2 LTS
# Hostname: mail.onelec.ru
auth_mechanisms = plain login
auth_verbose = yes
base_dir = /run/dovecot/
disable_plaintext_auth = no
log_path = /var/log/dovecot.log
login_greeting = Mail Delivery Agent
mail_access_groups = mail
mail_location = maildir:%h/mail/%d/%n
mail_privileged_group = mail
namespace {
  inbox = yes
  list = yes
  location =
  mailbox Archive {
    auto = subscribe
    autoexpunge = 30 days
    special_use = \Archive
  }
  mailbox "Deleted Messages" {
    auto = no
    autoexpunge = 1 weeks
    special_use = \Trash
  }
  mailbox Drafts {
    auto = subscribe
    autoexpunge = 1 weeks
    special_use = \Drafts
  }
  mailbox Junk {
    auto = no
    autoexpunge = 1 weeks
    special_use = \Junk
  }
  mailbox Sent {
    auto = subscribe
    autoexpunge = 90 days
    special_use = \Sent
  }
  mailbox "Sent Mail" {
    auto = no
    autoexpunge = 90 days
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    auto = no
    autoexpunge = 90 days
    special_use = \Sent
  }
  mailbox Spam {
    auto = subscribe
    autoexpunge = 1 weeks
    special_use = \Junk
  }
  mailbox Trash {
    auto = subscribe
    autoexpunge = 1 weeks
    special_use = \Trash
  }
  prefix =
  separator = /
  type = private
}
passdb {
  args = scheme=MD5-CRYPT username_format=%n /etc/exim4/domains/%d/passwd
  driver = passwd-file
}
plugin {
  quota = maildir:User quota
}
protocols = imap pop3
service auth {
  extra_groups = mail
  unix_listener auth-client {
    group = mail
    mode = 0660
    user = dovecot
  }
  user = dovecot
}
service stats {
  unix_listener stats-writer {
    group = mail
    mode = 0660
    user = dovecot
  }
}
ssl_cert = </usr/local/hestia/ssl/certificate.crt
ssl_cipher_list =
ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA256
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
ssl_prefer_server_ciphers = yes
userdb {
  args = username_format=%n /etc/exim4/domains/%d/passwd
  driver = passwd-file
}
protocol imap {
  mail_plugins = quota imap_quota
}
protocol pop3 {
  mail_plugins = quota
}
local_name mail.bearlion.ru {
  ssl_cert = </home/bearlion/conf/mail/bearlion.ru/ssl/bearlion.ru.pem
  ssl_key = # hidden, use -P to show it
}
local_name mail.onelec.ru {
  ssl_cert = </home/onelec/conf/mail/onelec.ru/ssl/onelec.ru.pem
  ssl_key = # hidden, use -P to show it
}
local_name mail.radiokey.ru {
  ssl_cert = </home/radiokey/conf/mail/radiokey.ru/ssl/radiokey.ru.pem
  ssl_key = # hidden, use -P to show it
}
#!/bin/bash
echo "Hello"
doveadm expunge -u ad...@onelec.ru mailbox Inbox savedbefore 60d
echo "admin done"
doveadm expunge -u go...@onelec.ru mailbox Inbox savedbefore 60d
echo "golos done"
#!/bin/sh
DOVEADM="/usr/bin/doveadm";
echo "Hi";
${DOVEADM} expunge -u ad...@onelec.ru mailbox Inbox savedbefore 60d;
echo "admin ok";
${DOVEADM} expunge -u go...@onelec.ru mailbox Inbox savedbefore 60d;
echo "golos ok"";
_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Reply via email to