Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 05-23-2008, 01:52 AM   #1
LQ Newbie
Registered: Nov 2006
Posts: 14

Rep: Reputation: 0
Changing mailserver sendmail to postfix

Dear all,

WE have a Suse 9 enterprise server with sendmail installed in it for 50 users. Now I want to install a new mailserver using postfix in ubuntu 8.04

My question is how can i import all my users, emails and domains from existing sendmail server to the new server ???
Old 05-23-2008, 07:56 AM   #2
Registered: Nov 2006
Posts: 97

Rep: Reputation: 16
1) to get all users you can copy /etc/passwd, /etc/shadow, /etc/group from the old server to the new server and then run pwdconv and grpconv commands. (backup the files in the new box first).

******If you want to add users with a default password to the new server then instead of doing the first step run the command given in second step, copy the resulting file to the new box and run the following script;

for i in `cat /opt/abc.txt`
pass=$(perl -e 'print crypt($ARGV[0], "password")' $i$k)
useradd $i -p $pass
echo $i
echo $pass

this will add users with the default password of password123 (change this to a complex one)

2) then you can run;
cut -d":" -f6 /etc/passwd > /tmp/users.txt
to get the list of users to a text file. open it and remove all other than real users.

3) use the following script to create home folders;
for i in `cat /tmp/users.txt`
mkdir /home/$i
chown $i:$1 /home/$i

this will create home folders and add permission as well.

4) regarding moving mails if possible ask all users to download the mails to their pcs before changing the servers. that'll make things easy.

5) regarding moving domains add those domains to the postfix configuration file and you should be ok with that.

******* if you must move all mails in user folders i think you have to tar (& gzip) and move all home folders to new box. and you might also want to move he mail queue as well. but i haven't done like that.

hope this helps.
Old 05-23-2008, 11:12 PM   #3
LQ Newbie
Registered: Nov 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks mate...

It really helps me ...


mailserver, postfix, sendmail

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix mailserver doesn't want to start! gubak Linux - Software 3 09-25-2006 02:02 AM
anybody knows which is better mailserver ? Sendmail OR Postfix ? gajaykrishnan Programming 1 08-03-2005 03:38 AM
Apache: How do I use Postfix if I'm not a mailserver? tethysgods Linux - Software 1 09-07-2004 07:50 PM
Problem with postfix mailserver..!?! knuzzen Linux - Networking 0 09-01-2004 05:41 AM
need help with Postfix mailserver Lleb_KCir Linux - Software 1 03-31-2004 11:11 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:05 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration