Posts

postgrey whitelisting outlook.com

Greylisting is a way of reducing the amount of incoming spam and virus emails, in addition to other counter measures. Postgrey is a good choice if you are running postfix.

However, to be able to recieve emails from senders using outlook.com you need to whitelist it. This is because outlook.com is using a different host on each try to deliver the mail, causing delays up to hours, days or the mail not being delivered at all within time limits.

Create/edit the file /etc/postgrey/whitelist_clients.local and add:

# outlook.com
/^.*\.outbound\.protection\.outlook\.com$/
/^.*\.prod\.outlook\.com$/

Then execute:

service postgrey reload

Edit December 2021: The rule is changed from /^mail-.*\.outbound\.protection\.outlook\.com$/ to /^.*\.outbound\.protection\.outlook\.com$/ as Microsoft has changed their server naming standard.

Convert Microsoft Outlook PST email to IMAP without Outlook

A client was going to stop using Microsoft Outlook and Exchange server and move their email to an ordinary web hosting company using IMAP. The client was downscaling and had no use of the benefits of Microsoft Exchange like shared contacts and calendars. They where just using it for email which could be obtained much cheaper by using the IMAP account at their web hosting provider.

So I was faced with the task of converting their old email contained in PST files. They had already shut down their Exchange server and I could not use the Outlook program. I just had the PST files that where exported before the server shutdown and needed them imported into the IMAP account without using Outlook as it was not availible for me.

This is how I solved it.

Tools used:

  1. Download and install Thunderbird. Set it up with the target email account both as an IMAP account and a POP3 account (it was a problem importing the converted eml files directly to the IMAP account so I had to import them to the POP3 account which is stored locally and then drag them over to the IMAP account, more about that later on). Make sure you setup the POP3 account to leave mail on server and not delete mail when deleted locally.
  2. Download the ImportExportTools extension for Thunderbird. Drag the downloaded file onto Thunderbird in the task bar to install it.
  3. Download the free trial of the SysTools PST converter and install it. The free version is limited to 25 emails per folder so if you have more emails you need to purchase it ($49 when writing this article). You can make a test run with the free version so you see everything works before you go on and buy it.
  4. Run the SysTools PST converter.
  5. Click the Add file button and select your PST file.
  6. Click the Export button and select EML format, and check the folders you wish to export (normally the top folder). Enter a target folder. Then click the Export button.
  7. In Thunderbird, right click the POP3 email account and select New folder and call it “From PST” for example.
  8. Select the “From PST” folder and go to the menu icon in Thunderbird and select Tools -> ImportExport-tools -> Import all EML from a folder -> and it’s subfolders. Select the top folder of your email export in step 6 and click Select folder.
  9. All subfolder and it’s email should now turn up in the “From PST” folder. Now drag the “From PST” folder from the POP3 account to the IMAP account in Thunderbird.
  10. Finally delete the POP3 account in Thunderbird.

Android mail token files fills up my SD card

I use a HTC Desire HD android mobile. My 8 GB SD card was getting full so I removed photos and videos that had already been copied to my PC. But I became a bit curious because of the 8 GB, the images and videos where not consuming the entire space.

To investigate further I connected the android phone using USB to my PC and used the PC:s explorer to dig into the SD-card.

I found out that the mail program stores images and other parts of emails in the Downloads folder on the SD card. After 1,5 years of use there where a significant amount of files there.  

After deleting them i noticed there was a folder called .Mail (i.e. Downloads/.Mail) which contained >21.000 files consuming some 700 MB of space. The filenames began with "token". After some Googleing it seemed by the discussions I found that these are temporary files created each time a message is pushed to the phone. I decided to take a shot and delete them.

After deleting all files in the .Mail folder I opened the mail app on the phone. For a short moment a text was displayed "Preparing SD card". Then my inbox showed up and everything worked normal with the only difference that the mail app seemed a bit quicker now.

My conclusion is that it is probably safe to delete the content of the .Mail folder once in a while to free up some space.