Browse code
recovery from inadvertent commit.
dancy authored on 01/06/2007 16:21:38
Showing 1 changed files
Showing 1 changed files
... | ... |
@@ -14,7 +14,7 @@ |
14 | 14 |
;; merchantability or fitness for a particular purpose. See the GNU |
15 | 15 |
;; Lesser General Public License for more details. |
16 | 16 |
;; |
17 |
-;; $Id: rfc2822.cl,v 1.4 2007/05/31 23:13:08 dancy Exp $ |
|
17 |
+;; $Id: rfc2822.cl,v 1.5 2007/06/01 16:21:38 dancy Exp $ |
|
18 | 18 |
|
19 | 19 |
#+(version= 8 0) |
20 | 20 |
(sys:defpatch "rfc2822" 0 |
... | ... |
@@ -153,6 +153,9 @@ domain. |
153 | 153 |
(defconstant *local-part* |
154 | 154 |
(format nil "(~a)|(~a)" *dot-atom* *quoted-string*)) |
155 | 155 |
|
156 |
+ (defconstant *local-part-x* |
|
157 |
+ (format nil "^(?:~a)|(?:~a)" *dot-atom* *quoted-string*)) |
|
158 |
+ |
|
156 | 159 |
;; domain literals not supported. |
157 | 160 |
(defconstant *domain* *dot-atom*) |
158 | 161 |
|
... | ... |
@@ -198,62 +201,6 @@ domain. |
198 | 201 |
then nil |
199 | 202 |
else (values user domain)))) |
200 | 203 |
|
201 |
-;; Returns a list of entries like so: |
|
202 |
-;; (:mailbox user domain display-name) |
|
203 |
-;; or |
|
204 |
-;; (:group display-name mailbox-list) |
|
205 |
- |
|
206 |
-(defun extract-email-addresses (string &key (start 0) (end (length string)) |
|
207 |
- (errorp t)) |
|
208 |
- ) |
|
209 |
- |
|
210 |
-(defmacro parse-common (re) |
|
211 |
- (let ((matched (gensym)) |
|
212 |
- (whole (gensym)) |
|
213 |
- (inner (gensym))) |
|
214 |
- (setf re (format nil "^~a" (symbol-value re))) |
|
215 |
- `(multiple-value-bind (,matched ,whole, inner) |
|
216 |
- (match-re ,re string :start start :end end :return :index) |
|
217 |
- (when ,matched |
|
218 |
- (values (subseq string (car ,inner) (cdr ,inner)) |
|
219 |
- (cdr ,whole)))))) |
|
220 |
- |
|
221 |
-;; Domain literals not supported |
|
222 |
-;; local-part @ domain ==> |
|
223 |
-;; dot-atom/quoted-string @ dot-atom |
|
224 |
-;; Optionally allows domain-less addrspecs. However, doing so |
|
225 |
-;; makes parsing ambiguous. |
|
226 |
-(defun parse-addr-spec (string start end require-domain) |
|
227 |
- (declare (optimize (speed 3)) |
|
228 |
- (fixnum start end)) |
|
229 |
- (block nil |
|
230 |
- (multiple-value-bind (local-part newpos) |
|
231 |
- (parse-local-part string start end) |
|
232 |
- (if (null local-part) |
|
233 |
- (return)) |
|
234 |
- (setf start newpos) |
|
235 |
- (when (or (eq start end) |
|
236 |
- (not (eq (char string start) #\@))) |
|
237 |
- ;; no domain part. |
|
238 |
- (if* require-domain |
|
239 |
- then (return) |
|
240 |
- else (return (values local-part nil start)))) |
|
241 |
- (incf start) |
|
242 |
- (multiple-value-bind (domain newpos) |
|
243 |
- (parse-common *dot-atom*) |
|
244 |
- (if domain |
|
245 |
- (values local-part domain newpos)))))) |
|
246 |
- |
|
247 |
-(defun parse-local-part (string &optional (start 0) (end (length string))) |
|
248 |
- (multiple-value-bind (dot-atom newpos) |
|
249 |
- (parse-common *dot-atom*) |
|
250 |
- (if* dot-atom |
|
251 |
- then (values dot-atom newpos) |
|
252 |
- else (multiple-value-bind (quoted-string newpos) |
|
253 |
- (parse-common *quoted-string*) |
|
254 |
- (when quoted-string |
|
255 |
- (values quoted-string newpos)))))) |
|
256 |
- |
|
257 | 204 |
;; Ripped from maild:dns.cl and modified. |
258 | 205 |
|
259 | 206 |
(eval-when (compile load eval) |