def send_notifications(self, group_name, msg_id, thread_id, parent_id, msg_author, msg_email, msg_subject, msg_body):
        msg_tpl = """From: Phorum <%(recipient)s>
To: %(recipient)s
Subject: Moderate for %(forum_name)s at %(phorum_server_hostname)s Message: %(msg_id)s.

Subject: %(msg_subject)s
Author: %(msg_author)s
Message: %(phorum_url)s/read.php?f=%(forum_id)s&i=%(msg_id)s&t=%(thread_id)s&admview=1

%(msg_body)s

To delete this message use this URL:
%(phorum_admin_url)s?page=easyadmin&action=del&type=quick&id=%(msg_id)s&num=1&thread=%(thread_id)s

To edit this message use this URL:
%(phorum_admin_url)s?page=edit&srcpage=easyadmin&id=%(msg_id)s&num=1&mythread=%(thread_id)s

"""
        # get the forum_id for this group_name
        stmt = """
                SELECT
                    id,
                    name
                FROM
                    forums
                WHERE
                    nntp_group_name='%s'""" % (group_name)
        self.cursor.execute(stmt)
        forum_id, forum_name = self.cursor.fetchone()
        # open the main configuration file
        fp = open("%sforums.php" % (settings.phorum_settings_path), "r")
        content = fp.read()
        fp.close()
        # regexps to get the content from the phorum configuration files
        phorum_url = url_regexp.search(content, 0).groups()[2]
        phorum_admin_url = admin_regexp.search(content, 0).groups()[2]
        phorum_server_hostname = server_regexp.search(content, 0).groups()[3]
        # connect to the SMTP server
        smtp = smtplib.SMTP('localhost')
        emails = self.get_notification_emails(forum_id)
        for recipient in emails:
            current_msg = msg_tpl % vars()
            smtp.sendmail("Phorum <%s>" % (recipient), recipient, current_msg)

        # XXX: Coding blind here. I really don't know much about how Phorum works with
        # XXX: sending forum postings as emails, but it's here. Let's call this a
        # XXX: temporary implementation. Should work fine, I guess.
        phorum_mail_code = mail_code_regexp.search(content, 0).groups()[3]
        notification_mail_tpl = """Message-ID: <%(random_msgid)s@%(phorum_server_hostname)s>
From: %(msg_author)s %(msg_email)s
Subject: %(msg_subject)s
To: %(forum_name)s <%(email_list)s>
Return-Path: <%(email_return)s>
Reply-To: %(email_return)s
X-Phorum-%(phorum_mail_code)s-Version: Phorum %(phorum_version)s
X-Phorum-%(phorum_mail_code)s-Forum: %(forum_name)s
X-Phorum-%(phorum_mail_code)s-Thread: %(thread_id)s
X-Phorum-%(phorum_mail_code)s-Parent: %(parent_id)s

This message was sent from: %(forum_name)s.
<%(phorum_url)s/read.php?f=%(forum_id)s&i=%(msg_id)s&t=%(thread_id)s>
----------------------------------------------------------------

%(msg_body)s

----------------------------------------------------------------
Sent using Papercut version %(__VERSION__)s
"""
        stmt = """
                SELECT
                    email_list,
                    email_return
                FROM
                    forums
                WHERE
                    LENGTH(email_list) > 0 AND
                    id=%s""" % (forum_id)
        num_rows = self.cursor.execute(stmt)
        if num_rows == 1:
            email_list, email_return = self.cursor.fetchone()
            msg_body = strutil.wrap(msg_body)
            if 0 > len(msg_email):
                msg_email = '<%s>' % msg_email
            else:
                msg_email = ''
            random_msgid = md5.new(str(time.clock())).hexdigest()
            # this is pretty ugly, right ?
            from papercut import __VERSION__
            phorum_version = settings.phorum_version
            current_msg = notification_mail_tpl % vars()
            smtp.sendmail('%s %s' % (msg_author, msg_email), email_list, current_msg)
        smtp.quit()
dataset/ETHPy150Open jpm/papercut/storage/phorum_mysql.py/Papercut_Storage.send_notifications/swapped operands of `>`