{"id":480,"date":"1997-09-09T01:36:29","date_gmt":"1997-09-09T09:36:29","guid":{"rendered":"http:\/\/www.birdhouse.org\/betips\/?p=480"},"modified":"1997-09-09T01:36:29","modified_gmt":"1997-09-09T09:36:29","slug":"create-people-files-automatically","status":"publish","type":"post","link":"https:\/\/www.betips.net\/?p=480","title":{"rendered":"Create people files automatically"},"content":{"rendered":"<p>The following script will parse all the email messages in your inbox, generating<br \/>\n a People file with name and email-address for each person who sent you a<br \/>\n message. Existing People files with the same name will not be clobbered.<br \/>\n<i> [Editor&#8217;s note: If you use Mail-It and want to be more selective about this process, just click the sender&#8217;s email address in the header pane to add that person to your People database quickly.] <\/i><\/p>\n<pre>\ncd ~\/mail\/in\nfind . -type f | {\nread file\nwhile [ \"$file\" != \"\" ]\ndo\n  NAME=$(catattr MAIL:name \"$file\")\n  NAME=$(echo $NAME|awk '{print $3}' FS=\" : \")\n  if [ \"$NAME\" != \"\" ]\n  then\n    EMAIL=$(catattr MAIL:from \"$file\")\n    EMAIL=$(echo $EMAIL|awk '{print $2}' FS=\"&amp;lt;\")\n    EMAIL=$(echo $EMAIL|awk '{print $1}' FS=\"&amp;gt;\")\n    if [ \"$EMAIL\" != \"\" ]\n    then\n      FILE=\/boot\/home\/people\/$NAME\n      if [ ! -f \"$FILE\" ]\n      then\n        touch \"$FILE\"\n        addattr -t string BEOS:TYPE application\/x-person \"$FILE\"\n        addattr -t string META:name \"$NAME\" \"$FILE\"\n        addattr -t string META:email $EMAIL \"$FILE\"\n        echo $NAME : $EMAIL\n      fi\n    fi\n  fi\n  read file\ndone\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The following script will parse all the email messages in your inbox, generating a People file with name and email-address for each person who sent you a message. Existing People files with the same name will not be clobbered. [Editor&#8217;s note: If you use Mail-It and want to be more selective about this process, just [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[8],"class_list":["post-480","post","type-post","status-publish","format-standard","hentry","tag-misc"],"_links":{"self":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/480","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=480"}],"version-history":[{"count":0,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/480\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}