<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>hi, it&#39;s mike</title>
    <link>https://mike.puddingtime.org/tags/spam/</link>
    <description>Recent content on hi, it&#39;s mike</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>mike@puddingtime.org (mike)</managingEditor>
    <webMaster>mike@puddingtime.org (mike)</webMaster>
    <copyright>© 2026, mike</copyright>
    <lastBuildDate>Wed, 08 Jul 2009 21:43:22 +0000</lastBuildDate>
    <atom:link href="https://mike.puddingtime.org/tags/spam/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Desperate Times</title>
      <link>https://mike.puddingtime.org/posts/2009-07-08-desperate-times/</link>
      <pubDate>Wed, 08 Jul 2009 21:43:22 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2009-07-08-desperate-times/</guid>
      
      <description>… call for hacked up measures.
[sourcecode language=&#34;ruby&#34;] !/usr/bin/env ruby require &amp;quot;rubygems&amp;quot; require &amp;quot;appscript&amp;quot; require &amp;quot;tmail&amp;quot; include Appscript mail = app(&amp;quot;Mail&amp;quot;) messages = mail.selection.get filter = &amp;quot;&amp;quot; messages.each do |m| message = …</description>
      <content:encoded><![CDATA[<p>&hellip; call for hacked up measures.</p>
<pre><code>[sourcecode language=&quot;ruby&quot;] 

!/usr/bin/env ruby

require &amp;quot;rubygems&amp;quot;

require &amp;quot;appscript&amp;quot;

require &amp;quot;tmail&amp;quot;

include Appscript

mail = app(&amp;quot;Mail&amp;quot;)

messages = mail.selection.get

filter = &amp;quot;&amp;quot;

messages.each do |m|

	message = TMail::Mail.parse(m.source.get)

	message.from.each do |f|

    domain = f.gsub(/^.+?(@.+?)/, &amp;quot;\\1&amp;quot;)

    unless string.include?(domain)

  		filter &amp;lt;&amp;lt; &amp;quot; OR &amp;quot; + domain

    end

  end

end

`echo {filter}|pbcopy`

`open &amp;quot;https://mail.google.com/mail/?hl=en&amp;amp;tab=wmsettings/filters&amp;quot;`

[/sourcecode]
</code></pre>
<p>I think this might be one of the laziest things I&rsquo;ve ever done, but some months ago I inherited three addresses that made their way onto some of the least relevant media distribution lists I&rsquo;ve ever encountered. I could report them as spam, but they&rsquo;re not, exactly. They&rsquo;re just super irrelevant.  For reasons not worth going into, it&rsquo;s somewhat difficult to reliably unsubscribe from these lists, so I&rsquo;ve got a filter in Gmail for blackholing the worst of them.</p>
<p>This script just does me the favor of copying what I need to paste into that filter to the clipboard and opening the filters options in Gmail for me.  Saves a step or two. I&rsquo;m currently up to 37 domains.</p>
<p>I looked at doing more of this in AppleScript/appscript by modifying a rule in Mail, but it doesn&rsquo;t look like the scripting interface exposes the conditions of a given rule object, just the actions it takes and any qualifiers. Plus, better to do filtering on the server than the client anyhow.</p>
<p>#e-mail #gmail #ruby #spam</p>
<p><em><a href="mailto:mike@puddingtime.org?subject=Re%3A%20Desperate%20Times">Drop a line about this</a>.</em></p>]]></content:encoded>
    </item>
  </channel>
</rss>
