From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6846438166349479936 X-Received: by 2002:a05:6602:29d2:: with SMTP id z18mr27655191ioq.185.1594078033298; Mon, 06 Jul 2020 16:27:13 -0700 (PDT) X-BeenThere: supmua@googlegroups.com Received: by 2002:a02:ceab:: with SMTP id z11ls2549537jaq.0.gmail; Mon, 06 Jul 2020 16:27:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6dedjvhqxkxMRInjTuYf2DaWr1lQd8nXiOHWoJDnm+6jLmVZh0yHt2qgQmd/Ce+K8yx4p X-Received: by 2002:a05:6638:771:: with SMTP id y17mr18550242jad.96.1594078032836; Mon, 06 Jul 2020 16:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594078032; cv=none; d=google.com; s=arc-20160816; b=JFDe6LWNOfHYBeUjlBOqI0flX5VprtlILL2FRELSiDusi+4fr1hJHO8+xHC7k0k32O v/H5uzzFqzRkiixp7BOPkvU71UA2klVETBjL1tmanCFSVtIC/LZKZcRSX3jOuhPmzRCL 0mhdgI7ktduA4XC9D7vPc3Uwq9AcOKmtrDAujSe+oDCDadDiuorcMszMXwtBxAy6IDMA qZm5zfLvCy68zeG/9FYtYr0x4UtkVtHesckzl0u+zysFNhndCnEamgZDp0kowZ3Eo0g8 jRrAFMd4uMNJlaN2/XMPbgZMPbvGo1ebgAoicRA8a9nvhd2CqhMV24s4OpmWccfTH67s 22qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:user-agent:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature:dkim-signature; bh=SpaM3ydTI/BCzmHl8GTsKZox38fLyJbrgheJM6PyiIE=; b=juHPnv404/RREbsKG/Z4aPbO18hVlpS0W4SvW/JxXX4kwiGY2/NPOv9my9cfQ/k/3s 2EcW8kQpnRe3K4GE+I4QV8pFcrud1QCaoamVFTzstSvnldBE9/b/dbLw3340IoJXjyuh UK4OYl2z5EEkg169BloiEjb5kTVxuJBspJORcikxW8PrTbqx0+di+h9pW7i6YcSZHTD/ WpflLVszUcOeDiWEI6mwxbkqM/ZnzsoI48ZeQX80FwdxL8tC9GvmNH2d9PhXQ6OAQd56 pEVKy4bNGadDZPAo2jqsgCbfGOdYOmm36bjOUrn9SvIthEA1Z6RwHIXmPk+Rnq6Eu37t 9A3w== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@parris.org header.s=fm1 header.b=BKVaHF5b; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=pbl8pzDl; spf=pass (google.com: domain of ipv2.lst@parris.org designates 66.111.4.230 as permitted sender) smtp.mailfrom=ipv2.lst@parris.org Return-Path: Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com. [66.111.4.230]) by gmr-mx.google.com with ESMTPS id i20si700770iow.2.2020.07.06.16.27.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2020 16:27:12 -0700 (PDT) Received-SPF: pass (google.com: domain of ipv2.lst@parris.org designates 66.111.4.230 as permitted sender) client-ip=66.111.4.230; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@parris.org header.s=fm1 header.b=BKVaHF5b; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=pbl8pzDl; spf=pass (google.com: domain of ipv2.lst@parris.org designates 66.111.4.230 as permitted sender) smtp.mailfrom=ipv2.lst@parris.org Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id E09D9580183; Mon, 6 Jul 2020 19:27:11 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 06 Jul 2020 19:27:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=parris.org; h= content-type:from:to:cc:subject:in-reply-to:references:date :message-id:content-transfer-encoding; s=fm1; bh=SpaM3ydTI/BCzmH l8GTsKZox38fLyJbrgheJM6PyiIE=; b=BKVaHF5bF+rXMl8QmM6o/BhUO5ZZDSy 6tW7GSAgDbv3+h6+bswRmxdXSOllrwIegUqtKnbaF8ShToT+zl7b7CgGajslYEr8 t39n5Ubptirbvd1MPYJxKlZO/Ajmiv1e3a0wwSeKHVVOH0ECuUxm9a+C4pXgKar2 +jJ1Iw64hXTUbQcWsPPFWwN0zZ4G8IL+DSId42e+ZvL3AvKYGvZYYm6HXT6TxCDw grVWdghMGtaCwbJx2HuJcgsZDDFIjvWCCdusyPKKUrQTgdDwniCIt+HwqfFEgCka cDF7gfAkQWZnT0fIX3TnelX1xC1ZEjAX8iwSfLNBSomfFla8Yi+0Vxg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=SpaM3ydTI/BCzmHl8GTsKZox38fLyJbrgheJM6PyiIE=; b=pbl8pzDl bTkaPblIJPNQ/L42/CY2/8bALbz3Xm+zyp3KLLpyUaghU+Z7Bsj6M/Pu1Afdb61I l9+ey5GY9Mqpahe8qcNP0ee8jBEP1g1Z6PWVhgu4Aid8h2omaKGW3VKCrkO1XpC6 7e4I2ddW20LgobNl8ROzm7/lqi6fIGrb9IaI4i/Fliw2l+J/n7DAMgXFrvdl1xfU eJW8mer4iSHRScwN9Kpx0TDr+JagyK0NQ99fUI3lcPZz4u9pC8Rg4u3sonHC/vlJ 3UroE9Wa+W+Ggz1PDfJo0/smuftR9hK4J/GIbvR9pSindAZWjejRZbf94Hdn+OzS PxCgQBR6s1O8tQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudeggddvvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurheptgfhvffujghffffkfgfgsehtkeertd dtreejnecuhfhrohhmpefkrghinhcurfgrrhhrihhsuceoihhpvhdvrdhlshhtsehprghr rhhishdrohhrgheqnecuggftrfgrthhtvghrnhepkedtueeuudehgfejfefhveduffevje dtffekudevuddtkeefieevieejkeevueegnecuffhomhgrihhnpehgihhthhhusgdrtgho mhdptghhrhhishhtohhprdgtlhhusgenucfkphepiedvrdefrdeigedrgedunecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhpvhdvrdhlshht sehprghrrhhishdrohhrgh X-ME-Proxy: Received: from localhost (unknown [62.3.64.41]) by mail.messagingengine.com (Postfix) with ESMTPA id 3A16230653ED; Mon, 6 Jul 2020 19:27:11 -0400 (EDT) Content-Type: text/plain; charset=UTF-8 From: Iain Parris To: Robert Winkler Cc: The Sup email client Subject: Re: [sup] SpamAssassin (Spam/Ham) support for Sup In-reply-to: <7c75d917-b99e-4e95-af72-d308acfcb7ado@googlegroups.com> References: <7c75d917-b99e-4e95-af72-d308acfcb7ado@googlegroups.com> Date: Tue, 07 Jul 2020 00:27:10 +0100 Message-Id: <1594076857-sup-7295@ceres> User-Agent: Sup/0.22.1 Content-Transfer-Encoding: 8bit Hi Robert, Excerpts from Robert Winkler's message of 2020-07-06 11:36:45 -0700: > However: How could I mark mails as Spam/ Ham and move them into a separate > IMAP Folder? > > Ideally, I would just tag them with ",s" for Spam and ",h" as Ham, and when > synching, the mails are moved (or better copied?) for training. I understand what you are aiming for. This is an interesting question. :-) Sup has hooks, and I believe these could be used to extend Sup with this functionality. For a full list of hooks, launch sup with "--list-hooks". (See .) Are you looking to operate on threads (groups of messages) or individual emails? For example, existing hook "mark-as-spam" operates on an entire thread, not an individual message - which I suspect is probably not what you're looking for Instead, to operate on individual messages (which I think is what SpamAssassin would prefer), I think creating a custom variant inspired by the existing "pipe_message" method may succeed. This allows you to pipe an entire email message to any arbitrary *nix command (e.g., could be used to write the message contents to a new file in either a special "ham" or "spam" directory, which in turn could be fed into sa-learn). (For a demonstration of pipe_message, open a message in Sup, then type "|" and enter, then: "wc -l" and enter. This calls "wc -l" with the message contents, and returns a line count.) So I think it would be possible to accomplish what you are looking for with two hooks: - "startup" hook: Extend Redwood::ThreadViewMode with new methods, e.g., send_to_sa_ham and send_to_sa_spam. For inspiration, see Redwood::ThreadViewMode#pipe_message (in file lib/sup/modes/thread_view_mode.rb). - "keybindings" hook: To bind keys to the new functions. For inspiration from another user, see: - this shows an example of extending Sup (Redwood) classes with new methods, and binding keys to these new methods. I know this is only a very rough outline of a possible solution - but does this make sense, and sound like a path you may be interested in? Kind regards, Iain