Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Automatically selecting an SMTP server.
@ 2004-06-08 12:53 Oliver Jennrich
  2004-06-08 13:38 ` Jesper Harder
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Jennrich @ 2004-06-08 12:53 UTC (permalink / raw)



My computer is a laptop and is therefore used in changing
IT environments - most notably the address or name of the SMTP server
that is used at a particular location. 

Is there an easy way to automatically configure the right server,
maybe based on IP-addresses?

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. 

Any ideas?

-- 
Space - the final frontier


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Automatically selecting an SMTP server.
  2004-06-08 12:53 Automatically selecting an SMTP server Oliver Jennrich
@ 2004-06-08 13:38 ` Jesper Harder
  0 siblings, 0 replies; 2+ messages in thread
From: Jesper Harder @ 2004-06-08 13:38 UTC (permalink / raw)


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/>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-06-08 13:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-08 12:53 Automatically selecting an SMTP server Oliver Jennrich
2004-06-08 13:38 ` Jesper Harder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).