About these ads
Archive | Ubuntu RSS for this section

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/

Python system tray notifications in Linux

As a follow up to my previous post, here’s how to accomplish system tray notifications in ubuntu linux and family. I must say, compared to windows, this is child’s play… under ten lines of code!

#!/usr/bin/python
import sys
import pynotify

if __name__ == ‘__main__’:
if not pynotify.init (“summary-body”):
sys.exit (1)

# try the summary-body case
n = pynotify.Notification (“Cloudlink”,
“Hello Brian :) “)
n.show ()

 

This results in something like this (under linux mint – top right corner):

Screenshot from 2013-10-19 12:49:46

A full, more involved example can be found here

Web MeetMe : Conferencing in FreePBX

The company I work for currently uses TrixBox as their VoIP server. It’s an excellent piece of software but being no longer supported, the decision was taken to upgrade to the later and more active FreePBX. Since they are both built around the asterisk core, I figured this upgrade wouldn’t be too much of a problem. In fact it wasnt, most of the features in TrixBox I got working in FreePBX with no effort.

There was one stumbling block: conferencing. In TrixBox, users used to dynamically create conferences on the fly using WebMeetMe. In TrixBox, installation and activation of WebMeetMe was as simple as downloading and activating the appropriate module. Alas, in FreePBX the excellent WebMeetMe is not pre-installed (why??). So the installation is a bit more involving though ultimately works just as well :)

I am taking the opportunity to document exactly what I’ve done to get this working:

1. Download latest version of FreePBX

2. Install FreePBX as per usual procedures. Create a couple of SIP extensions and make sure they work before proceeding. Pleny of documentation on the ‘net if you get stuck here

3. Download the latest version of WebMeetMe

Note: For any of the below to work you need to ensure that FreePBX is setup to use the meetme module rather than the newer “confbridge”. This is done via:

FreePBX > Settings > Advanced Setting and ensure that Conference Room App is set to “app_meetme

3

4. The README within the tarball downloaded from 3 has some good install notes, however I found Mark In the Dark’s install notes to be much clearer and helpful. So, I followed the steps outlined here:

http://www.markinthedark.nl/news/ubuntu-linux-unix/75-install-web-meetme-402-for-freeppbx-28-with-asterisk-18-on-centos-55.html

5. Once the above procedure was done, visiting the page http://%5Bmy-ip-address%5D/web-meetme/meetme_control.php returned a HTTP 500 error. Checking the /var/log/httpd/error logs I saw a corresponding entry similar to:

PHP Parse error:  syntax error, unexpected $end in /var/www/html/web-meetme/lib/defines.php on line 145

To resolve the above, open the file defines.php, scroll to the bottom, and change the last three lines from this:

<?
}

?>

To this:

<?php
}

?>

6. If, like me, you decided on using MYSQL for authentication rather than LDAP, I again ran into an HTTP 500 error when attempting to logon. The error was:

PHP Fatal error:  Call to undefined function authsql() in /var/www/html/web-meetme/lib/functions.php on line 73

To resolve this, copy the contents of:

/var/www/html/web-meetme/lib/sqldb.php 

into:

/var/www/html/web-meetme/lib/functions.php

The above should allow you to login and schedule calls using web meet me. That said, I found documentation on how to setup an extension which callers could use to dial into WebMeetMe woefully lacking. Here’s what I did:

1. Add a custom extension

> SSH into the box, and edit the file: /etc/asterisk/extensions_custom.conf

> Add the following to the file:

[conferences]
include => ext-meetme; in [ext-meetme] contest are stored all the conferences created in FreePBX
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Playback(welcome); Insert your welcome recording
exten => s,n,Goto(STARTMEETME,1)

2. Add custom destination
This step is needed to make the FreePBX GUI aware of the custom extension we define above, and make it available as a choice within the GUI. Within FreePBX: [admin > custom destination] and use:

Custom Destination: conferences,s,1
Description: conftest

1

At this stage, you have an extension you can use. In our case we needed the webmeetme to be dialed into from both an external number and an internal one.

For external callers

  • FreePBX > Connectivity > Inbound Routes. Select the appropriate DID, ex 21123456, and set the destination as a custom destination and select conftest from the pull-down menu (or whatever you entered in step 2 above)

For Internal callers

  • FreePBX > Applications> Misc Applications. Enter in a description, a “feature code” (which is the number internal users will dial, example *789, and select the destination to be a custom destination and select conftest from the pull-down menu (or whatever you entered in step 2 above)

2

Update: SQUID transparent SSL interception : Squid v3.2

In order to keep this blog post a bit more relevant, there have been some improvements since that post was written. Squid v3.2 has been released earlier this year, making ssl interception more seamless and easier. The new features for HTTPS interception can be found while reading through the man page for http_port:

http://www.squid-cache.org/Versions/v3/3.2/cfgman/http_port.html

More specifically:

1. The “transparent” keyword has been changed to “intercept“:

           intercept    Rename of old 'transparent' option to indicate proper functionality.

INTERCEPT is now better described as:

intercept	Support for IP-Layer interception of
			outgoing requests without browser settings.
			NP: disables authentication and IPv6 on the port.

2. In order to avoid more certificate errors when intercepting HTTPS sites, squid now can dynamically generate SSL certificates, using generate-host-certificates. This means the CN of the certificate should now match that of the origin server, though the certificate will still be generated using SQUID’s private key:

SSL Bump Mode Options:
	    In addition to these options ssl-bump requires TLS/SSL options.

	   generate-host-certificates[=<on|off>]
			Dynamically create SSL server certificates for the
			destination hosts of bumped CONNECT requests.When 
			enabled, the cert and key options are used to sign
			generated certificates. Otherwise generated
			certificate will be selfsigned.
			If there is a CA certificate lifetime of the generated 
			certificate equals lifetime of the CA certificate. If
			generated certificate is selfsigned lifetime is three 
			years.
			This option is enabled by default when ssl-bump is used.
			See the ssl-bump option above for more information.

Looks like the above is an offshoot of the excellent work here: http://wiki.squid-cache.org/Features/DynamicSslCert

Make sure to use the above two features for smoother HTTPS interception – though remember, always warn users that SSL traffic is being decrypted, privacy is a highly-valued right…

Follow

Get every new post delivered to your Inbox.

Join 138 other followers

%d bloggers like this: