From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/16276 Path: news.gmane.org!not-for-mail From: wgreenhouse-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org (W. Greenhouse) Newsgroups: gmane.emacs.gnus.user Subject: Re: Gcc is ignored when sending mail from emacs lisp Date: Sat, 11 May 2013 19:39:44 +0000 Message-ID: <87zjw1nw5b.fsf@riseup.net> References: <87fvxvvtp7.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1368301213 5156 80.91.229.3 (11 May 2013 19:40:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 May 2013 19:40:13 +0000 (UTC) To: info-gnus-english-mXXj517/zsQ@public.gmane.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org-mXXj517/zsQ@public.gmane.org Sat May 11 21:40:13 2013 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UbFeP-0006bZ-70 for gegu-info-gnus-english@m.gmane.org; Sat, 11 May 2013 21:40:13 +0200 Original-Received: from localhost ([::1]:50131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbFeO-0008TM-SL for gegu-info-gnus-english@m.gmane.org; Sat, 11 May 2013 15:40:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbFeJ-0008N5-KA for info-gnus-english-mXXj517/zsQ@public.gmane.org; Sat, 11 May 2013 15:40:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UbFeF-0005YQ-FK for info-gnus-english-mXXj517/zsQ@public.gmane.org; Sat, 11 May 2013 15:40:07 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:37281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbFeF-0005U9-9p for info-gnus-english-mXXj517/zsQ@public.gmane.org; Sat, 11 May 2013 15:40:03 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UbFeD-0006SU-GJ for info-gnus-english-mXXj517/zsQ@public.gmane.org; Sat, 11 May 2013 21:40:01 +0200 Original-Received: from tor27.anonymizer.ccc.de ([77.244.254.227]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 11 May 2013 21:40:01 +0200 Original-Received: from wgreenhouse by tor27.anonymizer.ccc.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 11 May 2013 21:40:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 51 Original-X-Complaints-To: usenet-dbVV3NMTNubNLxjTenLetw@public.gmane.org X-Gmane-NNTP-Posting-Host: tor27.anonymizer.ccc.de X-Archive: encrypt User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:GHKkAzhvtAX3ykBX02cuN6qyDa0= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: info-gnus-english-mXXj517/zsQ@public.gmane.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org-mXXj517/zsQ@public.gmane.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.gnus.user:16276 Archived-At: Hi Alexander, Alexander Baier 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-+LBmYUDmh58@public.gmane.org" > "[ELISP-TEST] Test" > '(("From" . "my.email-+LBmYUDmh58@public.gmane.org") > ("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.