LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 05-11-2009, 04:50 AM   #1
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Rep: Reputation: 56
Question Duplicating Exchange 2007 to another server?


Hi all,

After a bit of a cock-up at work a couple of months ago, we've now decided to slow the pace of migration a touch. Currently almost all users here at work are retrieving their emails via POP3 (pulling them down from a server running Plesk in London). There is no duplication of messages and almost none of them do any form of backing up of their laptops. So if it were to get run over/stolen/flushed down the bog/whatever, they have lost pretty much everything.

After much hassle, Work finally decided on a Microsoft SBS2008 setup (despite my efforts... apparently I might get run over... I hope I'm not working for the Mafia!). Now, SBS2008 comes with Microsoft Exchange 2007 pre-installed.

As I said, after a cock-up (an upgrade broke the thing and took me about a week to figure out what the hell had caused the problem!) we've decided to slow the migration to our shiny new server.

(Don't worry, I'm getting to the Linux bit)

One of the things we want to get in place before the whole-sale migration of users is some level of "backup plan" (and I'm not talking about tape-drives here).

So, at my insistence we now have SBS2008 in a VMWare ESXi virtual machine, and Debian Stable with Dovecot in another. I am trying to automatically duplicate all user's emails (and files) to the Debian machine.

I have tried a number of different IMAPSync-style tools, but they all suffer from exactly the same problem... it's Exchange they're connecting to, and Exchange doesn't do IMAP properly.

Essentially what happens is that all messages get duplicated from the Exchange server into Dovecot, and duplicated, and duplicated. It would seem that Exchange doesn't talk Message-ID properly as the IMAPSync tools are seeing all messages as "new". So we get this:

Before
------
Exchange: 5
Dovecot: 0

Sync 1
------
Exchange: 5
Dovecot: 5

Sync 2
------
Exchange: 5
Dovecot: 10

etc

Now, I would be quite happy dumping everything on the Debian server and dropping SBS altogether, but they've already paid for it now so they'd never agree to it. (I did have a week of going "I told you so" when SBS broke).

So, has anyone got any great ideas on how to duplicate messages - possibly using IMAP, but others are good too - from Exchange 2007 to Dovecot (or another Linux IMAP server if it serves our purposes better)? I am not looking to perform a one-time migration... that would be relatively easy.

Cheers.
Grant.
 
Old 05-11-2009, 04:24 PM   #2
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 82
Can you go the other way around? Use the Debian server as the main server, and duplicate all messages into Exchange, then allow your users to IMAP or POP or whatever from the Exchange server? Still think you should tell them you told them so! Surely SBS2008 is useful for several things, not least domain management, but leave the mail serving to Debian?
 
Old 05-11-2009, 04:45 PM   #3
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Original Poster
Rep: Reputation: 56
I was thinking about that, actually, but I'm not certain it'd be much easier. I can set the Debian machine to automagically download all the emails for a user (via POP3) and store them, and I can get the SBS2008 machine to retrieve them from the Debian machine (instead of from London) via POP3... but there is no option under the SBS2008 POP3 Connector for "leave messages on server"... it removes everything from the POP server after retrieving it. So I would have to then find a way of ensuring the Debian machine could serve POP3 to Exchange but not allow it to delete them... but then would Exchange download multiple copies of the same email under the guise of "I should have deleted everything on the POP server, so *anything* on there must therefore be new" and not bother checking the Message-ID strings?

*sigh*

Or were you thinking download POP3 -> Debian and then do IMAP-to-IMAP sync between Debian & Exchange?

I really wish they had listened to me in the first place.
 
Old 05-11-2009, 11:32 PM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,289

Rep: Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034
I think he means
POP3 -> Debian (push) -> Exchange
OR
POP3 ->Debian (which makes an extra hidden copy of each email) -> Exchange pulls & deletes visible copies
that way you automatically have backups of all emails which users can't see/delete.
 
Old 05-12-2009, 05:46 AM   #5
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 82
See what chrism01 said, but IMAP sync might work too, just be careful that a user deleting their emails from exchange doesn't delete them from Debian using IMAP!
 
Old 05-15-2009, 08:32 AM   #6
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Original Poster
Rep: Reputation: 56
Thankfully this is not a "live" server yet. I can afford to experiment until I get things right!

OK, so I have mail being pulled from our London server (POP3, using getmail) and stored locally (on the Debian machine) as a Maildir in the user's /home. Dovecot is configured for POP and IMAP access. I have tried doing an imapsync Dovecot -> Exchange, but (as I feared would be the case) because Exchange doesn't seem to speak Message-ID very well (if at all), it is still duplicating emails that have already been copied.

The imapsync command I'm using is:
Code:
srcSERVER="127.0.0.1"
dstSERVER="192.168.1.252"
usrnm=--username--
passwd=--password--

imapsync \
--dry \
--syncinternaldates \
--noauthmd5 \
--ssl1 \
--ssl2 \
--expunge2 \
--folderrec "Inbox" \
--useheader "Message-ID" \
--host1 $srcSERVER \
--user1 $usrnm \
--password1 $passwd \
--host2 $dstSERVER \
--user2 $usrnm \
--password2 $passwd
I'm thinking maybe get Exchange to pull emails from Dovecot with POP3. I'm just not sure how to make it so that the emails are either "backed-up" before Exchange connects, or that Exchange can't delete them but recognizes that it has seen them before. My dovecot.conf is:
Code:
protocols = imap imaps pop3 pop3s
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_location = maildir:~/Maildir
mail_privileged_group = mail
protocol imap {
}
protocol pop3 {
  pop3_uidl_format = %08Xu%08Xv
}
protocol managesieve {
  sieve=~/.dovecot.sieve
  sieve_storage=~/sieve
}
auth default {
  mechanisms = plain
  passdb pam {
  }
  userdb passwd {
  }
  user = root
}
dict {
}
plugin {
}
 
Old 05-16-2009, 10:48 AM   #7
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Original Poster
Rep: Reputation: 56
Just noticed the suggestion of pushing mail to the Exchange machine. I have Exim4 running (of course... it is a Debian machine! ) but I have not configured it for anything yet.
 
Old 05-17-2009, 12:14 PM   #8
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 82
I think push is the way to go Thymox. Still not convinced about exchange at all though, I still maintain the easiest solution is to not use exchange for mail, and allow SBS to do all the domain management, except mail-handling. dunno if that suits you though.
 
Old 05-17-2009, 04:29 PM   #9
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Original Poster
Rep: Reputation: 56
It would suit me fine to have the SBS virtual machine not running at all!

Before they stumped up any money for the hardware (let alone the Windows licenses), I put together a fairly comprehensive document about the benefits of using an all-Linux server setup (leaving the desktops alone for the time being). I even demonstrated a lovely XP & Vista network connecting smoothly and working flawlessly (on virtual machines on my Ubuntu laptop). I gave them a detailed pricing structure for both Windows and Linux server environments. Their response was that they'd prefer to have a simpler network that, should the need arise, someone else could easily administer - they wanted SBS2008.

Then, after the first problem (a 'crucial' Windows update broke things nicely - apparently you're not supposed to disable IPv6 support and if it is disabled this particular update (I forget what it was for) partially fails and screws up Exchange... re-enabling IPv6 and re-applying the update fixed it... eventually) they wanted something with more fail-safes... but they still wanted SBS2008. Oh, and they also wanted some form of http proxy to cut down on unnecessary WAN usage.

So, they've gone from a "simpler network" that can be easily managed by someone else to a VMWare ESXi machine with a virtual SBS2008 and a virtual Debian, with the Debian system running as a transparent proxy (so, in essence, a router) and mail gateway and a bunch of other things.
 
Old 05-17-2009, 07:57 PM   #10
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 82
I'm with you, I'm running a Win2003 server to provide access to a proprietary web app, really annoying! Part of the game, but running windows to give easy handover is like running Sun and handing over to a debian admin! everyone does things differently.
 
  


Reply

Tags
duplication, email, exchange, imap


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
duplicating a live server with rsync? dragos19 Linux - General 1 05-20-2008 01:59 PM
Does Evolution work with Exchange Server 2007? jmgleason Suse/Novell 1 01-02-2008 03:17 AM
Exchange 2007 Durham Linux - Software 3 12-07-2007 05:21 AM
duplicating and backing up a server rblampain Linux - Server 4 09-30-2007 12:43 AM
duplicating Unix server on LAN (Perl / html) PerlUser Linux - Networking 1 08-06-2003 02:00 AM


All times are GMT -5. The time now is 10:51 PM.

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