info-gnus-english
[Top][All Lists]
Advanced

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

Re: Multiple sources and accounts with GNUS


From: Tassilo Horn
Subject: Re: Multiple sources and accounts with GNUS
Date: Mon, 20 Dec 2010 21:44:23 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Yuri D'Elia <wavexx@users.sf.net> writes:

Hi Yuri,

> Could I use 'gnus-parameters' for that, and change
> 'message-send-mail-function' depending on the group?

I guess, that would be one way, at least as long as you start writing
your mail inside some summary buffer and thus gnus parameters apply.

Maybe you can come up with something more lightweight.  For example, I
choose the smtp server based on the network I'm connected to.  From
externally, my university's smtp doesn't allow sending mail with a
different From than that of a university accounts, and inside the
university, the smtp port is locked (not sure if that's still true, but
anyway).

Deciding if I'm connected to the university's network is easy, because
there I get an IP starting with 141.26, so here's my code.

--8<---------------cut here---------------start------------->8---
(defun th-uni-network-p ()
  "Return non-nil, if the computer is connected to the uni network."
  (catch 'in-uni-network
    (dolist (net (network-interface-list))
      (let* ((iface (car net))
             (addr (car (network-interface-info iface))))
        (when (and (= 141 (elt addr 0))
                   (= 26  (elt addr 1)))
          (throw 'in-uni-network t))))))

(setq send-mail-function         'smtpmail-send-it
      message-send-mail-function 'message-smtpmail-send-it
      smtpmail-debug-info        t
      smtpmail-smtp-server       (if (th-uni-network-p)
                                     "deliver.uni-koblenz.de"
                                   "mail.messagingengine.com"))
--8<---------------cut here---------------end--------------->8---

So I use the uni smtp inside the university, and in all other cases I
use the smtp of my fastmail account.

WRT to Richards suggestion on using msmtp, you probably can do the same
without external dependency by setting `smtpmail-smtp-server'
appropriately in `message-send-hook'.

HTH,
Tassilo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]