From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/16279 Path: news.gmane.org!not-for-mail From: Alexander Baier Newsgroups: gmane.emacs.gnus.user Subject: Re: Gcc is ignored when sending mail from emacs lisp Date: Mon, 13 May 2013 12:59:55 +0200 Message-ID: <8761ynb0wk.fsf@student.kit.edu> References: <87fvxvvtp7.fsf@gmail.com> <87zjw1nw5b.fsf@riseup.net> 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 1368464414 1415 80.91.229.3 (13 May 2013 17:00:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 May 2013 17:00:14 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Mon May 13 19:00:14 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 1Ubw6f-0000Up-Nz for gegu-info-gnus-english@m.gmane.org; Mon, 13 May 2013 19:00:13 +0200 Original-Received: from localhost ([::1]:35209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ubw6f-0003Je-E0 for gegu-info-gnus-english@m.gmane.org; Mon, 13 May 2013 13:00:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbqTl-0005ky-I1 for info-gnus-english@gnu.org; Mon, 13 May 2013 06:59:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UbqTj-0002C2-Qk for info-gnus-english@gnu.org; Mon, 13 May 2013 06:59:41 -0400 Original-Received: from mail-ea0-x236.google.com ([2a00:1450:4013:c01::236]:46006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbqTj-0002Bs-GD for info-gnus-english@gnu.org; Mon, 13 May 2013 06:59:39 -0400 Original-Received: by mail-ea0-f182.google.com with SMTP id r16so191150ead.13 for ; Mon, 13 May 2013 03:59:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:references:cancel-lock:date:message-id :mime-version:content-type; bh=aFN6o3YfXhiN3AXZPwYZt7QIiO+T0lYi/r4uuRpY27c=; b=nJecOKY/MWDtURSDmqqb5iDknoFh6hHyntvuaAZqM1P7x1lz99fqt2bGiOc2ELcpHM XvBV2yv4LH4P81UFiFxPnmIZEGOhbFa+PQhCMmB+atEFwp89MWmYs4fBv/BtueBqLMnr /b4VCdA56KT0o43OGdGoj8yduRgXc5+QKhYshaVudlR2vczY0Azx6ukjEc/QLLPWxAmK yp9b3LLAhFpzFIgmqv2MdIjJKg/bsJKhR8jT++9i7aQjEqHBgd4BfP8ADs/3d0htEU4e RlPgi3gaSVmCVRaVOjX5NfR6CQSsMwKYOpoHwrLzN8C1+Vy/IjoE2WUdPkRNbwD3ugpI zOMw== X-Received: by 10.15.82.201 with SMTP id a49mr77603186eez.44.1368442778193; Mon, 13 May 2013 03:59:38 -0700 (PDT) Original-Received: from T420s (nat-wh-wh36.rz.uni-karlsruhe.de. [141.70.81.154]) by mx.google.com with ESMTPSA id i3sm22160477eev.1.2013.05.13.03.59.37 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 13 May 2013 03:59:37 -0700 (PDT) Cancel-Lock: sha1:k0VSJhDXt+Nsg/aiEEucGh2tvlk= X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::236 X-Mailman-Approved-At: Mon, 13 May 2013 13:00:11 -0400 X-BeenThere: info-gnus-english@gnu.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@gnu.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:16279 Archived-At: Hello W. Greenhouse, thank you for your fast reply! wgreenhouse-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org (W. Greenhouse) writes: > 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". > They do not seem to end up in any local group on my disk. > 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. I changed my code to something like this: --8<---------------cut here---------------start------------->8--- (defun org-tut-send-mail () (if (gnus-alive-p) (progn (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)) (message "Could not send mail, gnus is not alive."))) --8<---------------cut here---------------end--------------->8--- (gnus-alive-p) returnes t, which is correct, as I have a running instance of gnus. The results however are the save as with no running gnus, still no Mail in my Sent Items folder. Is there any log that would provide useful information? Regards, Alex