Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I had a mail server on postfix with mailboxes@/var/spool/mail.
Recently a new server was brought in to replace this server and unfortunately the replacer forgot to transfer the users,mail directories and files from the old server to the new server.They opted to create afresh all these in the new server but used the same setup - postfix with mailboxes@/var/spool/mail.
Mails have already accumulated in the new server while the old one was offline;I need to know how I would integrate the old mail boxes to the new mail boxes and have all in order and operating perfectly.
(I want the old and new mails to reflect in the new server & in the same mail box)
Combine:
oldserver#/var/spool/mail/userA to Newserver#/var/spool/mail/userA
and also user directories:
OldServer#/'userAdirectory'/mail to Newserver#/'userAdirectory'/mail
The main factor to consider here is that there are loads of new mails in the new server since replacement and I would not want to overwrite the new with the old files.
i,How would I do this?
ii,Is there a way one can 'export' mails from a system-user based mail system to database based mail system.I would like to have the mails on mysql and managed through postfixadmin preferably.My problem is how to get the system mailbox stored mails to the db.Would really value your inputs.
If the mailbox spools are mbox formats, they can be concatenated together. You must stop postfix and ensure no users are retrieving mail at the time you are perform the concatenation (i.e. no MUAs have the mbox's open).
Here is the basic procedure (I'll leave to you the transferring of old mbox spools from old machine to new):
( cat oldmbox ; echo ; cat newmbox ) > joinedmbox
This will concatenate the old and new mboxes with a blank line inbetween (which is used to separate mail messages in mbox format). You can then test the procedure with
mail -f joinedmbox
Once you have confirmed the mbox is correct, you can move the existing mail spool in /var/spool/mail/user to /var/spool/mail/user.prev and then move the joinedmbox to /var/spool/mail/user. Be sure the permissions are correct.
The same concept applies with user's mbox's in various ~/mail folders. Once you get the hang of it, you can script the operation, depending upon how many you have.
Make backups first before you destroy any data! This is why I concatenated data into a new mbox in the example above.
Mr. C.,this might work the magic for me.
Will definitely try it and giv u feedback.
About exporting mails to db,I was wondering if there was a way to create a database structure from system based mailboxes and be able to to retain all mails in to the new db setup.
I might be asking too much but if there's a person who has ever worked out something keep me posted.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.