{"id":2122,"date":"2011-12-22T08:22:57","date_gmt":"2011-12-22T14:22:57","guid":{"rendered":"http:\/\/icesquare.com\/wordpress\/?p=2122"},"modified":"2011-12-28T15:30:07","modified_gmt":"2011-12-28T21:30:07","slug":"delete-empty-system-mail-box-freebsd-linux","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/delete-empty-system-mail-box-freebsd-linux\/","title":{"rendered":"How to Delete System Mail \/ Empty System Mail box in FreeBSD \/ Linux?"},"content":{"rendered":"<style>\nh2{\nmargin-top:60px;\n}\n<\/style>\n<p><\/p>\n<p><img decoding=\"async\" src=\"\/wordpress\/wp-content\/uploads\/2011\/12\/Junk_mail.jpg\" alt=\"\" title=\"Junk Mail\" width=\"150\" class=\"alignleft\" \/><\/p>\n<p>When I checked my FreeBSD system mail box today, I found that there were 8000 system mails sitting my mail box:<\/p>\n<h2><\/h2>\n<pre>\r\nmail\r\n<\/pre>\n<pre>\r\nMail version 8.1 6\/6\/93.  Type ? for help.\r\n\"\/var\/mail\/root\": 8182 messages 8182 new\r\n>N  1 root@localhost.my.do  Fri Sep 30 03:02  44\/1330  \"x.com output\"\r\n N  2 root@localhost.my.do  Fri Sep 30 03:02  72\/2464  \"x.com output\"\r\n N  3 root@localhost.my.do  Sat Oct  1 03:01  35\/1075  \"x.com output\"\r\n...\r\nAnother 8000 lines go here\r\n<\/pre>\n<p>There are several ways you can do. Either you can go through them one by one and delete them one at a time, i.e.,<\/p>\n<pre>\r\nd\r\n[Hit the ENTER Key]\r\n<\/pre>\n<p>Or specify which mails you like to delete by ID, e.g.,<\/p>\n<pre>\r\nd x-y\r\n[Hit the ENTER Key]\r\n<\/pre>\n<p>where x and y are the start and end of the mail ID, respectively.<\/p>\n<p>For example, if you want to empty your FreeBSD mail box, you can do the following:<\/p>\n<pre>\r\nd 1-8182\r\n[Hit the ENTER Key]\r\n<\/pre>\n<p>where 8182 is the number of mails I have.<\/p>\n<p><\/p>\n<p>You can find the number of your emails when you open your mail box:<\/p>\n<pre>\r\n\"\/var\/mail\/root\": 8182 messages 8182 new\r\n<\/pre>\n<p>Hit the enter key again to confirm that the mail box is empty:<\/p>\n<pre>\r\nAt EOF\r\n<\/pre>\n<p>And leave the mail box.<\/p>\n<pre>\r\nq\r\n<\/pre>\n<p>Now, try to access your mail box again, and the system should tell you that you have no system mail.<\/p>\n<pre>\r\n# mail\r\nNo mail for root\r\n<\/pre>\n<p>That&#8217;s it.<\/p>\n<p><\/p>\n<h2>How to stop generating the system mails<\/h2>\n<p>Whenever the system run a background job, it will store the output of the program and email to the system mail box for auditing purposes. However, you can disable this feature if you don&#8217;t care the output.<\/p>\n<p>Normally, we run a script this way:<\/p>\n<pre>\r\nstart.sh\r\n<\/pre>\n<p>To avoid any output, we do the following instead:<\/p>\n<pre>\r\nstart.sh > \/dev\/null 2>&1\r\n<\/pre>\n<p><\/p>\n<p>For example, if you run many cron jobs, you need to go over your cron job list and add this to every single script, i.e.,<\/p>\n<pre>\r\nsudo nano \/etc\/crontab\r\nor\r\ncrontab -e\r\n<\/pre>\n<p>and add <strong>\/dev\/null 2>&#038;1<\/strong> to every command.<\/p>\n<p>Hope it helps.<\/p>\n<p>&#8211;Derrick<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I checked my FreeBSD system mail box today, I found that there were 8000 system mails sitting my mail box: mail Mail version 8.1 6\/6\/93. Type ? for help. <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/delete-empty-system-mail-box-freebsd-linux\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[94,7,144,6,69],"tags":[171,142,33],"class_list":["post-2122","post","type-post","status-publish","format-standard","hentry","category-computer-problems-computer-help-pc-support","category-freebsd","category-sever-problem","category-technology","category-troubleshooting-technology","tag-freebsd","tag-mail","tag-troubleshooting"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-ye","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1601,"url":"https:\/\/icesquare.com\/wordpress\/freebsd-startup-script-how-to-start-a-script-on-boot-in-freebsd\/","url_meta":{"origin":2122,"position":0},"title":"FreeBSD Startup Script &#8211; How to Start a Script on Boot in FreeBSD (An Alternative Solution to \/etc\/rc.local)","author":"Derrick","date":"September 22, 2011","format":false,"excerpt":"I want to start a script when booting my FreeBSD box automatically. Unlike Linux, FreeBSD does not honor the script you put in \/etc\/rc.local. Usually it is recommended to use the rc service (See here for details), however I think it is too complicated to convert my script to a\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2616,"url":"https:\/\/icesquare.com\/wordpress\/upgrade-freebsd-8-to-9\/","url_meta":{"origin":2122,"position":1},"title":"How to Upgrade FreeBSD from 8 to 9","author":"Derrick","date":"January 9, 2013","format":false,"excerpt":"Upgrading FreeBSD is very easy. Thanks for the simple architecture design and the disconnection between the kernel and the applications (ports), the whole process takes around 15 to 45 minutes. The coolest thing is that the system down time is very short. In my case, the down time was only\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":900,"url":"https:\/\/icesquare.com\/wordpress\/cannot-find-autoconf-please-check-your-autoconf-installation-and-the-php_autoconf-environment-variable-then-rerun-this-script\/","url_meta":{"origin":2122,"position":2},"title":"Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.","author":"Derrick","date":"October 22, 2010","format":false,"excerpt":"This post is about FreeBSD, however the idea is about the same for other Unix systems. While I tried to install memcached, the system complained with this message: Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. This problem is caused by\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1651,"url":"https:\/\/icesquare.com\/wordpress\/set-up-pure-ftpd-server-with-virtual-user-on-freebs\/","url_meta":{"origin":2122,"position":3},"title":"How to Set up a Pure-FTPd Server with Virtual User on FreeBSD","author":"Derrick","date":"October 11, 2011","format":false,"excerpt":"This tutorial is for FreeBSD. If you are looking for setting up Pure-FTPd on Linux, click here. My client likes to send me a huge data file (More than 10GB after compressed). Since I don't care about the security during the transfer, I decide to go with the old school\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"\/wordpress\/wp-content\/uploads\/2011\/10\/pure-ftpd.png","width":350,"height":200},"classes":[]},{"id":2181,"url":"https:\/\/icesquare.com\/wordpress\/freebsd-updateinstalling-updates-install-usrsrcliblibcgenlibc_dlopen-c-no-such-file-or-directory\/","url_meta":{"origin":2122,"position":4},"title":"[FreeBSD-update]Installing updates&#8230;install: \/\/\/usr\/src\/lib\/libc\/gen\/libc_dlopen.c: No such file or directory","author":"Derrick","date":"December 23, 2011","format":false,"excerpt":"When I tried to upgrade my FreeBSD system today, I received a last minute Christmas gift from the FreeBSD team. :-) #sudo freebsd-update fetch Looking up update.FreeBSD.org mirrors... 4 mirrors found. Fetching metadata signature for 8.2-RELEASE from update4.FreeBSD.org... done. Fetching metadata index... done. Inspecting system... done. Preparing to download files...\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3023,"url":"https:\/\/icesquare.com\/wordpress\/freebsdmysql-server-could-not-start\/","url_meta":{"origin":2122,"position":5},"title":"[FreeBSD]MySQL server could not start","author":"Derrick","date":"November 22, 2012","format":false,"excerpt":"Today, I noticed that the MySQL server on my FreeBSD server is down for unknown reason, and today is Thanksgiving. Initially, I tried to restart the MySQL server using the following command, but it didn't help to restart the MySQL: sudo \/usr\/local\/etc\/rc.d\/mysql-server restart and it gives me the following error\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/2122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2122"}],"version-history":[{"count":36,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/2122\/revisions"}],"predecessor-version":[{"id":2179,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/2122\/revisions\/2179"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}