Short Notes on Linux Administration

From PaskvilWiki
Revision as of 21:40, 1 June 2012 by Admin (Talk | contribs)

Jump to: navigation, search

Reset Compiz to Default Settings

gconftool-2 --recursive-unset /apps/compiz

and restart.

Enable and Start sendmail

If you're getting "stat=Deferred: Connection refused by [127.0.0.1]" log messages from sendmail, try adding the following line to your /etc/mail/sendmail.mc file:

DAEMON_OPTIONS(`Port=smtp, Addr=127.0.0.1, Name=MTA')

under the "General defines" section.

Also, make sure the sendmail daemon is running:

ps aux | grep sendmail

If not, run it using

sendmail -bd -q1m

where -q parameter chooses how often the email queue's new messages should be processed (here, every minute).

To test if this all works, use

echo -e "Subject: Hello\nTesting the mailer..." | sendmail -f test@test.com myrealaddress@mail.com

The advantage of sendmail over mail is that the from address need not be a valid email address... well... advantage?

Installing sendmail

On most systems, sendmail comes as a package, and typically gets started during the boot from the init.d/rc.d scripts.

If you want/need to start sendmail manually, or it has died, use

sendmail -bd

or, for debugging purposes

sendmail -bD

that will start sendmail daemon, but will keep it in foreground, so you can see its output.

Sending Emails using sendmail

The easiest way is to create the message file with all necessary definitions, e.g.

To: Mr. Recepient <recepient@hosting.com>
Subject: This is a fine example of a subject
Date: 2011-08-15 20:00:00 +0000
From: Mr. Sender <sender@hosting.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
User-Agent: My email service

The body of the message comes here, after a single blank line...

and then feed this file to sendmail:

sendmail -t < message_file.txt