From 9411ff869e642f0cc14bfd199c23a32b5f97c6fc Mon Sep 17 00:00:00 2001 From: tfheen Date: Sat, 31 Oct 2009 15:38:13 +0000 Subject: [PATCH] Redo how qurzaw does personalities. Use stunnel rather than openssl, which gives us cert checking. git-svn-id: file:///svn/tfheen/trunk/dotfiles@1411 8da78d58-1cd3-0310-bee5-d77bd1b3e8bf --- gnus | 68 +++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 19 deletions(-) diff --git a/gnus b/gnus index 4daccaa..ea166a7 100644 --- a/gnus +++ b/gnus @@ -26,17 +26,15 @@ (nnimap-address "vuizook.err.no") (nnimap-stream gssapi) (nnimap-authenticator gssapi)))) - (cw/for-host "thosu" (setq gnus-select-method '(nnimap "err" - (nnimap-stream shell))) - (setq imap-shell-program - '("ssh -ax -C -oBatchMode=yes vuizook.err.no 'exec env MAIL_PLUGINS=crm114 MAIL_PLUGIN_DIR=/usr/lib/dovecot/modules/imap MAIL=$HOME/Maildir /usr/lib/dovecot/imap'") - nntp-rlogin-program "ssh")) - + (nnimap-stream shell)))) -(setq imap-gssapi-program '("imtest -m gssapi -u %l -s %s")) +(setq imap-shell-program + '("ssh -ax -C -oBatchMode=yes vuizook.err.no 'exec env MAIL_PLUGINS=crm114 MAIL_PLUGIN_DIR=/usr/lib/dovecot/modules/imap MAIL=$HOME/Maildir /usr/lib/dovecot/imap'") + imap-gssapi-program '("imtest -m gssapi -u %l -s %s") + nntp-rlogin-program "ssh") (cw/for-host "yiwaz\\|arabella" ; (setq gnus-select-method '(nntp "localhost") @@ -78,12 +76,16 @@ (nnimap-server-port 993) (nnimap-stream ssl) (nnimap-authinfo-file "~/.imap-authinfo.gpg"))) + (add-to-list 'gnus-secondary-select-methods '(nnimap "Collabora" + (nnimap-address "mail.collabora.co.uk") + (nnimap-server-port 993) + (nnimap-stream ssl) + (nnimap-authinfo-file "~/.imap-authinfo.gpg"))) (add-to-list 'gnus-secondary-select-methods '(nnimap "mail.err.no" - (nnimap-stream shell))) + (nnimap-stream shell)))) + - (setq imap-shell-program - '("ssh -ax -C -oBatchMode=yes vuizook.err.no 'exec env MAIL=$HOME/Maildir /usr/lib/dovecot/imap'") - nntp-rlogin-program "ssh")) +(setq imap-ssl-program "stunnel -c -A ~/.cacerts.pem -v 2 -f -r %s:%p") (cw/for-host "vawad" (setq gnus-select-method '(nnimap "raw" @@ -391,20 +393,48 @@ inserts \" characters." (car x) nil)) (tfheen-get-recipients-parsed) ", ")))) +(defun tfheen-qurzaw-personality-mode () + "Return a string describing the personality mode we are in" + (let ((mode "err.no")) + (if (string-match "qurzaw" system-name) + (progn + (if (string-match "Collabora" (second (tfheen-gnus-get-current-select-method))) + (setq mode "Collabora")) + (if (string-match "linpro" (second (tfheen-gnus-get-current-select-method))) + (setq mode "RL")))) + mode)) + +(defun tfheen-qurzaw-rl-p () + "Return t if we should be in Redpill Linpro mode, nil otherwise" + (and (string-match "qurzaw" system-name) (not (string-match "err\\.no" (second (tfheen-gnus-get-current-select-method)))) t)) + +(defun tfheen-gnus-get-current-select-method () + "Return the select method of the summary buffer as defined by gnus-summary-buffer" + (save-excursion + (if (buffer-live-p gnus-summary-buffer) + (set-buffer gnus-summary-buffer)) + gnus-current-select-method)) + (setq gnus-posting-styles '( ; Default-verdier (".*" - (address (if (string-match "qurzaw" system-name) "tfheen@redpill-linpro.com" "tfheen@err.no")) + (address (cond + ((equal (tfheen-qurzaw-personality-mode) "RL") "tfheen@redpill-linpro.com") + ((equal (tfheen-qurzaw-personality-mode) "Collabora") "tollef.fog.heen@collabora.co.uk") + (t "tfheen@err.no"))) ; (Organization "Private") - (Bcc (if (string-match "qurzaw" system-name) - (concat "tfheen+outgoing" (char-to-string 64) "redpill-linpro.com") - (concat "tfheen+outgoing" (char-to-string 64) "err.no"))) - - (signature-file (if (file-exists-p (expand-file-name (concat "~/.signature-" system-name))) - (expand-file-name (concat "~/.signature-" system-name)) - "~/.signature"))) + (Bcc (concat "tfheen+outgoing" (char-to-string 64) + (cond + ((equal (tfheen-qurzaw-personality-mode) "RL") "redpill-linpro.com") + ((equal (tfheen-qurzaw-personality-mode) "Collabora") "collabora.co.uk") + (t "err.no")))) + + (signature-file (cond + ((equal (tfheen-qurzaw-personality-mode) "RL") "~/.signature-rl") + ((equal (tfheen-qurzaw-personality-mode) "Collabora") "~/.signature-collabora") + (t "~/.signature")))) ;; Du vil sikkert ha mer her enn det følgende: ("drift.news.nag.submissions" ;; Antar at man får moderator-mail hit -- 2.39.5