       Logger.log "Finished processing message with ID '%s'", messageId
 
     # delete the scheduled butler mail, because we couldn't find the real message
-    @deleteButlerMail messageId # pass "" + x in case messageId is undefined (should not happen)
+    @DB.remove props # pass "" + x in case messageId is undefined (should not happen)
     return
 
   # Get a label or create it

      ScriptApp.newTrigger("process").timeBased().everyMinutes(MailButler.FREQUENCY_MINUTES).create()
    return

  @processButlerMails: (d) ->
    Logger.log "Checking for scheduled mails on %s", d

    validKeys = []
    for key in UserProperties.getKeys()
      if @isButlerMessage key
        validKeys.push key

    if validKeys.length > 0
      
      # yep there are some
      Logger.log "Found %s possible candidates", validKeys.length

      now = d.getTime()
      for key in validKeys
        props = @getButlerMail key, true
        @processButlerMail props  if isNaN(props.when) or props.when <= now

    else
      # No scheduled messages available

  butler = new MailButler request.parameter.callback

  switch request.parameter.action
    when 'uninstall'
      out = MailButler.uninstall true
    when 'dump'
      out = butler.result null, MailButler.getScheduledMails()
    when 'schedule'
      out = butler.scheduleJson request.parameter
    when 'setup'
