diff --git a/calendar/libedata-cal/e-data-cal-factory.c b/calendar/libedata-cal/e-data-cal-factory.c
index 88aeb41..325d95c 100644
--- a/calendar/libedata-cal/e-data-cal-factory.c
+++ b/calendar/libedata-cal/e-data-cal-factory.c
@@ -45,6 +45,10 @@
 
 #include "e-gdbus-egdbuscalfactory.h"
 
+#ifdef HAVE_ICAL_UNKNOWN_TOKEN_HANDLING
+#include <libical/ical.h>
+#endif
+
 #ifdef G_OS_WIN32
 #include <windows.h>
 #include <conio.h>
@@ -895,6 +899,10 @@ main (gint argc, gchar **argv)
 	g_set_prgname (E_PRGNAME);
 	if (!g_thread_supported ()) g_thread_init (NULL);
 
+	#ifdef HAVE_ICAL_UNKNOWN_TOKEN_HANDLING
+	ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN);
+	#endif
+
 	factory = g_object_new (E_TYPE_DATA_CAL_FACTORY, NULL);
 
 	loop = g_main_loop_new (NULL, FALSE);
diff --git a/configure.ac b/configure.ac
index 7a1d4c4..9d89b29 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1251,6 +1251,21 @@ dnl *****
 	EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS, $LIBICAL_EXTRA_CFLAGS, $LIBICAL_EXTRA_LIBS)
 	AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
 	AC_SUBST(EVOLUTION_CALENDAR_LIBS)
+
+	dnl ****************************
+	dnl Check for ical_set_unknown_token_handling_setting function
+	dnl ****************************
+	AC_MSG_CHECKING([ical_set_unknown_token_handling_setting function])
+	save_cflags=$CFLAGS; CFLAGS=$EVOLUTION_CALENDAR_CFLAGS
+	save_libs=$LIBS; LIBS="$EVOLUTION_CALENDAR_LIBS"
+	AC_LINK_IFELSE([AC_LANG_PROGRAM(
+		[[#include <libical/ical.h>]],
+		[[ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN)]])],
+		[AC_DEFINE(HAVE_ICAL_UNKNOWN_TOKEN_HANDLING, 1, [libical provides ical_set_unknown_token_handling_setting function]) ac_cv_have_iuth=yes],[ac_cv_have_iuth=no])
+	CFLAGS=$save_cflags
+	LIBS=$save_libs
+	AC_MSG_RESULT([$ac_cv_have_iuth])
+
 fi
 
 dnl ******************************
