Commit 54b994b7 authored by Adam Krupicka's avatar Adam Krupicka
Browse files

Canonicalize the RCPT TO address to not include a possible associated name

parent a6be003b
......@@ -160,6 +160,16 @@
(mask str))
resultstr))
(defun canonicalize-address (address)
"If address is in the form 'Name <address>', return only address.\
Otherwise, return the original address."
(let ((pos (search "<" address)))
(if pos
(subseq address
(1+ pos)
(- (length address) 1))
address)))
(define-condition smtp-error (error)
())
......@@ -400,7 +410,8 @@
(dolist (address to)
(restart-case
(smtp-command stream (format nil "RCPT TO:<~A>"
(substitute-return-newline address))
(substitute-return-newline
(canonicalize-address address)))
250
:condition-class 'rcpt-failed
:condition-arguments (list :recipient address))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment