Tag Archives: sendmail

Reading Linux Email book

Linux E-mail

I’m reading a new book about Linux mail servers,
Its basically a Hands on training book for easily installing a full linux email server for the office,
The book is filled with helping screenshots and a step-by-step procedures to install the server and make things work,
some of the apps the book covers are: Postfix, Courier, Procmail etc…
Ill add a full review when I’m done reading – it looks nice so far.

Technorati Tags: , ,

How to start learning Linux

If you want to start learning Linux the best advice I can give you is:

Start out as a user first

The simplest way is to download some live CD from the Internet,
for a sample this one:
Centos live CD
Fedora liveCD
Either of which will boot into a full working Linux distro,
without installing anything on your windows box.
when your done playing with the Linux server, just remove the CD from your computer, and reboot – your windows will come right back.
both the distros I’ve linked to here are very similar – they use the same redhat code, but the fedora is more cutting edge development version of everything and the centos is a stable server environment.
The fedora LiveCD will also allow you to install it to the machine your using from the LiveCD itself – after the boot you will see an install Icon on the Linux desktop.
Start playing with the servers, while reading some linux tutorials,
start as a Linux user and then work your way up to power user and to admin in the end.

Hands On Training Tasks for Linux Sysadmin

After your feel you know your way around as a user:

  • reading and writing files
  • working your way around the file system
  • installing some rpm packages

You can start working your way through some serious hands on training – try to do either of these:

  • Setup A stand alone DNS server
  • Setup Apache server with php and SSL
  • Install MySQL server from sources
  • Setup sendmail
  • Install WordPress or Joomla on your Apache/MySQL and happily see it all working together

Each of these tasks will take a long time to figure out for the first time, and on the way learning to do the task, you will learn a lot more things that you wouldn’t have just by playing with the server.

Technorati Tags: , , , , , , ,

check smtp from commnad line

telnet smtp command line image

When working with Linux servers, you need to get mails from them,
they like to alert you on different issues like “help – im dying from lack of space” etc.

mail forwarding

you can easily setup mail forwarding in your sendmail through an external mail server.
all the sendmail config files are in /etc/mail.
edit the mailertable file and add a line like this:

domain    smtp:company_mail_server

for example – lets say you work for data.com and you want to send mails to the data.com domain from your Linux machine through the data.com mail server which is called mail.data.com, so your line in mailertable should be:

data.com    smtp:mail.data.com

test mail

to check that your company mail server will actually allow you to forward mails through it, you need to connect to the smtp service and try to send a mail, this will work from the command line:

telnet mail.data.com 25

this will try to connect to the mail server smtp port and if there is no firewall problem then you should see something like 220 localhost.localdomain ESMTP Sendmail 8.13.8/8.13.8 as a reply.

at this point you try to send a mail through the server.

send mail from command line

telnet to the machine and copy paste this text after editing it:

helo domain_name
mail from: test@email
rcpt to: test@email
From: test@email
Subject: subject
whatever you want the mail to have in the body.

(the “.” in the end will finish the mail – dont forget it).

so lets explain:
helo domain_name – change the domain_name to your domain – data.com for example
mail from: the email you want the mail to look like it was sent from – test@data.com
rcpt to: who you want to get this test mail – admin@data.com
so the new updated test text would look like:

helo data.com
mail from: test@data.com
rcpt to: admin@data.com
From: test@data.com
Subject: test mail from command line
this is test number 1
sent from linux box

if there arent any permissions issues the mail server should show you something like: 250 2.0.0 n4CNnNPG003499 Message accepted for delivery

mail queue

there is another nice command line tool to show you whats your Linux server current mail queue: mailq:

[root@centos mail]# mailq
/var/spool/mqueue (1 request)
—–Q-ID—– –Size– —–Q-Time—– ————Sender/Recipient———–
n4CNnNPG003499        0 Wed May 13 02:49 test@email
(host map: lookup (email): deferred)
Total requests: 1

Technorati Tags: , ,