• Mac OS X

    Automatically Emailing Logs

    As I have mentioned in the past, you can send mail from the command line by initiating a telnet session into port 25 of a mail server. Provided you have setup Mail.app you can also email from the command line using the mail command. In the below command we’re going to pipe the contents of a log file into an email by reading the contents using a cat command. From the output of the cat command we’re then going to email the contents of the file to an email address, specifying the subject line of the email using the -s option of the ppp command: cat /var/log/ppp.log | mail -s…