Email: Difference between revisions
adds mail test script |
No edit summary |
||
| Line 61: | Line 61: | ||
=== How do I use the 'mail' command? === | === How do I use the 'mail' command? === | ||
You're on a linux server and you see "You've got mail". So, you type 'mail' and immediately have no idea how to process the messages. See this excellent tutorial/write-up of the basic '''mail''' command: http://www.johnkerl.org/doc/mail-how-to.html The <code>mail</code> command works like the editor '''<code>ed</code>''' which is to say not very well known today. (See <code>man mail</code> -- The manual page was written in 1993.) The man page refers to [https://docs.freebsd.org/44doc/usd/07.mail/paper.pdf The Mail Reference Manual] originally written by Kurt Shoens | You're on a linux server and you see "You've got mail". So, you type 'mail' and immediately have no idea how to process the messages. See this excellent tutorial/write-up of the basic '''mail''' command: http://www.johnkerl.org/doc/mail-how-to.html The <code>mail</code> command works like the editor '''<code>ed</code>''' which is to say not very well known today. (See <code>man mail</code> -- The manual page was written in 1993.) The man page refers to [https://docs.freebsd.org/44doc/usd/07.mail/paper.pdf The Mail Reference Manual] originally written by Kurt Shoens | ||
=== What is my mail server doing? === | |||
<code>mailq</code> tells you about what's in the queue (What it's going to send). | |||
Grepping the mail log can tell you where your server has sent mail. | |||
<source lang="bash"> | |||
grep --perl-regex --only-matching ' to=[^ ,]*' /var/log/maillog | awk -F= '{print $2}' | sort | uniq -c | |||
</source> | |||
<pre> | |||
37 admin@equality-tech.com\t | |||
305 meza-ansible | |||
305 <meza-ansible@my.qualitybox.us> | |||
35 root | |||
</pre> | |||
== Tools == | == Tools == | ||