From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/15806 Path: news.gmane.org!not-for-mail From: Abramov Aleksey Newsgroups: gmane.emacs.gnus.user Subject: Re: Replace, insert or append Bcc header based on Subject field. Date: Tue, 11 Sep 2012 20:44:58 +0400 Message-ID: <86r4q8ik51.fsf@smart.skytel.spb.ru> References: 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 1347381911 13786 80.91.229.3 (11 Sep 2012 16:45:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Sep 2012 16:45:11 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Tue Sep 11 18:45:14 2012 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 1TBTaH-0001Z6-1y for gegu-info-gnus-english@m.gmane.org; Tue, 11 Sep 2012 18:45:09 +0200 Original-Received: from localhost ([::1]:39699 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBTaD-0006z8-HK for gegu-info-gnus-english@m.gmane.org; Tue, 11 Sep 2012 12:45:05 -0400 Original-Path: usenet.stanford.edu!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Tue, 11 Sep 2012 11:40:14 -0500 Original-Newsgroups: gnu.emacs.gnus User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (berkeley-unix) Cancel-Lock: sha1:d9fofSU/GewI7QlXQE/22UqGR+A= Original-Lines: 50 X-Usenet-Provider: http://www.giganews.com Original-X-Trace: sv3-vYr+gkaEG4MaZXMnzxBO087f1BW838ZiEDy4vO7CwUenMfbjFX0Qhin0M6VKGesEzIQtA+x7nCf3WPW!RRRDa5fWsx0Xvxb8R+pfFx8ZeuspUFY/e3Iuk6C24FSBvdnzx9IwCpbM2Ybvt2xe Original-X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2946 Original-Xref: usenet.stanford.edu gnu.emacs.gnus:86891 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:15806 Archived-At: Lars Ingebrigtsen writes: > Abramov Aleksey writes: > >> ((header "Subject" "Ticket#") >> (bcc (concat >> (gnus-with-article-buffer >> (mail-fetch-field "bcc" nil t)) " ," >> (bbdb-full-address "support@my.domain.ru")))))) >> Where is my mistake? Any suggestions are welcome. > > Is there really a Bcc header in the article buffer? That's kinda > surprising, since the point of the Bcc header is that it's "blind", > i.e., it's never seen by the recipient. No, there should be no one bcc header in the original article. Bcc header have to be set by myself twice. And at the second time it ?have? to be found by `mail-fetch-field'. But in any case, this is my solution to my problem: #+begin_src emacs-lisp (setq gnus-posting-styles '((".*" (name "Abramov Aleksey") (address "levenson@mmer.org") (signature "Sincerely,\nAbramov Aleksey.")) ("^nnimap\\+aabramov" (name "Aleksey Abramov") (address "Aleksey Abramov ") (organization "Skytel") (bcc (bbdb-full-address "a.abramov@my.domain.ru")) (signature-file "~/emacs-config/mail-signature.work")) ("^nnimap\\+localhost" (address "alex@smart.my.domain.ru")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Header replacement (to (with-current-buffer gnus-article-buffer (if (string-match "otrs@otrs.my.domain.ru" (message-fetch-field "from")) "support@my.domain.ru" (message-fetch-field "from")))) (bcc (with-current-buffer gnus-article-buffer (if (string-match "otrs@otrs.my.domain.ru" (message-fetch-field "from")) "a.abramov@my.domain.ru" (format "%s, %s" "a.abramov@my.domain.ru" "support@my.domain.ru")))))) #+end_src -- Sincerely, Abramov Aleksey.