Testing your SMTP server setup with Telnet

by on 31.Jan, 2008 under Uncategorized

When you set up a new mail server you usually want to run some tests on it to see it delivers the mail like it’s supposed to. There are tools out there to do this for you but the easiest way is to use Telnet. Telnet is found on almost any new operating system, and if it’s not there you can user your package manager to get a client.

Talking to the server

Talking to SMTP servers is really quite easy and they usually reply in a decent matter. The dialog is simple and you need only a few commands to see if everything is alright, let’s get started shall we

[localuser@localhost ~]$ telnet mail.company.com 25

To use telnet just enter the command telnet the server you are connecting to in my test case mail.company.com and the SMTP standard port which is 25.
After that you should see something like this

Trying 192.168.90.25…
Connected to mail.company.com (192.168.90.25).
Escape character is ‘^]’.
220 mail.company.com ESMTP Sendmail 8.13.1/8.13.1; Thu, 31 Jan 2008 21:02:57 +0200

The responding smtp server should say something like the above.

HELO mail.company2.com

As we are a decent mail server we greet our fellow mailserver with HELO and our name.
To which the counterpart should answer

250 mail.company.com Hello mail.company2.com [192.168.81.18] (may be forged), pleased to meet you

As you can see SMTP servers are very civilized in their discussions. Next we need to tell the server who we are delivering mail for. So we say

mail from:postmaster@company2.com

And the answer should be

250 2.1.0 postmaster@company2.com… Sender ok

Now we have to tell the server who we are delivering mail to so we say:

rcpt to:postmaster@company.com

The server checks,or doesn’t check, the recipient depending on your setup and answers

250 2.1.5 postmaster@company.com… Recipient ok

Next we start to send some text. I won’t send any subject and you shouldn’t have to send any data either but it’s good to know how this works so we just type DATA and hit enter.

DATA
354 Enter mail, end with “.” on a line by itself

As the server says we can now input the mail and end the email with a single . on a new line. So just start typing something and when your done hit enter for a new line and the dot . and enter again to end the data send.

This is a test mail.
.
250 2.0.0 m0VJ2vCO016000 Message accepted for delivery

Last but not least end the session in a nice way by typing quit

quit
221 2.0.0 mail.company.com closing connection

That’s it. The mail should now be delivered to you mailbox if everything was configured correctly.

Leave a comment

Backing up and restoring your MySQL database

by on 17.Jan, 2008 under Uncategorized

There are more than a few graphical tools to do this but I find the simple command mysqldump to be more than enough for this task.

I use mysqldump for backup and I use it to transfer up to date databases between my production and development servers.

What you need is a shell account on your web server or, if your MySQL configuration supports it you can run it from a workstation. It’s generally a good idea to only let a user log in from localhost so that’s the way I use it.

Creating the backup .sql file
To create the backup just execute the following command in the shell

[mats@localhost examples]$ mysqldump -h hostname -u Username -p DataBase > database.sql

That’s it. This way the whole database dump gets redirected to a file called database.sql, you can of course use a more describing name for the file. Note, if you are working locally on the server you don’t have to supply the -h switch since the command uses localhost by default. Now you can copy the file to safety or to a development server to be restored into development productions.
If you want to add drop table, it is a good idea if you already have a database in use in the development server and don’t want to manually drop the tables, you can add the switch –add-drop-table to the command.
So let’s take a look at restoring the database.

Restoring database from .sql file
To restore a database to a server we use the mysql command.

[mats@localhost examples]$ mysql -h hostname -u Username -p database < database.sql

That’s it. You should now have a working copy on the development or production server.

Further reading
Manual page for mysqldump
Manual page for mysql

Leave a comment

Windows and Virtual desktops with Vista/XP Virtual Desktop Manager

by on 17.Jan, 2008 under Uncategorized

As I use booth Windows and Linux as a desktop and server system I often find myself wondering why a feature that is useful in Linux isn’t found in Windows or vice versa.

One of the greatest functions off a Linux desktop environment is Virtual Desktops. This allows me to keep my mail open on one desktop, music player on another, IDE on a third and so on. I guess you got the point.
This is also one of the features I’ve been waiting for the most while using Microsoft Windows. And now thanks to Microsoft’s CodePlex program and Z-Systems we are finally able to use a useful Virtual Desktop manager. I admit it’s not as fast and slick as they are in Linux but it works. Keep in mind this is still beta software.

I myself have only had the time to test this software for a few hours now but it has worked almost flawlessly and it does what it’s supposed to do. The only trouble it has given me yet is that sometimes when I jump from one desktop to another the windows on the new desktop wont render properly. A refresh or minimize/restore has done the trick so far.

Some of the features in Vista/XP Virtual Desktop Manager

Here is a screenshot of VDM in action

To find out more about this project visit their website at codeplex.com/vdm

Leave a comment

Installing Adobe Acrobat Reader centrally with Active Directory group policies

by Mats Hellman on 16.Jan, 2008 under Uncategorized

One of the greatest challenges in administering a large number of computers is software installations and updates. In this short hands on article I will take you through the installation of one of the more popular applications, Acrobat Reader. We will take a look at how to create the needed .msi package and how to deploy it enterprise wide using Microsoft Active Directory.
First of all let’s get the software and the tools needed to complete this. To set everything up correctly we need the Acrobat Reader and the Adobe Customization Wizard 8. Both can be found on . Follow the download links below.

NOTE: Upgrade guide available

Adobe Acrobat Reader
http://www.adobe.com/products/acrobat/readstep2.html
Adobe Customization Wizard 8
http://www.adobe.com/support/downloads/detail.jsp?ftpID=3564

Next install the Adobe Customization Wizard and fire it up.
Adobe Customization Wizard
Preparing the installation package

Now let’s extract the .msi file from the Adobe Acrobat reader installation file. If you downloaded the Acrobat Reader installation package to the desktop you can copy & paste the command otherwise change the path to match your system.
1. Select Run from Start menu and paste the following
“%UserProfile%\Desktop\AdbeRdr811_en_US” -nos_ne
2. Click Ok.

Installation Wizard

3. When the Setup screen clears select run from the start menu again and in the run field paste %temp%

4. Copy the Acrobat Reader 8 folder to your desktop
Adobe Customization Wizard

Next let’s change some of the .msi settings using the Adobe Customization Wizard.

Adobe Customization Wizard
Now you have a customized Acrobat reader package to deploy with Active Directory group policy.

Setting up the Group policy deployment

Group policy management console

I like to use the Group policy management console. You can just use the group policy editor but the management console gives you a good overview on how your policies are linked and a list of your policies. So if you don’t have it download GPMC SP1 from Microsoft

Install it to your server or your desktop. It really doesn’t matter.

Create the file share

To deploy the application it needs to be accessible to all the computers that are going to install it so firs we need to create a file share. Choose a fileserver in your organization and copy the Acrobat Reader 8 folder from your desktop to that share. In my example it will be \\odin\userapps
I like to use the share userapps since it describes what is in the share and it isolates the share from other shares.

Create the policy

No let’s create the policy to distribute the software. Open the group policy management console ( you can find it in administrative tools). Expand the domain and Group policy objects. Right click on group policy objects and select new. Name the new GPO Default software installations, because we can deploy all our standard software this way, not just Acrobat Reader. I also have a OU (organizational unit) in Active directory named Workstations where I keep all my normal workstations, this simplifies the linking of group policies.
Group policy management console

Now that you have your GPO created right click it and select Edit. To install Acrobat reader for every user using the workstation we assign the installation to the computer not the user policy. So expand Computer Configuration – Software settings – Software Installations.
Then from the Action menu select New – Package. The setup will ask for the location of the file so navigate to the fileserver and the share where you stored the AcroRead.msi package. Select it and click open.
Select package

In the deploy software box check Assigned, this will install the package to the computers, note that published is only available when using user policies. Click Ok.
The package should now be in the list.
Package deployment

Close the group policy object editor.

Link the policy

We are now almost done. The last thing to do is to link this group policy so that computers in the organization start using it.
To do this just drag the newly created Default software installations policy to the OU you want to link it and drop it there. In my case the Workstations OU.

Link the GPO
That’s it. You are done. When the computer updates to the new policy (cycles are 30-180 minutes) it will automatically install the package on the next reboot. If you want to try the package out immediately you can open a command prompt (CMD) and run the command

gpupdate /force

This will trigger the computer to refresh the policy immediately.
For questions on using group policies use the comments or visit our forums

Update guide

You can find a update guide on how to upgrade to Adobe Acrobat reader 9 at http://www.nixadmins.net/2008/08/20/upgrade-to-install-adobe-acrobat-reader-9-centrally-using-active-directory-group-policies/

12 comments