Wednesday, November 14, 2007

Enable POP3 on Exchange 2007


By default, POP3 service is not enabled on Exchange 2007. Moreover, the Administrator account is explicitly blocked from POP3/IMAP4/SMTP for security reasons. To enable POP3 you first must enable and start the service:

 

PS > Set-Service MSExchangePop3 -StartupType automatic
PS > Start-Service MSExchangePop3

 

Enabling POP3 for clients can be achieved with the Set-CASMailbox cmdlet. To get a list of all users mailbox with their POP3 settings:

PS > Get-CASMailbox | Select Name,PopEnabled

 

To enable clients for POP3:
Set-CASMailbox -Identity <username> -PopEnabled $true

 

When trying to connect to a POP3 mailbox, a user/password dialog pop-up appeared. When I entered the user's credentials the dialog kept poping up again and again. Something did not work with the user's login.

I issued Get-Command *pop* and found the cmdlet Get-PopSettings (there is also the corresponding Set-PopSettings), I piped it to Get-Memebr and among all members there was a property called LoginType

PS > Get-PopSettings
...
LoginType       : SecureLogin
...

You can see that the LoginType is set by default to secure login. I needed to change it to allow clear text login (although not recommended), so I piped it to get-member:


PS > Get-PopSettings | gm l*

   TypeName: Microsoft.Exchange.Data.Directory.SystemConfiguration.Pop3AdConfiguration

Name      MemberType Definition
----      ---------- ----------
LoginType Property   Microsoft.Exchange.Data.Directory.SystemConfiguration.LoginOptions LoginType {get;set;}

 

Trying to find the valid values to set the property.

PS > [Microsoft.Exchange.Data.Directory.SystemConfiguration.LoginOptions]

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     LoginOptions                             System.Enum

 

You can see that LoginType is a System.Enum type. To get all valid options for LoginType :

PS > [enum]::getnames([Microsoft.Exchange.Data.Directory.SystemConfiguration.LoginOptions])
PlainTextLogin
PlainTextAuthentication
SecureLogin

 

Now you can change the value to "PlainTextLogin".
PS > Set-PopSettings -LoginType PlainTextLogin

 

After setting the login type to PlainTextLogin, All POP3 enabled users could login successfully.

.

No comments: