测试列表文件需要您的许可才能访问Google上的数据

时间:2017-10-22 16:10:50

标签: google-apps-script

每次运行任何Google脚本时,都会弹出此消息。

  

- 测试列表文件需要您的许可才能访问Google上的数据。

我从第三方应用中删除了它,但它仍然不断弹出。我试图运行一个脚本来收集所有被拒绝的电子邮件,并希望访问更多访问权限,我否认了。下面是脚本。某些东西嵌入某处,我不知道在哪里。

function getBouncedEmails() {

    /* Written by Amit Agarwal */
    /* Email: amit@labnol.org  */

    // Write the bounced email report to a Google SpreadsheetApp
   /var sheet = SpreadsheetApp.getActiveSheet();
    sheet.getRange(2, 1, sheet.getLastRow(), sheet.getLastColumn()).clearContent();

    // Find all emails returned via Gmail Mailer Maemon
    var query = "from:(mailer-daemon@google.com OR mailer-daemon@googlemail.com)";

    // Get the most recent 1000 bounced email messages in Gmail
    GmailApp.search(query, 0, 1000).forEach(function(thread) {
        thread.getMessages().forEach(function(message) {
            if (message.getFrom().indexOf("mailer-daemon") !== -1) {
                var body = message.getPlainBody();
                 Get the bounced email address from the body
                var matches = body.match(/Delivery to[\s\S]+?(\S+\@\S+)\s([\s\S]+?)----- Original Message/);

            }
        });
   });
}

1 个答案:

答案 0 :(得分:1)

以下是如何防止任何Google Script访问您的数据。

  1. 转到https://security.google.com/settings/security/permissions

  2. 单击要卸载的脚本

  3. 然后单击“删除”,您就完成了。