diff -ur /home/gray/meta1-1.0.PreAlpha28.0-gray-1/libsmmap/lookupaddr.c meta1-1.0.PreAlpha28.0-gray-1/libsmmap/lookupaddr.c
--- /home/gray/meta1-1.0.PreAlpha28.0-gray-1/libsmmap/lookupaddr.c	2007-01-22 19:24:06.000000000 +0200
+++ meta1-1.0.PreAlpha28.0-gray-1/libsmmap/lookupaddr.c	2009-06-07 10:35:30.450576943 +0300
@@ -391,6 +391,10 @@
 				}
 				goto done;
 			}
+			if (SM_E_NOMORE == ret) {
+				ret = sm_error_perm(SM_EM_MAP, SM_E_NOTFOUND);
+				goto done;
+			}
 		}
 
 		/* lookup with ++ (tag user delim + @ domain) */
@@ -431,6 +435,10 @@
 				}
 				goto done;
 			}
+			if (SM_E_NOMORE == ret) {
+				ret = sm_error_perm(SM_EM_MAP, SM_E_NOTFOUND);
+				goto done;
+			}
 		}
 
 		/* lookup with +* (tag user delim * @ domain) */
@@ -471,6 +479,10 @@
 				}
 				goto done;
 			}
+			if (SM_E_NOMORE == ret) {
+				ret = sm_error_perm(SM_EM_MAP, SM_E_NOTFOUND);
+				goto done;
+			}
 		}
 
 		/* lookup with * (tag user * @ domain) */
@@ -510,6 +522,10 @@
 				}
 				goto done;
 			}
+			if (SM_E_NOMORE == ret) {
+				ret = sm_error_perm(SM_EM_MAP, SM_E_NOTFOUND);
+				goto done;
+			}
 		}
 
 		/*
@@ -561,6 +577,10 @@
 				}
 				goto done;
 			}
+			if (SM_E_NOMORE == ret) {
+				ret = sm_error_perm(SM_EM_MAP, SM_E_NOTFOUND);
+				goto done;
+			}
 		}
 
 /*
@@ -608,6 +628,10 @@
 				}
 				goto done;
 			}
+			if (SM_E_NOMORE == ret) {
+				ret = sm_error_perm(SM_EM_MAP, SM_E_NOTFOUND);
+				goto done;
+			}
 		}
 
 		if (domain != NULL && SMMAP_IS_LFL(flags, SMMAP_LFL_DOTSUBDOM)) {
@@ -656,6 +680,10 @@
 				goto done;
 			if (SM_SUCCESS == ret)
 				goto done;
+			if (SM_E_NOMORE == ret) {
+				ret = sm_error_perm(SM_EM_MAP, SM_E_NOTFOUND);
+				goto done;
+			}
 		}
 
 		/* lookup with ++ (tag user delim +)*/
@@ -692,6 +720,10 @@
 				}
 				goto done;
 			}
+			if (SM_E_NOMORE == ret) {
+				ret = sm_error_perm(SM_EM_MAP, SM_E_NOTFOUND);
+				goto done;
+			}
 		}
 
 		/* lookup with +* (tag user delim *) */
@@ -727,6 +759,10 @@
 				}
 				goto done;
 			}
+			if (SM_E_NOMORE == ret) {
+				ret = sm_error_perm(SM_EM_MAP, SM_E_NOTFOUND);
+				goto done;
+			}
 		}
 
 		/* lookup with * (tag user *) */
@@ -762,6 +798,10 @@
 				}
 				goto done;
 			}
+			if (SM_E_NOMORE == ret) {
+				ret = sm_error_perm(SM_EM_MAP, SM_E_NOTFOUND);
+				goto done;
+			}
 		}
 
 
@@ -803,6 +843,10 @@
 				}
 				goto done;
 			}
+			if (SM_E_NOMORE == ret) {
+				ret = sm_error_perm(SM_EM_MAP, SM_E_NOTFOUND);
+				goto done;
+			}
 		}
 	}
 
diff -ur /home/gray/meta1-1.0.PreAlpha28.0-gray-1/libsmmap/sequence.c meta1-1.0.PreAlpha28.0-gray-1/libsmmap/sequence.c
--- /home/gray/meta1-1.0.PreAlpha28.0-gray-1/libsmmap/sequence.c	2007-01-22 19:25:06.000000000 +0200
+++ meta1-1.0.PreAlpha28.0-gray-1/libsmmap/sequence.c	2009-06-07 10:20:10.546589008 +0300
@@ -386,8 +386,8 @@
 		if (NULL == maph)
 			return sm_error_perm(SM_EM_MAP, EINVAL);
 		ret = sm_map_lookup(maph, flags, key, data);
-		if (SM_SUCCESS == ret)
-			break;
+		if (SM_SUCCESS == ret || SM_E_NOMORE == ret) 
+			return ret;
 		if (sm_is_err(ret) && sm_is_temp_err(ret))
 			tempfail = ret;
 	}
diff -ur /home/gray/meta1-1.0.PreAlpha28.0-gray-1/libsmmap/sockmapimpl.c meta1-1.0.PreAlpha28.0-gray-1/libsmmap/sockmapimpl.c
--- /home/gray/meta1-1.0.PreAlpha28.0-gray-1/libsmmap/sockmapimpl.c	2009-06-02 01:14:52.000000000 +0300
+++ meta1-1.0.PreAlpha28.0-gray-1/libsmmap/sockmapimpl.c	2009-06-07 00:50:01.390609844 +0300
@@ -275,6 +275,9 @@
 	else if (sm_streq(status, "NOTFOUND")) {
 		return sm_error_perm(SM_EM_MAP, SM_E_NOTFOUND);
 	}
+	else if (sm_streq(status, "NOMORE")) {
+		return SM_E_NOMORE;
+	} 
 	else {
 		if (sm_streq(status, "TEMP") || sm_streq(status, "TIMEOUT"))
 			ret = sm_error_temp(SM_EM_MAP, SM_E_TEMPMAP);
diff -ur orig/meta1-1.0.PreAlpha28.0/doc/README.tex meta1-1.0.PreAlpha28.0/doc/README.tex
--- orig/meta1-1.0.PreAlpha28.0/doc/README.tex	2009-06-07 11:21:28.000000000 +0300
+++ meta1-1.0.PreAlpha28.0/doc/README.tex	2009-06-07 12:13:07.000000000 +0300
@@ -5111,6 +5111,7 @@ upper case words:
 \begin{tabular}{ll}
 {\tt OK}	& the key was found, result contains the looked up value \\
 {\tt NOTFOUND}	& the key was not found, the result is empty	\\
+{\tt NOMORE}    & the key was not found, stop further search    \\
 {\tt TEMP}	& a temporary failure occured	\\
 {\tt TIMEOUT}	& a timeout occured on the server side	\\
 {\tt PERM}	& a permanent failure occured	\\
@@ -5119,6 +5120,42 @@ upper case words:
 In case of errors (status {\tt TEMP}, {\tt TIMEOUT} or {\tt PERM})
 the result field may contain an explanatory message.
 
+The {\tt NOMORE} status indicates that the key has not been found and
+also instructs SMAR to stop any further searches using this key and its
+derivatives. 
+
+For example, consider lookups in the alias map. Suppose that the current
+alias map is configured as:
+
+\begin{verbatim}
+aliases {
+     name = aliasmap;
+     flags = { localpart, local_domains };
+}
+\end{verbatim}
+where {\tt aliasmap} is a socket map declared earlier in the
+configuration. This means that when looking for the key
+{\tt foo@bar.net}, SMAR will perform the following lookups 
+(see Section \ref{LookupOrders}):
+
+\begin{verbatim}
+aliases foo@bar.net
+aliases foo*@bar.net
+aliases foo
+\end{verbatim}
+
+Suppose that the alias {\tt foo@bar.net} does not exist, but the local
+alias {\tt foo} does exist. Now, when presented the lookup key {\tt
+foo@bar.net}, the socket map cannot simply return {\tt NOTFOUND},
+because then SMAR will go on searching until the search for
+{\tt foo} returns a false positive. In this case, the map should
+return {\tt NOMORE}. When returned this reply, SMAR discontinues
+further searches and acts as if {\tt NOTFOUND} was returned.
+
+The {\tt NOMORE} return works also in sequence map. If any of the maps
+in the sequence returns {\tt NOMORE}, the remaining maps are not
+tried.
+
 Example replies:
 
 \begin{verbatim}
