On Fri, Jun 17, 2022, at 2:38 AM, Mark Sapiro wrote:
On 6/16/22 03:44, Eggert Ehmke wrote:
I get lots of mails originating from the mailman-web runjobs hourly. They are sent to mailman@<mytld>. The content looks like
07:00:03 [Q] INFO Enqueued 12571 07:00:03 [Q] INFO Enqueued 12572 07:00:03 [Q] INFO Enqueued 12573
How can I disable these emails?
These message come from Django Q, https://django-q.readthedocs.io/en/latest/
I don't think there is a way to disable those specific messages which occur at times when tasks are queued instead of started immediately. They are sent to
mailman
becausemailman
owns the crontab and the crontab has no MAILTO=.
You can't stop those specific messages, but you can set up the log level of django-q to WARNING from INFO so that it doesn't send out these logs.
You want to add something like this in your settings.py in LOGGING config:
https://github.com/Koed00/django-q/blob/15155c7a99ea85a092b1d11da730ba0c4fa9...
"loggers": {
"django_q": {
"handlers": ["file"],
"level": "WARNING",
},
},
Please make sure to *add* "django_q" settings as there might be other existing loggers defined there. Also, I used "file" as the handler for example, so it won't even write to stdout for warning and/or send emails.
Make sure that you change that to your liking to include "console" if you want emails for warning logs.
You can redirect these and all other messages from hourly jobs by surrounding the hourly jobs command in the crontab with MAILTO= as in
MAILTO=other@example.com @hourly /opt/mailman/mm/bin/django-admin runjobs hourly MAILTO=mailman
or possibly discard them with something like
@hourly /opt/mailman/mm/bin/django-admin runjobs hourly > /dev/null
but either of these could redirect or discard other messages from hourly jobs which you might want.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- thanks, Abhilash Raj (maxking)