Way to import rules from MS outlook to thunderbird

9,034

Solution 1

Thunderbird calls message rules message filters. They are not compatible, and Thunderbird doesn't know how to convert them from a Microsoft email client. There don't appear to be any utilities that know how to convert them either, possibly because there is no industry standard format for message rules/filters.

Source: http://kb.mozillazine.org/Emulate_Microsoft_email_clients#Rules

Solution 2

'A macro like this in Outlook 2007 will create some rules compatible with the Thunderbird Message Filter Import/Export add-on. Replace usernames and domains with your email addresses and server domains.

Option Explicit
Sub CreateRule()
Dim colRules As Outlook.Rules
Dim oRule As Outlook.Rule
Dim j As Integer
Dim email(5) As String
Dim server(5) As String

'Get Rules from Session.DefaultStore object
Set colRules = Application.Session.DefaultStore.GetRules()
email(1) = "username1%40domain1.com"
email(2) = "username2%40gmail.com"
email(3) = "username3%40gmail.com"
email(4) = "username4%40domain2.com-"
email(5) = "username4%40gmail.com"
server(1) = "mail.domain1.com"
server(2) = "imap.googlemail.com"
server(3) = "imap.googlemail.com"
server(4) = "imap.domain2.com"
server(5) = "imap.googlemail.com"
For j = 1 To 5
    Open "c:\temp\" + email(j) + ".txt" For Output As #1
    Print #1, "RootFolderUri=mailbox://" + email(j) + "@" + server(j)
    Print #1, "mailnews.customHeaders="
    Print #1, "version=""9"""
    Print #1, "logging=""no"""
    Dim i As Integer
    For i = 1 To colRules.Count
        Set oRule = colRules.item(i)
        ' break here, right click, add watch to see the structure of oRule
        If Len(oRule.Name) > 0 And oRule.Enabled And oRule.conditions.from.Enabled And oRule.conditions.from.recipients.Count > 0 And oRule.actions.MoveToFolder.Enabled Then
            Print #1, "name=""From is: " + oRule.Name + """"
            Print #1, "enabled=""yes"""
            Print #1, "type=""16""" ' type 16 for manually run only, type 17 for manually run and run on checking mail
            Print #1, "action=""Move to folder"""
            Print #1, "actionValue=""mailbox://nobody@Local%20Folders/Outlook%20Import/Personal%20Folders/Inbox/" + oRule.actions.MoveToFolder.folder + """"
            Print #1, "condition=""AND (from,is," + oRule.conditions.from.recipients.item(1).Address + ")"""
        End If
    Next i
    Close 1
Next j
End Sub
Share:
9,034

Related videos on Youtube

SyncMaster
Author by

SyncMaster

Updated on September 18, 2022

Comments

  • SyncMaster
    SyncMaster over 1 year

    I recently installed Firefox thunderbird and I want to import all the rules that I created in Outlook into thunderbird. Is there any way to import these rules?

    I tried Import option in Tools menu. When I select, Filters I get only Eudora to import from. It is not listing Outlook. Also when I try Import Everything, nothing gets listed.

    So is there anyway to import all the rules for Outlook to thunderbird.?