Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Jesper Harder <harder@myrealbox.com>
Subject: Re: Automatically selecting an SMTP server.
Date: Tue, 08 Jun 2004 15:38:41 +0200	[thread overview]
Message-ID: <m3hdtm41b2.fsf@defun.localdomain> (raw)
In-Reply-To: <817juinrc9.fsf@ID-371.user.uni-berlin.de>

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


      reply	other threads:[~2004-06-08 13:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-08 12:53 Oliver Jennrich
2004-06-08 13:38 ` Jesper Harder [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3hdtm41b2.fsf@defun.localdomain \
    --to=harder@myrealbox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).