Technology Insights

Send Mail Attachments Using mail Command From A Linux Shell

One thing that can be really helpful for Linux administrators is sending mail attachments via the Linux command line. It is fairly widely known that you can inject text files into email by piping the outputs of those files to the mail command however something that is less known is attaching files to an email sent via mail. The information below describes how to send mail from a Linux shell using the mail command.

Details
Technology Errors

Cannot Update Mailbox /var/mail/root For User Root. Error Writing Message: File Too Large

Earlier today while looking into an issue on a CentOS Linux server I noticed an error message in the maillog file. The mail server running on this Linux server is Postfix and it appeared to have been complaining of the size of root’s mailbox located at /var/mail/root. When I first started investigating I figured I was going to see root’s mailbox at a size of 1GB or 2GB but I was surprised when looking into the issue that root’s mailbox was only about 48MB in size so at first I thought there might be another problem. After some digging around in /etc/postfix I figured out that Postfix limits the size of local mailboxes to 51200000 bytes or 48.8MB. Below is information on how I discovered the issue as well as how to modify the size that Postfix limits local mailboxes to.

Details
Technology Insights

PostgreSQL: Run A SELECT Statement From A Linux Shell Using PSQL

Earlier today I was troubleshooting some resource issues on a PostgreSQL server and needed to test some various SELECT statements to see if any of them were causing problems. I also wanted to verify the amount of resources a SELECT statement made using PGAdmin versus the amount of resources the same SELECT statement used running it directly on the Postgres server itself. Below is information on how to run a SELECT statement from a Linux shell. In this example the server is running CentOS Linux and PostgreSQL 8.4.4.

Details