Revision 583bfaa0

b/logic/callbacks.py
112 112
    try:
113 113
        msg = json.loads(message.body)
114 114

  
115
        email_send.send(sender=msg['frm'], recipient = msg['to'],
115
        sent = email_send.send(sender=msg['frm'], recipient = msg['to'],
116 116
                        body=msg['body'], subject=msg['subject'])
117
        message.channel.basic_ack(message.delivery_tag)
117

  
118
        if not sent:
119
            _logger.warn("Failed to send email to %s", msg['to'])
120
        else:
121
            message.channel.basic_ack(message.delivery_tag)
118 122
    except KeyError:
119 123
        _logger.error("Malformed incoming JSON, missing attributes: %s",
120 124
                      message.body)
b/logic/email_send.py
62 62
    while attempts < 3:
63 63
        try:
64 64
            send_mail(subject, body, sender, [recipient])
65
            return
65
            return True
66 66
        except Exception as e:
67
            logger.warn("Error sending email: ", e)
67
            logger.error("Error sending email: %s", e)
68 68
        finally:
69 69
            attempts += 1
70

  
70 71
    logger.warn("Failed all %d attempts to send email, aborting", attempts)
72
    return False
71 73

  

Also available in: Unified diff