Moodle

Limit emailconnectionerrorsto notification

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.9, 1.9.1
  • Fix Version/s: 1.8.6, 1.9.2
  • Component/s: Other
  • Labels:
    None
  • Database:
    Any
  • Affected Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE

Description

Now, when a database connection fails, email can be sent to a specified address. The problem is at times, up to 100 email messages are sent on one failure.

Latest incident was one message sent every two seconds.

This can clog cell phone email accounts with unnecessary messages and cause admins to specify email message to less priority accounts, defeating its purpose.

Improvement would be to send one or two email messages in a specified interval, (5 minutes or so).

Activity

Hide
Martin Dougiamas added a comment -

I agree this needs fixing, Bill.

Low priority thing for you Dongsheng, but when you need a break from repository stuff.

Look in lib/setup.php for 'emailconnectionerrorsto'.

We can't use the database to store times, obviously, so we need to "touch" a file in dataroot whenever we send an email, and before sending any email, check for the existence of that file and make sure it's at least 600 seconds old before continuing to send.

Show
Martin Dougiamas added a comment - I agree this needs fixing, Bill. Low priority thing for you Dongsheng, but when you need a break from repository stuff. Look in lib/setup.php for 'emailconnectionerrorsto'. We can't use the database to store times, obviously, so we need to "touch" a file in dataroot whenever we send an email, and before sending any email, check for the existence of that file and make sure it's at least 600 seconds old before continuing to send.
Hide
Dongsheng Cai added a comment -

A patch.

Show
Dongsheng Cai added a comment - A patch.
Hide
Dongsheng Cai added a comment -

Please reivew, thanks.

Show
Dongsheng Cai added a comment - Please reivew, thanks.
Hide
Petr Škoda (skodak) added a comment -

closing thanks,
I have only added fclose() between the read and write to the same file (cosmetic issue only)

Show
Petr Škoda (skodak) added a comment - closing thanks, I have only added fclose() between the read and write to the same file (cosmetic issue only)

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: