cl-smtp issueshttps://gitlab.common-lisp.net/groups/cl-smtp/-/issues2024-03-28T20:09:42Zhttps://gitlab.common-lisp.net/cl-smtp/cl-smtp/-/issues/8cl-smtp tests are broken for Quicklisp2024-03-28T20:09:42ZRobert Browncl-smtp tests are broken for QuicklispQuicklisp can't successfully load and run the project's tests. Failure log is here: http://report.quicklisp.org/2023-11-10/failure-report/cl-smtp.html#cl-smtp-tests
I have created a merge request that fixes the problems: https://gitl...Quicklisp can't successfully load and run the project's tests. Failure log is here: http://report.quicklisp.org/2023-11-10/failure-report/cl-smtp.html#cl-smtp-tests
I have created a merge request that fixes the problems: https://gitlab.common-lisp.net/cl-smtp/cl-smtp/-/merge_requests/4https://gitlab.common-lisp.net/cl-smtp/cl-smtp/-/issues/1Exported symbols don't come through in modern-mode Lisp2018-01-04T12:32:22ZDave CooperExported symbols don't come through in modern-mode LispHi,
To get e.g. (cl-smtp:send-email ...) to be recognized in a so-called "modern-mode" CL, I had to change the export section to be as follows:
```
(defpackage :cl-smtp
(:use :cl :asdf :flexi-streams :trivial-gray-streams)
...Hi,
To get e.g. (cl-smtp:send-email ...) to be recognized in a so-called "modern-mode" CL, I had to change the export section to be as follows:
```
(defpackage :cl-smtp
(:use :cl :asdf :flexi-streams :trivial-gray-streams)
(:export #:send-email
#:with-smtp-mail
#:smtp-error
#:smtp-protocol-error
#:no-supported-authentication-method
#:rcpt-failed
#:ignore-recipient
#:attachment
#:make-attachment
#:attachment-name
#:attachment-data-pathname
#:attachment-mime-type
#:rfc2045-q-encode-string
#:rfc2231-encode-string
#:write-rfc8822-message)
#+nil
(:export "SEND-EMAIL"
"WITH-SMTP-MAIL"
"SMTP-ERROR"
"SMTP-PROTOCOL-ERROR"
"NO-SUPPORTED-AUTHENTICATION-METHOD"
"RCPT-FAILED"
"IGNORE-RECIPIENT"
"ATTACHMENT"
"MAKE-ATTACHMENT"
"ATTACHMENT-NAME"
"ATTACHMENT-DATA-PATHNAME"
"ATTACHMENT-MIME-TYPE"
"RFC2045-Q-ENCODE-STRING"
"RFC2231-ENCODE-STRING"
"WRITE-RFC8822-MESSAGE"))
```
If you're ok with this change, could you roll it in? If so, and if a proper git patch or merge request would be more convenient, then please just let me know.
Best Regards and thank you for all the maintenance effort,
Dave Cooper
https://gitlab.common-lisp.net/cl-smtp/cl-smtp/-/issues/10Feature: Opt-out for SSL certificate verification2024-03-28T08:48:04ZKilian M. HaemmerleFeature: Opt-out for SSL certificate verificationFor using encrypted mail services via _SMTP_, e.g. Protonmail offers a local [bridge application](https://proton.me/mail/bridge).
While trying to use this client with _CL-SMTP_ I get the following error:
_SSL verify error: 18 X509_V_ER...For using encrypted mail services via _SMTP_, e.g. Protonmail offers a local [bridge application](https://proton.me/mail/bridge).
While trying to use this client with _CL-SMTP_ I get the following error:
_SSL verify error: 18 X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT_
To get this bridge working we basically have to opt-out of SSL Certificate verfication of _cl+ssl_.
This can be done by supplying the value _NIL_ to the _verify_ keyword of _cl+ssl:make-ssl-client-stream_ and adding a keyword _verify_ / _verify-certificate_ (default value _T_) to _cl-smtp:send-email_ and _with-smtp-mail_.
I would be happy to supply a MR if granted access to this project.https://gitlab.common-lisp.net/cl-smtp/cl-smtp/-/issues/7HELO commands ignore :local-hostname parameter to send-email2021-02-16T20:50:22Zx0rHELO commands ignore :local-hostname parameter to send-emailThe `smtp-handshake` function uses the supplied `local-hostname` keyword
parameter when sending an EHLO command, but uses
`(usocket::get-host-name)` directly for HELO commands.
This causes sending e-mails to fail on my setup, because my...The `smtp-handshake` function uses the supplied `local-hostname` keyword
parameter when sending an EHLO command, but uses
`(usocket::get-host-name)` directly for HELO commands.
This causes sending e-mails to fail on my setup, because my Postfix
server is configured to reject HELO with non-FQDN names
(`reject_non_fqdn_hostname`). This happens despite supplying a
fully-qualified `:local-hostname` to `send-email`.https://gitlab.common-lisp.net/cl-smtp/cl-smtp/-/issues/9Message-id header2023-12-30T11:33:13Zcage2Message-id headerHi!
I have found that some SMTP server (notably gmail) does not accepts a
message without a proper message-id header.
I have wrote some simple code to generate the header's value following
(more or less) suggestions in this document:
...Hi!
I have found that some SMTP server (notably gmail) does not accepts a
message without a proper message-id header.
I have wrote some simple code to generate the header's value following
(more or less) suggestions in this document:
https://www.jwz.org/doc/mid.html
the actual code follow, please consider to add it to cl-smtp.
Bye an thanks!
C.
``` lisp
(defparameter *base36-alphabet* "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")
(defun encode-base-36 (number &optional (accum '()))
(if (<= number 0)
(coerce (reverse accum) 'string)
(let ((new-number (truncate (/ number 36)))
(remainder (rem number 36)))
(encode-base-36 new-number (push (elt *base36-alphabet* remainder)
accum)))))
(defun generate-mail-message-id (&optional (local-host (usocket::get-host-name)))
(format nil
"<~a~a.~a@~a>"
(encode-base-36 (get-universal-time))
(random 2048)
(random 2048)
local-host))
```https://gitlab.common-lisp.net/cl-smtp/cl-smtp/-/issues/4Problem with subject header2019-03-20T10:48:27ZVyacheslavProblem with subject headerHello. Thanks for you library!
I think there is a problem in this function (https://gitlab.common-lisp.net/cl-smtp/cl-smtp/blob/master/cl-smtp.lisp#L70). When I send string with non-ascii characters gmail is eat spaces, tabs and, I thin...Hello. Thanks for you library!
I think there is a problem in this function (https://gitlab.common-lisp.net/cl-smtp/cl-smtp/blob/master/cl-smtp.lisp#L70). When I send string with non-ascii characters gmail is eat spaces, tabs and, I think, other ascii-characters. When I use non-ascii characters, string is mix of encoded non-ascii chars and not encoded ascii. For example, when I try this:
```common_list
(cl-smtp::rfc2045-q-encode-string "Текст с пробелами")
```
I get: `"=?UTF-8?Q?=D0=A2=D0=B5=D0=BA=D1=81=D1=82?= =?UTF-8?Q?=D1=81?= =?UTF-8?Q?=D0=BF=D1=80=D0=BE=D0=B1=D0=B5=D0=BB=D0=B0=D0=BC=D0=B8?="`
When I slightly fixed function `rfc2045-q-encode-string` and get this: `"=?UTF-8?Q?=D0=A2=D0=B5=D0=BA=D1=81=D1=82=20=D1=81=20=D0=BF=D1=80=D0=BE=D0=B1=D0=B5=D0=BB=D0=B0=D0=BC=D0=B8?="`, gmail is correctly displayed subject in letter.https://gitlab.common-lisp.net/cl-smtp/cl-smtp/-/issues/3RCPT TO wrong format2019-04-09T18:24:11ZAdam KrupickaRCPT TO wrong formatHi!
In case that one tries to send a mail from an email address of the form `Name <mail@domain.com>`, cl-smtp does not work with certain SMTP servers, such as Google SMTP. This is because the address (w/ the name) is sent verbatim in th...Hi!
In case that one tries to send a mail from an email address of the form `Name <mail@domain.com>`, cl-smtp does not work with certain SMTP servers, such as Google SMTP. This is because the address (w/ the name) is sent verbatim in the `RCPT TO` command (e.g. `RCPT TO: <Name <mail@domain.com>>`), which causes the SMTP server to throw an error, complaining about invalid syntax. I fixed this by stripping the name part from the address in the `RCPT TO` command in case that it is present.
Since I can't open a pull request here, I'm attaching the patch here[cl-smtp.patch](/uploads/3e7ff14a6240173f2f65403b82cb8570/cl-smtp.patch). It makes an assumption about the email address not being malformed.
Cheers!https://gitlab.common-lisp.net/cl-smtp/cl-smtp/-/issues/5send-email returns non-NIL upon success2024-03-28T21:30:11ZDuncan Baynesend-email returns non-NIL upon successAccording to the documentation:
```
(cl-smtp:send-email host from to subject message
&key (port 25) cc bcc reply-to extra-headers html-message
authentication attachments (buffer-size 256) ssl)
Se...According to the documentation:
```
(cl-smtp:send-email host from to subject message
&key (port 25) cc bcc reply-to extra-headers html-message
authentication attachments (buffer-size 256) ssl)
Send email.
Returns nil or error with message
```
... but in practice, it's returning a non-NIL result upon success:
```
CL-USER> (cl-smtp:send-email "smtp.tpg.com.au" "duncan@example.com" "duncan@example.com" "Test" "Test")
("2.0.0 mail15.tpgi.com.au closing connection")
```https://gitlab.common-lisp.net/cl-smtp/cl-smtp/-/issues/2tests.lisp depends on asdf2018-01-04T12:32:22ZDave Coopertests.lisp depends on asdf
Hi,
As the subject indicates, `test.lisp` contains a reference to `asdf:component-pathname`. This makes it impossible to load a `cl-smtp--all-systems` fasl (as generated by `(asdf:operate 'asdf:monolithic-compile-bundle-op :cl-smtp)...
Hi,
As the subject indicates, `test.lisp` contains a reference to `asdf:component-pathname`. This makes it impossible to load a `cl-smtp--all-systems` fasl (as generated by `(asdf:operate 'asdf:monolithic-compile-bundle-op :cl-smtp)`) into an image which does not have asdf available.
As a possibly temporary workaround, i have commented `"tests"` out of the `:components` section of my `cl-smtp.asd`. But in general, tests probably don't need to be built-in by default into a production system. Perhaps the tests could be made into a static-file, or maybe broken out into their own `:cl-smtp-tests` system, and not compiled & loaded by default with the `:cl-smtp` system?
Regards,
Dave
https://gitlab.common-lisp.net/cl-smtp/cl-smtp/-/issues/6The condition #<SMTP-PROTOCOL-ERROR a command failed:2020-07-20T19:02:54ZMartin BuchmannThe condition #<SMTP-PROTOCOL-ERROR a command failed:I have an issue using `cl-smtp`. I installed it using `quicklisp` and tried to send a simple test email using my gmail account:
````
(send-email *smtp-server* *mail-user* "Martin.Buchmann@me.com" "test" "This is a test"
:aut...I have an issue using `cl-smtp`. I installed it using `quicklisp` and tried to send a simple test email using my gmail account:
````
(send-email *smtp-server* *mail-user* "Martin.Buchmann@me.com" "test" "This is a test"
:authentication '(*mail-user* *password*) :port 587 :ssl :starttls)
````
having set the variables `*smtp-server*`, `*mail-user*` and `*password*` accordingly to my data. I end up with the following error message in Slime’s debugger:
````
The condition #<SMTP-PROTOCOL-ERROR a command failed:
command: "AUTH PLAIN Kk1BSUwtVVNFUioAKk1BSUwtVVNFUioAKlBBU1NXT1JEKg==" expected: 235 response-code: 535 response-message: 5.7.8 https://support.google.com/mail/?p=BadCredentials f18sm19794471wrq.29 - gsmtp> occurred with errno: 0.
[Condition of type USOCKET:UNKNOWN-ERROR]
Restarts:
0: [RETRY] Retry SLIME interactive evaluation request.
1: [*ABORT] Return to SLIME's top level.
2: [ABORT] abort thread (#<THREAD "worker" RUNNING {1002DE18C3}>)
Backtrace:
0: (USOCKET::HANDLE-CONDITION #<SMTP-PROTOCOL-ERROR {1002E22D13}> #<USOCKET:STREAM-USOCKET {1002DF3373}> NIL)
1: (SB-KERNEL::%SIGNAL #<SMTP-PROTOCOL-ERROR {1002E22D13}>)
2: (ERROR SMTP-PROTOCOL-ERROR :COMMAND "AUTH PLAIN Kk1BSUwtVVNFUioAKk1BSUwtVVNFUioAKlBBU1NXT1JEKg==" :EXPECTED-RESPONSE-CODE 235 :RESPONSE-CODE 535 :RESPONSE-MESSAGE "5.7.8 https://support.google.com/ma..
3: (CL-SMTP::SMTP-COMMAND #<FLEXI-STREAMS:FLEXI-IO-STREAM {1002E066E3}> "AUTH PLAIN Kk1BSUwtVVNFUioAKk1BSUwtVVNFUioAKlBBU1NXT1JEKg==" 235 :CONDITION-CLASS SMTP-PROTOCOL-ERROR :CONDITION-ARGUMENTS NIL)
4: (CL-SMTP::SMTP-HANDSHAKE #<FLEXI-STREAMS:FLEXI-IO-STREAM {1002E066E3}> :AUTHENTICATION (*MAIL-USER* *PASSWORD*) :SSL :STARTTLS :LOCAL-HOSTNAME "iBuchi.fritz.box")
5: (CL-SMTP::DO-WITH-SMTP-MAIL "smtp.gmail.com" "Martin.Buchmann@googlemail.com" ("Martin.Buchmann@me.com") #<CLOSURE (LAMBDA (STREAM) :IN CL-SMTP::SEND-SMTP) {1002DF2F6B}> :PORT 587 :AUTHENTICATION (*MA..
6: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SEND-EMAIL *SMTP-SERVER* *MAIL-USER* "Martin.Buchmann@me.com" "test" "This is a test" ...) #<NULL-LEXENV>)
7: (EVAL (SEND-EMAIL *SMTP-SERVER* *MAIL-USER* "Martin.Buchmann@me.com" "test" "This is a test" ...))
8: ((LAMBDA NIL :IN SWANK:INTERACTIVE-EVAL))
9: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME interactive evaluation request." #<CLOSURE (LAMBDA NIL :IN SWANK:INTERACTIVE-EVAL) {1002DF287B}>)
10: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CLOSURE (LAMBDA NIL :IN SWANK:INTERACTIVE-EVAL) {1002DF285B}>)
11: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK:INTERACTIVE-EVAL "(send-email *smtp-server* *mail-user* \"Martin.Buchmann@me.com\" \"test\" \"This is a test\" ..)
12: (EVAL (SWANK:INTERACTIVE-EVAL "(send-email *smtp-server* *mail-user* \"Martin.Buchmann@me.com\" \"test\" \"This is a test\" ..)
13: (SWANK:EVAL-FOR-EMACS (SWANK:INTERACTIVE-EVAL "(send-email *smtp-server* *mail-user* \"Martin.Buchmann@me.com\" \"test\" \"This is a test\" ..)
14: ((LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD))
15: (SWANK/SBCL::CALL-WITH-BREAK-HOOK #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<FUNCTION (LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD) {2276193B}>)
16: ((FLET SWANK/BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/Users/Martin/quicklisp/dists/quicklisp/software/slime-v2.24/swank/sbcl.lisp") #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<FUNCTION (LAMBDA NIL :IN SWANK:..
17: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-INPUT* . #<SWANK/GRAY::SLIME-INPUT-STREAM {10046D3193}>)) #<FUNCTION (LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD) {22761BAB}>)
18: ((LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD))
19: ((FLET SB-UNIX::BODY :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE))
20: ((FLET "WITHOUT-INTERRUPTS-BODY-4" :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE))
21: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE))
22: ((FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-THREAD::CALL-WITH-MUTEX))
23: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE) {848BE7B}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THREAD "worker" ..
24: (SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE #<SB-THREAD:THREAD "worker" RUNNING {1002DE18C3}> NIL #<CLOSURE (LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD) {1002DE186B}> NIL)
25: ("foreign function: call_into_lisp")
26: ("foreign function: new_thread_trampoline")
````
I get the following debugging output:
````
"from server: 220 smtp.gmail.com ESMTP f18sm19794471wrq.29 - gsmtp"
"to server: EHLO iBuchi.fritz.box"
"from server: 250-smtp.gmail.com at your service, [89.247.253.239]"
"from server: 250-SIZE 35882577"
"from server: 250-8BITMIME"
"from server: 250-STARTTLS"
"from server: 250-ENHANCEDSTATUSCODES"
"from server: 250-PIPELINING"
"from server: 250-CHUNKING"
"from server: 250 SMTPUTF8"
"this server supports TLS"
"to server: STARTTLS"
"from server: 220 2.0.0 Ready to start TLS"
"to server: EHLO iBuchi.fritz.box"
"from server: 250-smtp.gmail.com at your service, [89.247.253.239]"
"from server: 250-SIZE 35882577"
"from server: 250-8BITMIME"
"from server: 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH"
"from server: 250-ENHANCEDSTATUSCODES"
"from server: 250-PIPELINING"
"from server: 250-CHUNKING"
"from server: 250 SMTPUTF8"
"to server: AUTH PLAIN Kk1BSUwtVVNFUioAKk1BSUwtVVNFUioAKlBBU1NXT1JEKg=="
"from server: 535-5.7.8 Username and Password not accepted. Learn more at"
"from server: 535 5.7.8 https://support.google.com/mail/?p=BadCredentials f18sm19794471wrq.29 - gsmtp"
````
I tried different settings for the `tls` keyword without any change. I also tried another mail account which gave basically the same error. What am I missing? Thanks for any hint!