This blog is a place used for notes and writing about various technical problems and projects worked on. Quite often the posts will be incomplete and some are likely to remain incomplete forever.

Hopefully some of it may be of passing interest, or maybe provide some assistance.

Please leave a comment. Or if you feel generous, click on an ad or two

Jun 30

I still use Microsoft Photo editor for some simple tasks. It’s fast and fine for cropping screen captures.

The problem is that it normally only shows when the window is maximised. If you try to restore it to a normal window, it remains running, but disappears off the screen.

There are 3 methods I have found to solve this:

 

    • Right-click on it’s taskbar icon and choose Move. The cursor should change shape to indicate you are in move mode.
    • Press any one of the keyboard’s arrow keys and move your mouse to position the window on your desktop.

  1. Alt-tab to the window. Press Alt+Space, Press M, Press an Arrow key, and then move your mouse.
  2. Right-click on empty space on the taskbar and click “Cascade Windows”.
Jun 15

 

Out of the box, CentOS5 installs Sendmail using Procmail as local delivery agent, and Dovecot. The inbox is in /var/spool/mail/~ and any user folders are stored in mbox format in ~/mail/

If we access an email account with IMAP, there are some issues with folders and sub-folders. The solution to these problems, is to swap over to Maildir.

To do so, we need to make some changes to Dovecot & Procmail

Edit “/etc/procmailrc” and change:

ORGMAIL=$HOME/Maildir/
DEFAULT=$HOME/Maildir/

Edit “/etc/dovecot” and change:

mail_location = maildir:~/Maildir
pop3_uidl_format = %08Xu%08Xv

 

If you prefer to use Webmin:

Servers -> Procmail Mail Filter -> Manually Edit Configuration.

Servers -> Dovecot IMAP/POP3 Server -> Mail Files

and set

Mail file location = "Inbox and folders in ~/Maildir"
UIDL format = "Other.. %08Xu%08Xv"

 

Transferring old Emails

The dovecot instructions are here.

I just downloaded the mb2md.pl script and did the rest by hand.

I logged in as root and ran the following commands for each user

First let’s import the old inbox into the Maildir format. This will also create the ~username/Maildir folder if it does not exist.

./mb2md.pl -s /var/spool/mail/linuxusername -d ~linuxusername/Maildir

Second lets import any existing other folders

./mb2md.pl -s ~linuxusername/mail -R -d ~linuxusername/Maildir

Finally we fix the file ownerships:

chown -R linuxusername:groupname /home/season/homes/linuxusername/Maildir/.*
chown -R linuxusername:groupname /home/season/homes/linuxusername/Maildir/*
Jun 15

Outlook 2003 & 2007 when used with IMAP behave a little different when deleting emails than we are used to. Instead of moving the mails to a Trash folder, the mails are simply marked for deletion by using a strikethrough font. Most of us will prefer to not display these marked for deletion emails, as they clutter things up… Here’s how:

Outlook 2007: View -> Current View -> Hide Messages Marked for Deletion

Outlook 2003: View -> Arrange By -> Current View -> Hide Messages Marked for Deletion

This is done on a per folder basis.

Now these hidden emails marked for deletion, will hide there until purged.

Outlook 2003: Edit -> Purge Deleted Messages

This will purge the messages in the currently selected folder only.

In Outlook 2007, I believe there is a further Edit -> Purge command which will allow you purge all folders at once, and set up automatic purging if required.

Warning: Once an email is purged, it’s gone. There is no recovery possible.

 

Thankfully Outlook 2010 seems to have got it’s act together and just puts the damn things into a Trash folder like everybody expects.

 

 

 

 

Jun 11

For some strange reason, plesk does not seem to have a way for the administrator to reset an email users password. You need to ssh into the server and use a command line tool:

/usr/local/psa/bin/mail -u emailuser@yourdomain.com -passwd 'newpassword'

run

/usr/local/psa/bin/mail --help

to see some other things this command can do.

 

Jun 1

A client’s PC got infected with one of the fake antivirus trojans. I could not run MalWareBytes even in safe mode, so I took out the hard disk and scanned it on another computer. It found the following:

Files Infected:

h:\documents and settings\preferred customer\application data\Sun\Java\deployment\cache\6.0\49\51dc9431-3dfae1a3 (Trojan.FakeAlert) -> Quarantined and deleted successfully.

h:\documents and settings\preferred customer\local settings\application data\ibo.exe (Trojan.FakeAlert) -> Quarantined and deleted successfully.

However, when I put the disk back in the original computer, I still could not run MalWareBytes. The registry was still trying to insert the trojan’s code on running an exe file. No surprise here. This is a common trick.

Rather than go hunting the appropriate registry key down, I remembered a blog I had stumbled across a few days earlier, discussing .exe and .com files and their interchangeability:

What’s the difference between the COM and EXE extensions?

So I went to the folder where MalWareBytes files live, copied mbam.exe to mbam.com. Double click on the com file and it runs without interference by corrupt the registry key. MalWareBytes can then do it’s thing and clean up the registry for you.

I suspect that if I booted in safe mode, and tried to run mbam.com instead of mbam.exe, I might have been able to run the scan without having to remove the hard disk.