Posts Tagged ‘Exchange’

Helpful POP3 and IMAP Exchange 2013 links

Thursday, February 18th, 2016

Here is the list of some helpful links regarding IMAP and POP3 protocols in Exchange 2013:

Enable IMAP4 in Exchange 2013

Enable POP3 in Exchange 2013

POP3 and IMAP4

Public folders in Exchange 2013
Public folders and IMAP

Shared mailboxes in Exchange 2013
Accessing shared and delegated mailboxes

Helpful POP3 and IMAP Exchange 2010 links

Thursday, February 18th, 2016

Here is the list of some helpful links regarding IMAP and POP3 protocols in Exchange 2010:

Enable IMAP4 in Exchange 2010

Enable POP3 in Exchange 2010

Managing POP3 and IMAP4 in Exchange 2010

Understanding POP3 and IMAP4

Public folders and IMAP

Accessing shared and delegated mailboxes

Access shared/delegate mailbox of Exchange Server

Friday, April 4th, 2014

1. Enable IMAP and POP3 protocols

Make sure you have enabled IMAP and POP3. Following articles can help you with that:

2. Turn on basic authentication

Using Exchange Management Console

  • Open EMC, expand to Server Configuration->Client Access.
  • In the middle panel, click your exchange CAS server, click POP3 and IMAP4 tab, right click IMAP4 and choose properties.
  • In Authentication tab, select “Plain text logon (Basic authentication)”, then click OK.
  • Open services.msc, restart Microsoft Exchange Transport services.

Using Power Shell

Set-IMAPSettings -Server -LoginType PlainTextLogin
Set-POPSettings -Server -LoginType PlainTextLogin

Open services.msc, restart Microsoft Exchange Transport services.

3. Add permissions to the shared mailbox

Give one user full access permission to the shared mailbox:

Add-MailboxPermission Shared.Mailbox1 -user John.Doe -AccessRights FullAccess

This also can be configured from EMC (Exchange Management Console) gui, by selecting the mailbox and clicking on “Manage Full Access Permission…” at the right pane of the window.

Note: You can not add permissions for user without mailbox, Powershell is the only option in such case.

4. Access the shared mailbox

Exchange 2003

Use the following user format DomainName\Username\SharedMailboxAlias (note the use of SharedMailboxAlias it’s often same as the name but it may be different)
(e.g. DOMAIN\John.Doe\Shared.Mailbox1) to log into the shared mailbox.

Exchange 2007

Install this patch: http://support.microsoft.com/?kbid=949926

Use the following user format DomainName\Username\SharedMailboxAlias (note the use of SharedMailboxAlias it’s often same as the name but it may be different)
(e.g. DOMAIN\John.Doe\Shared.Mailbox1) to log into the shared mailbox.

Exchange 2010, Exchange 2013

Use the following user format DomainName\Username\SharedMailboxAlias (note the use of SharedMailboxAlias it’s often same as the name but it may be different)
(e.g. DOMAIN\John.Doe\Shared.Mailbox1) to log into the shared mailbox.

Office365

Use the following user format Username@DomainName\SharedMailboxAlias

In case of Office 365 SharedMailboxAlias is a local part (no domain and no ‘@’) of the full email address (“Email address” input on “new shared mailbox” screen).

You must use LOGIN method:

client.Login(@"Username@DomainName\SharedMailboxAlias", "UserPassword");

UseBestLogin for Office365 uses LoginPLAIN internally, and this syntax doesn’t work for shared mailboxes.

Using LoginPLAIN to login as a different user

You can try 3rd parameter of LoginPLAIN to log in as a different user:

using (Imap imap = new Imap)
{
    imap.ConnectSSL("outlook.office365.com");

    imap.LoginPLAIN("SharedMailboxAlias", "Username@DomainName", "UserPassword");

    //...

    imap.Close();
}

Convert Outlook .msg file to MIME format in .NET

Monday, October 14th, 2013

Files containing the .msg file extension are most commonly created by or saved from within one of the Microsoft Outlook email applications.

The MSG file contains information about a saved email file including the date of the message, the subject, who sent it, who received it and the contents of the email associated with the file. If attachments ares included with an email, that information will also be saved within the associated MSG file.

MsgConverter , than can be used to convert .msg files to MIME, is written in pure .NET, it does not require registration or any other components or libraries (including Outlook).

The following code snippet reads .msg file in .NET and saves it using MIME format to disk. MIME is shorthand for Multipurpose Internet Mail Extensions and is an Internet standard used to store and transport email messages.

// C#

using (MsgConverter converter = new MsgConverter(@"c:\outlook1.msg"))
{
    if (converter.Type == MsgType.Note)
    {
        IMail email = converter.CreateMessage();

        // Render message using MIME format to byte array
        byte[] mime = email.Render();

        // Save message to file using MIME message format
        email.Save(@"c:\mime.eml");
    }
}
' VB.NET

Using converter As New MsgConverter("c:\outlook1.msg")
If converter.Type = MsgType.Note Then
    Dim email As IMail = converter.CreateMessage()

	' Render message using MIME format to byte array
	Dim mime As Byte() = email.Render()

	' Save message to file using MIME message format
	email.Save("c:\mime.eml")
    End If
End Using

Reading Outlook .msg file format in .NET

Monday, October 14th, 2013

Files containing the .msg file extension are most commonly created by or saved from within one of the Microsoft Outlook email applications.

The MSG file contains information about a saved email file including the date of the message, the subject, who sent it, who received it and the contents of the email associated with the file. If attachments ares included with an email, that information will also be saved within the associated MSG file.

MsgConverter , than can be used to read .msg files, is written in pure .NET, it does not require registration or any other components or libraries (including Outlook).

The following code snippet reads .msg file in .NET and access its most common properties, such as subject, sender and attachments.

// C#

using (MsgConverter converter = new MsgConverter(@"c:\outlook1.msg"))
{
    if (converter.Type == MsgType.Note)
    {
        IMail email = converter.CreateMessage();

        Console.WriteLine("Subject: {0}", email.Subject);
        Console.WriteLine("Sender name: {0}", email.Sender.Name);
        Console.WriteLine("Sender address: {0}", email.Sender.Address);

        Console.WriteLine("Attachments: {0}", email.Attachments.Count);
        foreach (MimeData attachment in email.Attachments)
        {
            attachment.Save(@"c:\" + attachment.SafeFileName);
        }
    }
}
' VB.NET

Using converter As New MsgConverter("c:\outlook1.msg")
    If converter.Type = MsgType.Note Then
        Dim email As IMail = converter.CreateMessage()

        Console.WriteLine("Subject: {0}", email.Subject)
        Console.WriteLine("Sender name: {0}", email.Sender.Name)
        Console.WriteLine("Sender address: {0}", email.Sender.Address)
        
        Console.WriteLine("Attachments: {0}", email.Attachments.Count)
        For Each attachment As MimeData In email.Attachments
            attachment.Save("c:\" + attachment.SafeFileName)
        Next

    End If
End Using

You can read more on how to access To, Cc, Bcc fields.