Hi everyone. I have problems with `gnus-posting-styles' matching.

Please look what I need to do:

1. I always add Bcc to myself to build a nice threads in my email
account.  

2. We use OTRS system, so there are a lot of mail with Ticket#XXXX, when
I reply on it I'd like to add an additional Bcc header to and send it to
our OTRS system [email protected] email account.

3. OTRS notification comes from another email, I have to replace it
by previously mentioned [email protected] email.

So here is my `gnus-posting-styles'. As it mentioned in manual

,----[ (info "(gnus)Posting Styles") ]
| Each style will be applicable if the first element
| "matches", in some form or other.  The entire alist will be iterated
| over, from the beginning towards the end, and each match will be
| applied, which means that attributes in later styles that match override
| the same attributes in earlier matching styles.  So
`----

So it have to set bcc header for my first group match
"^nnimap\\+aabramov", and after that additional bcc have to be join by
header match. But mail-fetch-field returns nil, and bcc header contains
"nil, .....".

--8<---------------cut here---------------start------------->8---
(defun bbdb-full-address (mail)
  (let ((record (first (bbdb-search  (bbdb-records) nil nil mail))))
    (if (vectorp  record)
        (format "%s <%s>" (bbdb-record-name record)
                (car (bbdb-record-mail record)))
      nil)))

(setq gnus-posting-styles
      '((".*"
         (name "Abramov Aleksey")
         (address "[email protected]")
         (signature "Sincerely,\nAbramov Aleksey."))
        ("^nnimap\\+aabramov"
         (name "Aleksey Abramov")
         (address "Aleksey Abramov <[email protected]>")
         (organization "Skytel")
         (bcc (bbdb-full-address "[email protected]"))
         (signature-file "~/emacs-config/mail-signature.work"))
        ("^nnimap\\+localhost"
         (address "[email protected]"))
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
        ;; Header replacement
        ((header "From" "[email protected]")
         (to (bbdb-full-address "[email protected]")))
        ((header "Subject" "Ticket#")
         (bcc (concat
               (gnus-with-article-buffer
                 (mail-fetch-field "bcc" nil t)) " ,"
               (bbdb-full-address "[email protected]"))))))
--8<---------------cut here---------------end--------------->8---

Where is my mistake? Any suggestions are welcome.

-- 
Sincerely,
Abramov Aleksey.


_______________________________________________
info-gnus-english mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/info-gnus-english

Reply via email to