Sending Email from non-email Ubuntu Server

I have a couple of scripts that use the linux “mail” command to send results of cron jobs, backups, and such. The problem is I don’t want to setup more overhead than I need, nor do I want to setup non-secure services. So after asking the guys on the #uphpu channel, they recommended postfix. So for a Ubuntu 10.04 server, just run the following commands:


aptitude install postfix #when prompted, select Internet Site
aptitude install mailutils

Then bingo, the mail command should work. You can test it by doing:


mail justin@example.com

It will ask for any Cc addresses, and a subject. Then, type your message, and when you are done hit “Ctrl-D” for done.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close