- Ubuntu 14.04 installed as a VM on a machine that sends emails, with attachments, via Perl 5.18.2. That part works because Perl talks directly to the SMTP server.
- Let's call the machine name "myubuntu".
- I have cron jobs that used to send the local "myubuntu" account mail when done which included any error messages. I read the emails via alpine.
- I recently installed SSMTP, Postfix, sendemail to try and send emails with attachments via cron, but those didn't send attachments. I suspect these uninstalled sendmail.
- My cron jobs run fine, as my Perl program emails them to another email, but my cron jobs no longer send email to the local 'chuck' account on the machine "myubuntu".
- I believe I changed my "myubuntu" to "myubuntu.net" somewhere but I don't remember where. I checked /etc/hosts and /etc/hostname to no avail.
- When using alpine to send a test email from 'chuck' to 'chuck' I get this error: "Cannot find /usr/sbin/sendmailb".
- So I installed sendmail, and tested this with an 'at' job, but got no email on "chuck@myubuntu".
- When I ping "myubuntu.net" I get: 5 packets transmitted, 0 received, 100% packet loss. I have the same problem when I ping 127.0.0.1.
How do I get cron to send email back to the local 'chuck' account again? Crontab has "MAIL=chuck" in the crontab file. Why isn't that going to the local account?
Should I uninstall postfix, ssmtp, and sendmail?
EDIT: when I type 'mailq' I get this error on every email: "Deferred: Connection timed out with [127.0.0.1]". So perhaps my /etc/hosts file is not set up right, or I didn't refresh it correctly? How do I refresh things when I change my /etc/hosts?