mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Few fixes.
This commit is contained in:
@@ -180,6 +180,7 @@ from modoboa.calendars import jobs as calendars_jobs
|
||||
from modoboa.core import jobs as core_jobs
|
||||
from modoboa.admin import jobs as admin_jobs
|
||||
from modoboa.maillog import jobs as maillog_jobs
|
||||
from modoboa.webmail import jobs as webmail_jobs
|
||||
|
||||
|
||||
register(core_jobs.clean_logs, queue_name="modoboa", cron="0 0 * * *")
|
||||
@@ -198,6 +199,8 @@ register(maillog_jobs.update_statistics, queue_name="modoboa", cron="0 * * * *")
|
||||
|
||||
register(calendars_jobs.generate_rights, queue_name="privileged", cron="*/2 * * * *")
|
||||
|
||||
register(webmail_jobs.send_scheduled_messages, queue_name="modoboa", cron="* * * * *")
|
||||
|
||||
if "modoboa.amavis" in settings.MODOBOA_APPS:
|
||||
register(amavis_jobs.qcleanup, queue_name="modoboa", cron="0 0 * * *")
|
||||
register(amavis_jobs.amnotify, queue_name="modoboa", cron="0 12 * * *")
|
||||
@@ -268,9 +271,6 @@ New built-in auto-configuration service.
|
||||
# Not used for Modoboa WebMail; configure that in the Modoboa admin settings.
|
||||
#
|
||||
# * HOSTNAME: External hostname that clients should connect to
|
||||
# * Supports Thunderbird-style placeholders to substitute values from the
|
||||
# email address originally entered into the mail client:
|
||||
# %EMAILADDRESS%, %EMAILLOCALPART%, %EMAILDOMAIN%
|
||||
# * SOCKET_TYPE: Actually the encryption settings
|
||||
# * May be one of: 'SSL' (immediate TLS), 'STARTTLS' or 'plain' (bad)
|
||||
# * PORT: TCP port that the client should use when connecting to the server
|
||||
|
||||
@@ -318,8 +318,8 @@ const openAttachmentsDialog = () => {
|
||||
|
||||
const closeAttachmentDialog = async () => {
|
||||
showAttachmentsDialog.value = false
|
||||
const resp = await api.getUploadedAttachments(route.query.uid)
|
||||
attachmentCount.value = resp.data.length
|
||||
const resp = await api.getComposeSession(route.query.uid)
|
||||
attachmentCount.value = resp.data.attachments.length
|
||||
}
|
||||
|
||||
const lookForContacts = debounce(async (search) => {
|
||||
|
||||
@@ -251,7 +251,7 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
const { $gettext, $ngettext } = useGettext()
|
||||
const { displayNotification, reloadMailboxCounters } = useBusStore()
|
||||
const { displayNotification, reloadMailboxCounters, reloadData } = useBusStore()
|
||||
const webmailStore = useWebmailStore()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
@@ -324,6 +324,7 @@ const updateScheduledEmail = async (datetime) => {
|
||||
selectedScheduledEmail.value.scheduled_id,
|
||||
data
|
||||
)
|
||||
reloadData()
|
||||
fetchEmails()
|
||||
displayNotification({ msg: $gettext('Scheduling updated') })
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ export const useBusStore = defineStore('bus', () => {
|
||||
reloadMailboxCounters,
|
||||
dataKey,
|
||||
mbCounterKey,
|
||||
reloadData,
|
||||
$reset,
|
||||
}
|
||||
})
|
||||
|
||||
@@ -7,6 +7,7 @@ from modoboa.calendars import jobs as calendars_jobs
|
||||
from modoboa.core import jobs as core_jobs
|
||||
from modoboa.admin import jobs as admin_jobs
|
||||
from modoboa.maillog import jobs as maillog_jobs
|
||||
from modoboa.webmail import jobs as webmail_jobs
|
||||
|
||||
|
||||
register(core_jobs.clean_logs, queue_name="modoboa", cron="0 0 * * *")
|
||||
|
||||
@@ -43,9 +43,6 @@ SITE_ID = 1
|
||||
# Not used for Modoboa WebMail; configure that in the Modoboa admin settings.
|
||||
#
|
||||
# * HOSTNAME: External hostname that clients should connect to
|
||||
# * Supports Thunderbird-style placeholders to substitute values from the
|
||||
# email address originally entered into the mail client:
|
||||
# %EMAILADDRESS%, %EMAILLOCALPART%, %EMAILDOMAIN%
|
||||
# * SOCKET_TYPE: Actually the encryption settings
|
||||
# * May be one of: 'SSL' (immediate TLS), 'STARTTLS' or 'plain' (bad)
|
||||
# * PORT: TCP port that the client should use when connecting to the server
|
||||
|
||||
@@ -15,8 +15,9 @@ def send_scheduled_message(message_id: int):
|
||||
|
||||
|
||||
def send_scheduled_messages():
|
||||
now = timezone.now().replace(second=0, microsecond=0)
|
||||
messages = models.ScheduledMessage.objects.filter(
|
||||
scheduled_datetime__lte=timezone.now(),
|
||||
scheduled_datetime__lte=now,
|
||||
status=constants.SchedulingState.SCHEDULED.value,
|
||||
)
|
||||
queue = django_rq.get_queue("modoboa")
|
||||
|
||||
@@ -65,10 +65,13 @@ def schedule_email(
|
||||
request, attributes: dict, attachments: list
|
||||
) -> models.ScheduledMessage:
|
||||
"""Schedule a new email sending."""
|
||||
scheduled_datetime = attributes["scheduled_datetime"].replace(
|
||||
second=0, microsecond=0
|
||||
)
|
||||
sched_msg = models.ScheduledMessage(
|
||||
account=request.user,
|
||||
sender=attributes["sender"],
|
||||
scheduled_datetime=attributes["scheduled_datetime"],
|
||||
scheduled_datetime=scheduled_datetime,
|
||||
to=",".join(attributes["to"]),
|
||||
subject=attributes.get("subject", ""),
|
||||
body=attributes.get("body", ""),
|
||||
|
||||
Reference in New Issue
Block a user