Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: info-gnus-english@gnu.org
Subject: Re: Multiple sources and accounts with GNUS
Date: Mon, 20 Dec 2010 21:44:23 +0100	[thread overview]
Message-ID: <87vd2ow4wo.fsf@member.fsf.org> (raw)
In-Reply-To: <87r5dco6vm.fsf@savara.sat.thregr.org>

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	other threads:[~2010-12-20 20:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-20 14:29 Yuri D'Elia
2010-12-20 20:44 ` Tassilo Horn [this message]
2010-12-20 22:24 ` Joseph Gay
     [not found] ` <mailman.0.1292877887.26867.info-gnus-english@gnu.org>
2010-12-21 14:20   ` Stephen Leake
2010-12-21 16:22     ` Tassilo Horn
     [not found] <mailman.7.1292862320.13743.info-gnus-english@gnu.org>
2010-12-20 16:42 ` Richard Riley
2010-12-21 19:14   ` Yuri D'Elia
2010-12-21 19:49     ` Tassilo Horn
2010-12-22 11:25       ` Yuri D'Elia
2010-12-22 12:21         ` Tassilo Horn
2010-12-22 17:39           ` Yuri D'Elia
2010-12-23  8:22             ` Alberto Luaces
2010-12-23  8:35             ` Tassilo Horn
     [not found]           ` <mailman.3.1293039604.895.info-gnus-english@gnu.org>
2011-01-02  7:50             ` Lars Magne Ingebrigtsen
     [not found]   ` <mailman.7.1292958880.30697.info-gnus-english@gnu.org>
2010-12-22 13:58     ` Richard Riley

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=87vd2ow4wo.fsf@member.fsf.org \
    --to=tassilo@member.fsf.org \
    --cc=info-gnus-english@gnu.org \
    /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).