diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m
index 07213f2..7f729fd 100644
--- a/ActiveSync/SOGoActiveSyncDispatcher.m
+++ b/ActiveSync/SOGoActiveSyncDispatcher.m
@@ -3035,6 +3035,94 @@ void handle_eas_terminate(int signum)
   return;
 }
 
+- (void) _sendBounceMail: (NSData *) theMail
+                  error:  (NSException *) error
+{
+  NGMutableHashMap *map;
+  NGMimeMessage *bounceMessage;
+  NGMimeBodyPart *bodyPart;
+  NGMimeFileData *fdata;
+  NGMimeMessageGenerator *generator;
+  NGMimeMessageParser *parser;
+  NGMimeMessage *message;
+  NSData *data;
+  NSString *value;
+  id body;
+
+  SOGoMailAccounts *accountsFolder;
+  SOGoMailAccount *accountFolder;
+  SOGoUserFolder *userFolder;
+  SOGoMailFolder *inboxFolder;
+
+  userFolder = [[context activeUser] homeFolderInContext: context];
+  accountsFolder = [userFolder lookupName: @"Mail"  inContext: context  acquire: NO];
+  accountFolder = [accountsFolder lookupName: @"0"  inContext: context  acquire: NO];
+  inboxFolder = [accountFolder inboxFolderInContext: context];
+
+
+  parser = [[NGMimeMessageParser alloc] init];
+  message = [parser parsePartFromData: theMail];
+  RELEASE(parser);
+
+  map = [[[NGMutableHashMap alloc] initWithCapacity: 1] autorelease];
+
+  [map setObject: [[message headersForKey: @"from"] objectAtIndex: 0]  forKey: @"from"];
+  [map setObject: [[message headersForKey: @"from"] objectAtIndex: 0]  forKey: @"to"];
+  [map setObject: [NSString stringWithFormat: @"EAS SendMail Failed - %@", [[message headersForKey: @"subject"] objectAtIndex: 0]]  forKey: @"subject"];
+
+#if GNUSTEP_BASE_MINOR_VERSION < 21
+   value = [[NSDate date] descriptionWithCalendarFormat: @"%a, %d %b %Y %H:%M:%S %z"
+                                               timeZone: [NSTimeZone timeZoneWithName: @"GMT"]
+                                                 locale: nil];
+#else
+   value = [[NSDate date] descriptionWithCalendarFormat: @"%a, %d %b %Y %H:%M:%S %z"
+                                               timeZone: [NSTimeZone timeZoneWithName: @"GMT"]
+                                                 locale: [NSDictionary dictionaryWithObjectsAndKeys:
+                                                            [NSArray arrayWithObjects: @"Jan", @"Feb", @"Mar", @"Apr",
+                                                                                       @"May", @"Jun", @"Jul", @"Aug",
+                                                                                       @"Sep", @"Oct", @"Nov", @"Dec", nil],
+                                                               @"NSShortMonthNameArray",
+                                                            [NSArray arrayWithObjects: @"Sun", @"Mon", @"Tue", @"Wed", @"Thu",
+                                                                                       @"Fri", @"Sat", nil],
+                                                               @"NSShortWeekDayNameArray",
+                                                            nil]];
+#endif
+
+  [map setObject: value  forKey: @"date"];
+  [map setObject: [NSString generateMessageID] forKey: @"message-id"];
+  [map setObject: @"multipart/mixed"  forKey: @"content-type"];
+
+  bounceMessage = [[[NGMimeMessage alloc] initWithHeader: map] autorelease];
+
+  body = [[[NGMimeMultipartBody alloc] initWithPart: bounceMessage] autorelease];
+
+  map = [[[NGMutableHashMap alloc] initWithCapacity: 1] autorelease];
+  [map setObject: @"text/plain; charset=utf-8" forKey: @"content-type"];
+
+  bodyPart = [[[NGMimeBodyPart alloc] initWithHeader: map] autorelease];
+  [bodyPart setBody: [[NSString stringWithFormat: @"Failed to send message with following error:\n\t%@\n\t%@", error.name, error.reason] dataUsingEncoding: NSUTF8StringEncoding]];
+  [body addBodyPart: bodyPart];
+
+  map = [[[NGMutableHashMap alloc] initWithCapacity: 1] autorelease];
+  [map setObject: @"message/rfc822" forKey: @"content-type"];
+  [map setObject: @"8bit" forKey: @"content-transfer-encoding"];
+  [map addObject: [NSString stringWithFormat: @"attachment; filename=\"%@\"", @"undelivered_mail.eml"] forKey: @"content-disposition"];
+  bodyPart = [[[NGMimeBodyPart alloc] initWithHeader: map] autorelease];
+
+  fdata = [[NGMimeFileData alloc] initWithBytes: [theMail bytes]  length: [theMail length]];
+
+  [bodyPart setBody: fdata];
+  RELEASE(fdata);
+  [body addBodyPart: bodyPart];
+
+  [bounceMessage setBody: body];
+
+  generator = [[[NGMimeMessageGenerator alloc] init] autorelease];
+  data = [generator generateMimeFromPart: bounceMessage];
+
+  [inboxFolder postData: data  flags: nil];
+}
+
 //
 //
 //
@@ -3242,7 +3330,14 @@ void handle_eas_terminate(int signum)
 
   if (error)
     {
-      if ([[context objectForKey: @"ASProtocolVersion"] floatValue] >= 14.0)
+      if ([[SOGoSystemDefaults sharedSystemDefaults] easSendBounceMail])
+        {
+          if (debugOn)
+            [self logWithFormat: @"EAS - Mail delivery failed, sending bounce mail." ];
+
+          [self _sendBounceMail: data error: error];
+        }
+      else if ([[context objectForKey: @"ASProtocolVersion"] floatValue] >= 14.0)
         {
           NSMutableString *s;
           NSData *d;
@@ -3770,7 +3865,14 @@ void handle_eas_terminate(int signum)
       
       if (error)
         {
-          if ([[context objectForKey: @"ASProtocolVersion"] floatValue] >= 14.0)
+          if ([[SOGoSystemDefaults sharedSystemDefaults] easSendBounceMail])
+            {
+              if (debugOn)
+                [self logWithFormat: @"EAS - Mail delivery failed, sending bounce mail." ];
+
+              [self _sendBounceMail: data error: error];
+            }
+          else if ([[context objectForKey: @"ASProtocolVersion"] floatValue] >= 14.0)
             {
               NSMutableString *s;
               NSData *d;
diff --git a/SoObjects/SOGo/SOGoSystemDefaults.h b/SoObjects/SOGo/SOGoSystemDefaults.h
index 98f1414..f65ab98 100644
--- a/SoObjects/SOGo/SOGoSystemDefaults.h
+++ b/SoObjects/SOGo/SOGoSystemDefaults.h
@@ -65,6 +65,7 @@
 
 - (BOOL) uixDebugEnabled;
 - (BOOL) easDebugEnabled;
+- (BOOL) easSendBounceMail;
 
 - (NSString *) pageTitle;
 
diff --git a/SoObjects/SOGo/SOGoSystemDefaults.m b/SoObjects/SOGo/SOGoSystemDefaults.m
index 527f4d8..6b9fa72 100644
--- a/SoObjects/SOGo/SOGoSystemDefaults.m
+++ b/SoObjects/SOGo/SOGoSystemDefaults.m
@@ -434,6 +434,11 @@ _injectConfigurationFromFile (NSMutableDictionary *defaultsDict,
   return [self boolForKey: @"SOGoEASDebugEnabled"];
 }
 
+- (BOOL) easSendBounceMail
+{
+  return [self boolForKey: @"SOGoEASSendBounceMail"];
+}
+
 - (NSString *) pageTitle
 {
   return [self stringForKey: @"SOGoPageTitle"];
