grr/server/grr_response_server/flows/general/administrative.py
def SendMail(self, responses):
    """Sends a mail when the client has responded."""
    if responses.success:
      if data_store.RelationalDBReadEnabled():
        client = data_store.REL_DB.ReadClientSnapshot(self.client_id)
        hostname = client.knowledge_base.fqdn
      else:
        client = aff4.FACTORY.Open(self.client_id, token=self.token)
        hostname = client.Get(client.Schema.FQDN)

      subject = self.__class__.subject_template.render(hostname=hostname)
      body = self.__class__.template.render(
          client_id=self.client_id,
          admin_ui=config.CONFIG["AdminUI.url"],
          hostname=hostname,
          url="/clients/%s" % self.client_id,
          creator=self.token.username,
          signature=utils.SmartUnicode(config.CONFIG["Email.signature"]))

      email_alerts.EMAIL_ALERTER.SendEmail(
          self.args.email,
          "grr-noreply",
          utils.SmartStr(subject),
          utils.SmartStr(body),
          is_html=True)
    else:
      flow.FlowError("Error while pinging client.")
Sends a mail when the client has responded.
Sends a mail when the client has responded.
Sends a mail when the client has responded .
def SendMail(self, responses):
    if responses.success:
      if data_store.RelationalDBReadEnabled():
        client = data_store.REL_DB.ReadClientSnapshot(self.client_id)
        hostname = client.knowledge_base.fqdn
      else:
        client = aff4.FACTORY.Open(self.client_id, token=self.token)
        hostname = client.Get(client.Schema.FQDN)
      subject = self.__class__.subject_template.render(hostname=hostname)
      body = self.__class__.template.render(
          client_id=self.client_id,
          admin_ui=config.CONFIG["AdminUI.url"],
          hostname=hostname,
          url="/clients/%s" % self.client_id,
          creator=self.token.username,
          signature=utils.SmartUnicode(config.CONFIG["Email.signature"]))
      email_alerts.EMAIL_ALERTER.SendEmail(
          self.args.email,
          "grr-noreply",
          utils.SmartStr(subject),
          utils.SmartStr(body),
          is_html=True)
    else:
      flow.FlowError("Error while pinging client.")
def SendMail ( self , responses ) : if responses . success : if data_store . RelationalDBReadEnabled ( ) : client = data_store . REL_DB . ReadClientSnapshot ( self . client_id ) hostname = client . knowledge_base . fqdn else : client = aff4 . FACTORY . Open ( self . client_id , token = self . token ) hostname = client . Get ( client . Schema . FQDN ) subject = self . __class__ . subject_template . render ( hostname = hostname ) body = self . __class__ . template . render ( client_id = self . client_id , admin_ui = config . CONFIG [ "AdminUI.url" ] , hostname = hostname , url = "/clients/%s" % self . client_id , creator = self . token . username , signature = utils . SmartUnicode ( config . CONFIG [ "Email.signature" ] ) ) email_alerts . EMAIL_ALERTER . SendEmail ( self . args . email , "grr-noreply" , utils . SmartStr ( subject ) , utils . SmartStr ( body ) , is_html = True ) else : flow . FlowError ( "Error while pinging client." )
Sends a mail when the client has responded.
Sends a mail when the client has responded .
"""Sends a mail when the client has responded."""
self
responses