When I post to a mailing list, I always have to use the same e-mail
address. As a real programmer I am lazy and do not like to do what can
be done by the computer. For this I made the code below.

There is one problem. The sequence of the fields is changed. Normally it
is:
    To:
    Subject:
    From:
    Gcc:
With my code it becomes:
    Subject:
    From:
    Gcc:
    To:

Can I do something about this?

Let me know if the code could be optimised.

    (defvar gnus-to-addresses nil
    "A list of group names and to-addesses to use;")
    (setq   gnus-to-addresses  '(
        ("INBOX\\.Info\\.bbdb"         . "bbdb-i...@lists.sourceforge.net")
        ("INBOX\\.Info\\.clisp"        . "clisp-l...@lists.sourceforge.net")
        ("INBOX\\.Info\\.ffmpeg"       . "ffmpeg-u...@mplayerhq.hu")
        ("INBOX\\.Info.\\Floss"        . "fl...@vrijschrift.nl")
        ("INBOX\\.Info\\.OpenOffice"   . "gebruik...@nl.openoffice.org")
        ("INBOX\\.Info\\.openSUSE"     . "opensuse-fact...@opensuse.org")
        ("INBOX\\.Info\\.org-mode"     . "emacs-orgm...@gnu.org")
        ("INBOX\\.Info\\.slime"        . "slime-de...@common-lisp.net")
        ("INBOX\\.Info\\.spamassassin" . "us...@spamassassin.apache.org")
        ("INBOX\\.KDE"                 . "kde-i18n...@kde.org")
        ("INBOX\\.NLLGG\\.Leden"       . "stamta...@lists.nllgg.nl")
        ("INBOX\\.NLLGG\\.Linux"       . "li...@lists.nllgg.nl")
        ("INBOX\\.NLLGG\\.Starter"     . "linux-star...@lists.nllgg.nl")
        ))

    (defun gnus-set-to-address ()
      "Determine what to-address to use on the current message;"
      (let ((to-address ""))
        (if (message-news-p)
            (setq to-address nil)
          (when gnus-newsgroup-name
            (dolist (item gnus-to-addresses)
              (when (string-match (car item) gnus-newsgroup-name)
                (setq to-address (cdr item))))))
        to-address))

    ;; Posting Styles To Various Groups
    (setq gnus-posting-styles
          '((".*"
             (to (gnus-set-to-address))

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
http://lists.gnu.org/mailman/listinfo/info-gnus-english

Reply via email to