I came across an error after upgrading a Plesk server from 8.6 to 9.2.3:
# /usr/local/psa/admin/sbin/mchk --with-spam
==> Checking for: mailsrv_conf_init... ok
==> Checking for: mail_mailbox_restore... ok
==> Checking for: mailsrv_entities_dump... ok
==> Checking for: mail_admin_aliases... ok
==> Checking for: mail_auth_dump... ok
==> Checking for: mailman_lists_dump... ok
==> Checking for: mail_responder_restore... ok
==> Checking for: mail_drweb_restore... ok
==> Checking for: mail_kav_restore... not exsists
==> Checking for: mail_spf_restore... ok
==> Checking for: mail_dk_restore... ok
==> Checking for: mail_grey_restore... ok
awk: cmd. line:50: (END OF FILE)
awk: cmd. line:50: invalid char '�' in expression
unable to process "pop3d"
awk: cmd. line:50: (END OF FILE)
awk: cmd. line:50: invalid char '�' in expression
unable to process "pop3d-ssl"
awk: cmd. line:50: (END OF FILE)
awk: cmd. line:50: invalid char '�' in expression
unable to process "imapd"
awk: cmd. line:50: (END OF FILE)
awk: cmd. line:50: invalid char '�' in expression
unable to process "imapd-ssl"
Continue reading »
Today I got tasked with removing duplicate mails from a mail folder with over 100,000 mails in it. Doing this from a mail client is so impractical, it’s not even worth giving any thought at all. Fortunately, the mailbox is on a mail server using Maildir style mailboxes, so I knew this could be done with minimum effort.
I discovered the ‘reformail’ utility, part of courier-imap, and after a few trial runs, I settled on the following:
# cd /path/to/mailbox/Maildir/cur
# for i in `find . -type f`; do reformail -D 10000000 /tmp/duplicates <$i && rm $i; done
-D looks for, and deletes duplicates.
10000000 is the length of the temporary file where a list of message IDs will be written
/tmp/duplicates is the aforementioned temporary file.
The temporary file needs to be big enough to accommodate the message ID of each mail. In this particular case, I have found the average length to be 54 characters, but I would suggest using around double that to be safe. So adjust to your needs.
In a big mail folder, and especially on ext3, this will take a long time to complete.
I get this kind of problem every day: “We’ve run out of disc space on our Plesk server – what’s taking up all the space?” The answer, almost every time, is “logs.” Plesk doesn’t enable log rotation by default, so logs can end up taking a lot of space.
Continue reading »