Moving or Restoring Postfix Queue Created On Jul 1, 2008
Brief:

If you are using default install layout for your Postfix email server, and you are dealing with huge emails on day to day basis, you might facing the space problem.

Description:

Login as superuser by

su -

STOP postfix server

/etc/init.d/postfix stop

Navigate to directory where you want to move server 

cd /path/to/directory/

Copy a directory named maildrop from original queue

cp -R /var/spool/postfix/maildrop/ .

cd maildrop

Make sure that the owners of new maildrop directory are postfix & postdrop & having proper access
to have proper settings use:-

chown postfix:postdrop maildrop

chmod 730 maildrop

now execute following commands to restore existing queues in maildrop folder

cp -R /var/spool/postfix/incoming/ .

cp -R /var/spool/postfix/active/ .

cp -R /var/spool/postfix/deferred/ .

find incoming active deferred -type f -exec mv '{}' . ';'

rm -rf incoming active deferred

now we can start the postfix server as

/etc/init.d/postfix restart

to check the status of server

/etc/init.d/postfix status

Further Reading


http://www.postfix.org/faq.html#copying


Back to Articles