Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Abramov Aleksey <levenson@mmer.org>
To: info-gnus-english@gnu.org
Subject: Re: Replace, insert or append Bcc header based on Subject field.
Date: Tue, 11 Sep 2012 20:44:58 +0400	[thread overview]
Message-ID: <86r4q8ik51.fsf@smart.skytel.spb.ru> (raw)
In-Reply-To: <mailman.8108.1346854652.855.info-gnus-english@gnu.org>

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Abramov Aleksey <levenson@mmer.org> 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 <a.abramov@my.domain.ru>")
	 (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.

  parent reply	other threads:[~2012-09-11 16:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.7249.1345398011.855.info-gnus-english@gnu.org>
2012-09-05 14:16 ` Lars Ingebrigtsen
     [not found] ` <mailman.8108.1346854652.855.info-gnus-english@gnu.org>
2012-09-11 16:44   ` Abramov Aleksey [this message]
2012-08-19 17:35 Abramov Aleksey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86r4q8ik51.fsf@smart.skytel.spb.ru \
    --to=levenson@mmer.org \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).