About these ads

David Vassallo's Blog

If at first you don't succeed; call it version 1.0

Category Archives: Ubuntu

Connecting Ubuntu / Mint to exchange mail and calendar

Assumptions and pre-requisites.

This article assumes the Linux user has the following installed:

  • An Ubuntu derived distribution such as Ubuntu itself, Linux Mint, and so on
  • The email client used is evolution, installed via the following packages and their dependencies:
  • evolution
  • evolution-common
  • evolution-data-server-common
  • evolution-mapi
  • evolution-ews
  • evolution-data-server-goa
  • evolution-plugins
  • gnome-online-accounts
  • gnome-control-center

Setup Details

  • Open the system menu and search / type for ‘online accounts‘. Note: you may see multiple entries for this. The correct entry is the one which allows you to select an account of type ‘Microsoft Exchange’ (see below)
  • Open online accounts and click on the “+” sign on the lower left to add an account. Make sure to select the type “Microsoft Exchange”

email_linux_1

  • Type in your email and password
  • Expand the “custom” settings and enter:
  • Username: [email protected] (note the following format has also been reported to work: your-domain\your-username)
  • Server: webmail.example.com (note that this is actually the domain of your outlook web access URL. For example, if your webmail URL is webmail.something.com/owa, then this server would be webmail.something.owa)
  • Click on connect, and very that the account is being used for mail, calendar and contacts as shown below

email_linux_2

  • close the online accounts settings box
  • Open evolution (close and re-open if evolution was previously open)
  • Verify that the account has been successfully added in evolution by:
  • Edit > Preferences
  • Under Mail Accounts, make sure a corresponding entry to the above is visible in the window. In the below example, you see two such accounts of type ‘EWS” (also distinguishable from their icon looking like a plug, whereas other accounts do not have the icon and have the tickbox)

email_linux_3

  • Your mail should now be visible under the evolution ‘mail’ tab, and an equivalent calendar should have been automatically added under the ‘calendar’ tab

Additional Notes

If you do not use gnome-online accounts, it is still possible to set this up (though without calendar), the one extra piece of information needed is that along with an account type of ‘EWS’, the host URL should be: https://webmail.example.com/EWS/Exchange.asmx. Also, during troubleshooting, it is useful to see if that URL is reachable.

About these ads

Lessons Learned : Linux System Tray Icons in python

While programming in python, for an Ubuntu/Linux Mint target, you may want to include a system tray icon for batter interaction with users. In Ubuntu, these are called “application indicators”. A basic appindicator icon is quite simple to do in python via PyGTK. There’s a very good example here:

http://developer.ubuntu.com/resources/technologies/application-indicators/

Scroll down to the PyGTK section and there’s a pretty self-explanatory example. I ran into two issues during the project:

  • I needed the appindicator to periodically run a function/method. This function would periodically check some flags, and then update it’s icon. Took some searching, but turns out this is possible via the glib module, and it’s timeout-add method, which you can read about here:

https://developer.gnome.org/pygobject/stable/glib-functions.html#function-glib–timeout-add

Using it is pretty simple. Make sure to include the module of course:

import glib

If you are using classes, as I did, add the following to your __init__ method:

glib.timeout_add(5000, self.some_function)

Where some_function is a method in your class which will be run every 5 seconds in my example above.

  • In pre 13.x ubuntu editions, applications needed to be whitelisted in order to give them permission to use the system tray. So you need to cater for this if you have users that may be using pre-13.x ubuntu versions. You can include the following in your install script (warning – the below whitelists every application):

release=`lsb_release -a 2>/dev/null| grep Release | awk ‘{print $2;}’`
if [[ $release < 13 ]] 

then 

        sudo gsettings set com.canonical.Unity.Panel systray-whitelist “['all']” 

fi

  • If you need to specify custom icon paths, you may need to use absolute paths… in some cases relative paths simply didnt show any icons …

References:

https://unity.ubuntu.com/projects/appindicators/

Follow

Get every new post delivered to your Inbox.

Join 170 other followers