import jingrow
from jingrow.utils import validate_email_address


def execute():
	for name, email in jingrow.get_all("Email Group Member", fields=["name", "email"], as_list=True):
		if not validate_email_address(email, throw=False):
			jingrow.db.set_value("Email Group Member", name, "unsubscribed", 1)
			jingrow.db.commit()
