From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/14343 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.gnus.user Subject: Re: Multiple sources and accounts with GNUS Date: Mon, 20 Dec 2010 21:44:23 +0100 Message-ID: <87vd2ow4wo.fsf@member.fsf.org> References: <87r5dco6vm.fsf@savara.sat.thregr.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1292878235 590 80.91.229.12 (20 Dec 2010 20:50:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 20 Dec 2010 20:50:35 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Mon Dec 20 21:50:30 2010 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PUmgb-0007By-CB for gegu-info-gnus-english@m.gmane.org; Mon, 20 Dec 2010 21:50:25 +0100 Original-Received: from localhost ([127.0.0.1]:34490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUmbA-00052E-Qu for gegu-info-gnus-english@m.gmane.org; Mon, 20 Dec 2010 15:44:48 -0500 Original-Received: from [140.186.70.92] (port=39285 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUmb8-00051x-5h for info-gnus-english@gnu.org; Mon, 20 Dec 2010 15:44:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PUmb6-0007gp-3U for info-gnus-english@gnu.org; Mon, 20 Dec 2010 15:44:46 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:56271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PUmb5-0007gc-R9 for info-gnus-english@gnu.org; Mon, 20 Dec 2010 15:44:44 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PUmb4-0004eL-2f for info-gnus-english@gnu.org; Mon, 20 Dec 2010 21:44:42 +0100 Original-Received: from 95-88-32-105-dynip.superkabel.de ([95.88.32.105]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 Dec 2010 21:44:42 +0100 Original-Received: from tassilo by 95-88-32-105-dynip.superkabel.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 Dec 2010 21:44:42 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 48 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 95-88-32-105-dynip.superkabel.de User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:aezgeOFwFNGoVTejeSjlaV8uNjg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:14343 Archived-At: Yuri D'Elia 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