[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gcc is ignored when sending mail from emacs lisp
From: |
W. Greenhouse |
Subject: |
Re: Gcc is ignored when sending mail from emacs lisp |
Date: |
Sat, 11 May 2013 19:39:44 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Hi Alexander,
Alexander Baier <lexi.baier@gmail.com> writes:
> Hello,
>
> I want to sent mail from emacs lisp code, but the given Gcc-field is not
> considered by the send function and thus no mail is put into my "Sent
> Items" Group/Folder. When I send a mail from within gnus, everything
> works out fine. This is the relevant code:
>
> Sending mail from outside gnus:
> (defun org-tut-send-mail ()
> (message-mail "my.email@foo.com"
> "[ELISP-TEST] Test"
> '(("From" . "my.email@foo.com")
> ("Gcc" . "nnimap+imap.server.com:\"Sent Items\"")))
> (insert "SOME TEXT")
> (message-send-and-exit))
>
> The above snippet sends the Email just fine, but nothing gets stored in
> my Sent Items group.
>
> Can anybody give me some pointers on this?
>
> PS: If you need further information, name it and I will gladly provide
> it.
Is Gnus up and running during the evaluation of this function? Although
Message is a [sort of] free-standing library rather than just a part of
Gnus, the capabilities of message-mode, especially with regard to the
Gcc: header, depend on whether Gnus is active at the time of evaluation
or not.
When Gnus is down, message-mode can't do fancy things with sent mail,
like uploading it to an IMAP folder as in your example. I wouldn't be
surprised if your sent mail from this function is ending up inside
`message-directory', probably in the default monthly archive file,
e.g. "~/Mail/archive/sent/2013-05".
If you want your function to always honor Gcc: headers even if they
point to something like an IMAP folder or other group that requires
Gnus's capabilities to use, your function should check the return value
of (gnus-alive-p) to see if Gnus is running, and possibly activate it
before continuing.
--
BOFH excuse #292:
We ran out of dial tone and we're and waiting for the phone company to
deliver another bottle.