From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/9492 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.gnus.user Subject: Re: changing smtp server? Date: Fri, 10 Aug 2007 21:37:50 +0200 Message-ID: <87vebnb2pd.fsf@baldur.tsdh.de> References: <1186767086.955240.181340@d30g2000prg.googlegroups.com> <878x8jxoke.fsf@topper.koldfront.dk> <1186768754.927751.57230@z24g2000prh.googlegroups.com> <874pj7xnzx.fsf@topper.koldfront.dk> <1186770147.837979.152700@x35g2000prf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1186774703 3989 80.91.229.12 (10 Aug 2007 19:38:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Aug 2007 19:38:23 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Fri Aug 10 21:38:21 2007 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.50) id 1IJaJN-0003vV-E6 for gegu-info-gnus-english@m.gmane.org; Fri, 10 Aug 2007 21:38:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IJaJM-0006MA-Vp for gegu-info-gnus-english@m.gmane.org; Fri, 10 Aug 2007 15:38:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IJaJH-0006Hr-GZ for info-gnus-english@gnu.org; Fri, 10 Aug 2007 15:38:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IJaJG-0006HA-K3 for info-gnus-english@gnu.org; Fri, 10 Aug 2007 15:38:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IJaJG-0006H0-Gh for info-gnus-english@gnu.org; Fri, 10 Aug 2007 15:38:10 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IJaJG-0008Ab-0w for info-gnus-english@gnu.org; Fri, 10 Aug 2007 15:38:10 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IJaJ7-0004UB-LZ for info-gnus-english@gnu.org; Fri, 10 Aug 2007 21:38:01 +0200 Original-Received: from dslb-084-063-004-159.pools.arcor-ip.net ([84.63.4.159]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Aug 2007 21:38:01 +0200 Original-Received: from tassilo by dslb-084-063-004-159.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Aug 2007 21:38:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 53 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: dslb-084-063-004-159.pools.arcor-ip.net Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEUSEQ9eW1Dkxz/6+fjQ w52JeEi7Imd/AAAACXBIWXMAAAsSAAALEgHS3X78AAAATnRFWHRSYXcgcHJvZmlsZSB0eXBlIGV4 aWYACmV4aWYKICAgICAgMjAKNDU3ODY5NjYwMDAwNGQ0ZDAwMmEwMDAwMDAwODAwMDAwMDAwMDAw MAqJuBZbAAAACXZwQWcAAAAwAAAAMADO7oxXAAABk0lEQVQ4y32TS3KDMAxAxQB7uyEHiGvvoSh7 sMSeJnD/q9Q/DBmYamNZz/oioM8ySkn7DbL2bHiUV+CODTflGXTSC5xBWwRAJzBAkPIEhLMWANUZ 3ETRt1CcAbcVdhdgmMZq5CsPsS6iufJ4EY7rFVg0WwNwblA5+Q/QCbADtLeewUxKcT/n1g8x0UVp c5Lt7Op4ANw+wfwOB+YxJoA5wlZXMnSwT788gmEbhUtSHMFWPuEnwK0WD6IOKUDISIckkFYk+KWl qHYgUvGIOKYkEeQJEQ5H0EETrERIbWoxgTLmQCLvsQNRhpqQELvmF3Kop17Ce+yJf6WsM7D8CMNF 7pcZoN5C4cLWlUXsiHY5bAKsmXn2c2BCPYkGI0BtHTGFrxX5RUz8jkBZ1tqKt8vOrC1bNgk4M6v5 5jyYvzQrtjqCICN7+8hWaaXNAahvwn66R92QA88ENCPPCSze4ycBI6WQdVBXOoYy/ndeN3tocH35 68MDH8os26zQGHd/+XcYE+xbMpk1LuC0mo9NdANOX10n5Q8J6syYNMm6EgAAABp6VFh0anBlZzpj b2xvcnNwYWNlAAB42jMCAAAzADOJOCM1AAAAJnpUWHRqcGVnOnNhbXBsaW5nLWZhY3RvcgAAeNoz qjDSMawwBGEAEYMC6T2XL08AAAAASUVORK5CYII= User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:pRY/G47raCOXW0Mtvn4SB2gIX1Y= X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) 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:9492 Archived-At: someusernamehere writes: > (defun fs-change-smtp () > "Change the SMTP server according to the current from line." > (save-excursion > (let ((from > (save-restriction > (message-narrow-to-headers) > (message-fetch-field "from")))) > (message "From is `%s', setting `smtpmail-smtp-server' to `%s'" > from > (cond > ((string-match "f...@bar.org" from) > ;; Use stmp-auth > (message "Using smtp-auth") > ;; Sending mail > ((.................... > ....................)) > ((string-match "f...@bar2.org" from) > ;; Use other server > (message "Using other server") > ((....................... > .......................)) > (t > (error > (concat "Don't know which mail server to use for > " > from)))))))) > > (add-hook 'message-setup-hook 'fs-change-smtp) > > For change among smtp servers depending the "from" header, but..... > what abou when I want to send News????, I want to send news with the > from fuck-s...@foo.com, but this is not defined in the function fs- > change-smtp then I get an "Don't know which mail server to use for ", > > how I can fix this? Replace the `error' in the function above with `message'. Then the "Dont't know..." message will still be printed, but no erros will be signalled. That's ok because for news you don't use smtp servers anyway. Oh, wait. There's a better solution. Take the function as-is, but add it to `message-send-mail-hook' instead of `message-setup-hook'. Bye, Tassilo -- My work on free software is motivated by an idealistic goal: spreading freedom and cooperation. I want to encourage free software to spread, replacing proprietary software that forbids cooperation, and thus make our society better. (Richard M. Stallman)