bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rcd-mail.el Emacs package for GNU Mailutils "mail"


From: Jean Louis
Subject: Re: rcd-mail.el Emacs package for GNU Mailutils "mail"
Date: Sat, 5 Jun 2021 18:21:00 +0300
User-agent: Mutt/2.0.7+183 (3d24855) (2021-05-28)

* Sergey Poznyakoff <gray@gnu.org.ua> [2021-06-05 17:42]:
> Hi Jean,
> 
> > I am using rcd-mail.el package as bindings to GNU Mailutils "mail"
> > program for quite some time.
> > 
> > https://hyperscope.link/3/8/3/0/3/rcd-mail-el-GNU-Mailutils-mail-program.html
> 
> Thanks for the heads up.  That looks promising.
> 
> > Improvements are welcome, especially I have not found a solution to
> > use comma in email addresses, and I did tried quoting in various
> > ways. 
> 
> Can you describe me the exact usecase?  What kind of email addresses you
> have difficulties using?

Like this:

name = "Dan, III"

email = "some@example.com"

I am using this function and simply replacing comma with space (which
is incorrect):

(defun rcd-mailutils-mail-to (to-email &optional to-name)
  "Return list with \"mail\" program arguments with TO-EMAIL.

Optionally provide TO-NAME, the name of recipient of email."
  (let ((to-name (replace-regexp-in-string "," " " to-name)))
    (cond ((and (stringp to-name) (string-match "@" to-name)) (list to-email))
          ((not (seq-empty-p to-name)) (list (concat (rcd-rfc2047-encode 
to-name) " <" to-email ">")))
          (t (list to-email)))))

(setq to-name "Dan, III")
(setq to-email "some@example.com")
(concat (rcd-rfc2047-encode to-name) " <" to-email ">") ⇒ "=?utf-8?Q?Dan,_III?= 
<some@example.com>"

That email address will be later expanded to 2 email addresses when
given to sendmail, so anything after comma or before comma, becomes a
new email address with local hostname as sender.

I have tried this, but did not result well, same thing:

(concat "\"" (rcd-rfc2047-encode to-name) "\"" " <" to-email ">") ⇒ 
"\"=?utf-8?Q?Dan,_III?=\" <some@example.com>"



Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]