Skip to content
Browse files

Add more documentation to the smtpd_queue.erl file

git-svn-id: http://erlmail.googlecode.com/svn/trunk@141 a0ed728d-bb3d-0410-838c-d777afece975
  • Loading branch information...
1 parent f414fa5 commit 0e05f3ae86d0ef06f2929fe180f9a9a97ee31e41 simpleenigmainc committed Jan 23, 2008
Showing with 18 additions and 13 deletions.
  1. +18 −13 src/smtpd_queue.erl
View
31 src/smtpd_queue.erl
@@ -45,30 +45,35 @@
-
+%%-------------------------------------------------------------------------
+%% @spec (IP::tuple()) -> true | false
+%% @doc Determines of IP address is in any of the ranges listed in the
+%% server_smtp_relay_clients enviroment variable. Check configuration
+%% information on how to add more ranges into the user config file.
+%% @end
+%%-------------------------------------------------------------------------
checkip(IP) ->
Ranges = erlmail_util:get_app_env(server_smtp_relay_clients,[]),
checkip(IP,Ranges).
+%%-------------------------------------------------------------------------
+%% @spec (IP::tuple(),{Start::tuple(),End::tuple}) -> true | false
+%% @doc
+%% @hidden
+%% @end
+%%-------------------------------------------------------------------------
checkip(_IP,[]) -> false;
checkip(IP,[{Network,Mask}|T]) ->
case ip_in_range(IP,mtor(Network,Mask)) of
true -> true;
false -> checkip(IP,T)
end.
-
-
-
-
-
-
-
-
-
-
-
-
+%%-------------------------------------------------------------------------
+%% @spec (IP::tuple(),{Start::tuple(),End::tuple}) -> true | false
+%% @doc determines of IP address is between Start and End
+%% @end
+%%-------------------------------------------------------------------------
ip_in_range(IP,{Start,End}) ->
D = aton(IP),
S = aton(Start),

0 comments on commit 0e05f3a

Please sign in to comment.
Something went wrong with that request. Please try again.