Search:  
Gentoo Wiki

Nail

Introduction

Nail is an expansion of Mail that compiles in SMTP support. This document describes how to quickly set up SMTP within Nail for applications autonomously sending e-mails. After following the steps below, nail will provide the system with SMTP support.

Make sure nail is compiled with the "net" use flag, which enables SMTP support. Package.use is suggested, however see FAQ_USE_Flags for more options. Append the following to your Package.use file:

File: /etc/portage/package.use
mail-client/nail net

Then when you are ready:

  1. Emerge nail
  2. Tell nail where your SMTP server is
    1. Create the .mailrc file
    2. Add the address of your server
emerge nail
touch /root/.mailrc
echo set smtp=<smtp server address> >> /root/.mailrc

To test your configuration, cat the output of fstab and e-mail it to yourself with nail. There are more options available while using nail than those listed below, but this will quickly test to make sure nail is working correctly:

cat /etc/fstab | nail -s "Testing" -r <e-mail sending address> <e-mail to address>

Alternative Usage

You can set the smtp server and related options directly on the command line. (For more details 'man nail')

cat /etc/fstab | nail \
    -S from='sender@domain.com' \
    -S smtp='mail.domain.com' \
    -s 'subject test' \
    'recipient@domain.com'

See Also

CleanCode.org email command-line utility with similar sending abilities.

This article is still a Stub. You can help Gentoo-Wiki by expanding it.

Retrieved from "http://www.gentoo-wiki.info/Nail"

Last modified: Thu, 07 Aug 2008 08:55:00 +0000 Hits: 7,683