[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sheflug] Re: X-Uptime and other useless headers



Richard Lowe writes:
 > * Barrie Bremner (baz [at] barriebremner.com) wrote:
 > > Richard Lowe writes:
 > > X-Uptime: 21:37:33 up 1 day,  6:52,  4 users,  load average: 0.23, 0.10, 0.02
 > > 
 > > The uptime - nice touch! Saves sticking it in the .sig. How? Is it
 > > mutt, Vim or something else?
 > 
 > Mutt.
 > 
 > send-hook  .  my_hdr X-Uptime: \`uptime\`
 > 
 > in ~/.muttrc
 > 
 > I'm sure theres a way to do it with other apps.

I've found this little lisp function in a .emacs file online, however
my lisp is as good as my x86 assembler - i.e. non-existant.

(defun add-mail-headers ()
  "Add Reply-To, X-OS, and X-Uptime mail headers."
  (let ((maillist '("linux-geek@sfu.ca"))
	to)
    (save-excursion
      (goto-char (point-min))
      (setq to (mail-header 'to (mail-header-extract)))
      (if (member to maillist)
	  (message-add-header (concat "Reply-To: " to)))))
  (message-add-header
   (concat "X-OS: "
	   (substring (shell-command-to-string "uname -a") 0 -1))
   (concat "X-Uptime: "
	   (substring (shell-command-to-string "uptime") 0 -1))))
(add-hook 'message-send-hook 'add-mail-headers)

Anyone know how to use the 
   (concat "X-Uptime: "
	   (substring (shell-command-to-string "uptime") 0 -1))))

section properly as an extra header?

Cheers.

Baz.

-- 
Barrie J. Bremner

email: baz at barriebremner.com | OpenPGP ID: 5164F553

http://barriebremner.com/
[Contact information available at website]

   "Linux? Is that some kind of MacOS?"
      -- BT technical support

---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.