[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Automatically selecting an SMTP server.
From: |
Jesper Harder |
Subject: |
Re: Automatically selecting an SMTP server. |
Date: |
Tue, 29 Jun 2004 17:39:18 -0000 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) |
Oliver Jennrich <oliver.jennrich@gmx.net> writes:
> I was thinking along the lines of abusing message-send-hook, but I
> have no idea how to find the current IP-number in lisp.
I think there is a way in the development version of Emacs now. That
doesn't help you since you'r using XEmacs.
But if Lisp doesn't provide it, then you need to figure out some
external command to run. I use the following to get the current IP
of my box:
(defun smtpmail-fqdn ()
(let ((str (shell-command-to-string "/sbin/ifconfig ppp0")))
(if (string-match "inet addr:\\([^ ]+\\) " str)
(concat "[" (match-string-no-properties 1 str) "]")
(system-name))))
You need a different command if you're not using PPP and GNU/Linux, of
course.
--
Jesper Harder <http://purl.org/harder/>