def _send_msg(self, msg, subject, recipients, from_addr=None): '''Send an email from the packagedb.''' if not from_addr: from_addr = self.MAILFROM if config.get('mail.on', False): for person in recipients: email = turbomail.Message(from_addr, person, '[pkgdb] %s' % (subject,)) email.plain = msg turbomail.enqueue(email) else: LOG.debug(_('Would have sent: %(subject)s') % { 'subject': subject.encode('ascii', 'replace')}) LOG.debug('To: %s' % recipients) LOG.debug('From: %s %s' % (from_addr[0].encode('ascii', 'replace'), from_addr[1].encode('ascii', 'replace'))) LOG.debug('%s' % msg.encode('ascii', 'replace'))
def _send_msg(self, msg, subject, recipients, from_addr=None): '''Send an email from the packagedb.''' if not from_addr: from_addr = self.MAILFROM if config.get('mail.on', False): for person in recipients: email = turbomail.Message(from_addr, person, '[pkgdb] %s' % (subject, )) email.plain = msg turbomail.enqueue(email) else: LOG.debug( _('Would have sent: %(subject)s') % {'subject': subject.encode('ascii', 'replace')}) LOG.debug('To: %s' % recipients) LOG.debug('From: %s %s' % (from_addr[0].encode( 'ascii', 'replace'), from_addr[1].encode('ascii', 'replace'))) LOG.debug('%s' % msg.encode('ascii', 'replace'))