Page MenuHomePhabricator

pywikibot User send_email function cannot handle a mass mailing?
Closed, ResolvedPublic

Description

I am using the pywikibot User send_email function to send an e-mail to a list of users.

This works quite well, except that the script is sleeping for 4000 s after about 15 messages have been sent, with the error message:

> WARNING: API error ratelimited: As an anti-abuse measure, you are limited from performing this action too many times in a short space of time, and you have exceeded this limit. Please try again in a few minutes.
> WARNING: Waiting 4e+03 seconds before retrying.
> 4000 seconds is more than 1 hour of waiting...

I have a few questions:

  • Does it matter which platform I use to log on (Wikipedia, Wikidata, Wikimedia Commons)?
  • Does a quota parameter need to be adjusted somewhere (user, system)?
  • Or do I need a (special) bot flag to handle larger volumes?

Event Timeline

JJMC89 subscribed.

The limitation is from MediaWiki, not Pywikibot.

Current Wikimedia limits
		'emailuser' => [
			'ip' => [ 5, 86400 ], // 5 per day per ip (logged-out and new users)
			'newbie' => [ 5, 86400 ], // 5 per day for non-autoconfirmed
			'user' => [ 20, 86400 ], // 20 per day for users
		],

Accounts with the noratelimit right should bypass those limits.

How could I request the noratelimit right?

That will vary depending on the wiki. On most wikis, it is part of the sysop and bot groups.

If your tool is sending the emails as the logged-in user via OAuth, each user would need the right on their account.

Could it be acceptable to add e.g. ?

		'bots' => [ 2000, 86400 ],

The bot group has the noratelimit right, so the limits do not apply to them.

Apparently the noratelimit right was removed from the group bots in Wikidata, see T258354 ?

Then you'll need to address your use case with the Wikidata devs.