Wednesday, December 5, 2007

Configure sendmail to forward mails to the default mail server of the network domain

The following configuration settings are for making a sendmail server to forward the mails to the default mail server which actually does the job of sending the mails to the intented recipients.

1. Login as root and make a copy of sendmail.cf and sendmail.mc before proceeding.
cp /etc/mail/sendmail.cf /etc/mail/sendmail.old
cp /etc/mail/sendmail.mc /etc/mail/sendmail.mc.old

2. In sendmail.mc search for "define('SMART_HOST' " and change the line to
define('SMART_HOST', 'ip_address_of_network_server')

3. Next search for "dnl DAEMON_OPTIONS(" and change the line to
dnl DAEMON_OPTIONS('Port=smtp, Addr=127.0.0.1, Name='MTA')dnl

4. Next search for "MASQUERADE_AS" and change the line to
MASQUERADE_AS('mydomain.com')dnl

5. Run following commands:
make -C /etc/mail
yum -y install sendmail-cf
service sendmail restart

6. Test sendmail configuration by typing following command:
mail myemail@email.com The system will prompt for "Subject"
Subject: Hello
Next type the message
Hello World.
Then end the message with a "."(dot).
You should see the prompt now.
Wait for the mail to come in your inbox.
If you receive the mail that means the configuration has been done successfully.

Tuesday, September 4, 2007

Check to do during import of more than one mysql database from a sql script

I did a classic mistake of not checking what the tables were in the database script.
There were mysql system tables like "user".
I realised my mistake after the server was rebooted!

Thursday, July 26, 2007

wget instead of ftp for downloading directories and files

The other day I wanted to download source code from an ftp site.
So I logged on to the site:
ftp ftp://ftpsite
user: username
password: mypass

Then to get the list of files I did
> ls

There were a lot of files and directories too. So how do I download the directory structure?
I did not know how to do it ftp as well as in wget. I found a way out with wget as follows:
wget -r --ftp-user username --ftp-password mypass ftp://ftpsite

I love "wget"!

Introduction

Hi!
This blog is mainly for me!
It may be useful to the fellow programmers and linux lovers..