Skip to content
Browse files

Don't require HELO name in `check_from`

  • Loading branch information...
1 parent c9e070a commit 03c6bf88ce482f3424b7616cb1a67ee61707e38d @andrenth committed Sep 14, 2012
Showing with 4 additions and 3 deletions.
  1. +3 −2 lib/SPF.ml
  2. +1 −1 lib/SPF.mli
View
5 lib/SPF.ml
@@ -110,11 +110,12 @@ let check_helo server client_addr helo =
free_request req in
finalize check close req
-let check_from server client_addr helo from =
+let check_from server client_addr from =
+ if not (String.contains from '@') then
+ raise (SPF_error ("invalid from address: " ^ from));
let req = request server in
let check req =
set_inet_addr req client_addr;
- set_helo_domain req helo;
set_envelope_from req from;
query_mailfrom req in
let close req =
View
2 lib/SPF.mli
@@ -30,7 +30,7 @@ val free_request : request -> unit
val check_helo : server -> Unix.inet_addr -> string -> response
-val check_from : server -> Unix.inet_addr -> string -> string -> response
+val check_from : server -> Unix.inet_addr -> string -> response
val result : response -> result
val reason : response -> reason

0 comments on commit 03c6bf8

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