{"id":1500,"date":"2010-04-27T12:48:23","date_gmt":"2010-04-27T04:48:23","guid":{"rendered":"http:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/?p=1500"},"modified":"2010-04-30T09:10:06","modified_gmt":"2010-04-30T01:10:06","slug":"simple-procmailrc-format","status":"publish","type":"post","link":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/?p=1500","title":{"rendered":"Simple .procmailrc format"},"content":{"rendered":"<p>In other words, your recipe is being used, but the pattern you give<br \/>\ndoes not match the incoming mail.\u00a0 I think you are hoping that &#8220;^FROM&#8221;<br \/>\nis a special procmail expression, like &#8220;^TO&#8221;, &#8220;^FROM_DAEMON&#8221;, and<br \/>\n&#8220;^FROM_MAILER&#8221;;\u00a0 unfortunately, this is not the case.\u00a0 What you meant<br \/>\nis probably:<\/p>\n<p>* ^From:.*jane<\/p>\n<p>However, that would catch mail from &#8220;joe@janet.com&#8221;, which is<br \/>\n^^^^<br \/>\nprobably not quite what you want either.\u00a0 Perhaps<\/p>\n<p>* ^From:.*\\&lt;jane@cs\\.concordia\\.ca\\&gt;<\/p>\n<p>would fit the bill.<\/p>\n<p>What it means is:<\/p>\n<p>*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Start pattern.<\/p>\n<p>^\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Match at beginning of a line; i.e. the next<br \/>\nword or symbol must occur at the start of<br \/>\nthe line.<\/p>\n<p>From:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Match the word &#8220;from&#8221; (upper or lowercase<br \/>\nor mixed), followed by a colon.\u00a0 That&#8217;s the<br \/>\n&#8220;From:&#8221; header.<\/p>\n<p>.*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Match anything (zero or more &#8220;wildcard&#8221;<br \/>\ncharacters);\u00a0 this will eat any &#8220;comments&#8221;,<br \/>\nsuch as the person&#8217;s full name, etc., and<br \/>\npossibly the space after the &#8220;From:&#8221;, though<br \/>\nthe last non-alpha, non-digit character<br \/>\nbefore the start of the thing you want to<br \/>\nmatch will be eaten by&#8230;<\/p>\n<p>\\&lt;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Match a &#8220;word delimiter&#8221; character<br \/>\n(anything except a letter, digit, or<br \/>\nunderscore) or a newline &#8212; this avoids<br \/>\nmatching on, say, &#8220;jbjane@cs&#8230;&#8221;.<\/p>\n<p>jane@cs\\.concordia\\.ca\u00a0 Match your target address, where dots are<br \/>\n*not* wildcards but match real dots.\u00a0 You<br \/>\ndon&#8217;t *have* to escape the dots, but if you<br \/>\ndon&#8217;t, you might accidentally match<br \/>\n&#8220;jane@csxconcordiaxca&#8221;, which is not what<br \/>\nyou want.<\/p>\n<p>\\&gt;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Now match a word delimiter or a newline<br \/>\nagain; this avoids matching the unlikely<br \/>\n&#8220;jane@cs.concordia.cam.org&#8221;, for example.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In other words, your recipe is being used, but the pattern you give does not match the incoming mail. I think you are hoping that &#8220;^FROM&#8221; is a special procmail expression, like &#8220;^TO&#8221;, &#8220;^FROM_DAEMON&#8221;, and &#8220;^FROM_MAILER&#8221;; unfortunately, this is not the case. What you meant is probably:<\/p>\n<p>* ^From:.*jane<\/p>\n<p>However, that would catch mail from [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[3],"tags":[65],"class_list":["post-1500","post","type-post","status-publish","format-standard","hentry","category-computer","tag-mail","odd"],"_links":{"self":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1500","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1500"}],"version-history":[{"count":6,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1500\/revisions"}],"predecessor-version":[{"id":1505,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1500\/revisions\/1505"}],"wp:attachment":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}