From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/84917 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.gnus.general Subject: Re: separate smtps for my accounts Date: Fri, 12 Sep 2014 10:08:29 +0800 Message-ID: <87egvhsi8y.fsf@ericabrahamsen.net> References: <87tx4dodsj.fsf@skimble.plus.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1410487504 7218 80.91.229.3 (12 Sep 2014 02:05:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Sep 2014 02:05:04 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M33161@lists.math.uh.edu Fri Sep 12 04:04:57 2014 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XSGEJ-0005Gz-GR for ding-account@gmane.org; Fri, 12 Sep 2014 04:04:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1XSGDa-0006HY-47; Thu, 11 Sep 2014 21:04:10 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1XSGDX-0006HH-BB for ding@lists.math.uh.edu; Thu, 11 Sep 2014 21:04:07 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1XSGDV-00070O-K5 for ding@lists.math.uh.edu; Thu, 11 Sep 2014 21:04:06 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1XSGDT-0006BO-KK for ding@gnus.org; Fri, 12 Sep 2014 04:04:03 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XSGDT-0004rQ-Gz for ding@gnus.org; Fri, 12 Sep 2014 04:04:03 +0200 Original-Received: from 111.197.161.118 ([111.197.161.118]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Sep 2014 04:04:03 +0200 Original-Received: from eric by 111.197.161.118 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Sep 2014 04:04:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 29 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 111.197.161.118 User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux) Cancel-Lock: sha1:NaM5yNuK6Q4DlVjNmulE9pQp+n8= X-Spam-Score: -4.2 (----) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:84917 Archived-At: Sharon Kimble writes: > In my gnus setup I have 1 pop3 account, and 3 imap accounts, but only > one smtp address. How can I have a separate smtp settings so that I am > able to reply via the address of the email that I've just received? > > Thanks > Sharon. The details depend a little bit on the exact program you're using for sending mail, but generally the rigmarole looks like this (I use msmtp): (defun cg-feed-msmtp () (if (message-mail-p) (save-excursion (let* ((from (save-restriction (message-narrow-to-headers) (message-fetch-field "from"))) (account (cond ;; I use email address as account label in ~/.msmtprc ((string-match "eric@ericabrahamsen.net" from) "ea") ((string-match "account_two@gmail.com" from) "acc2") ((string-match "more_accounts@domain.org" from) "more")))) (setq message-sendmail-extra-arguments (list '"-a" account)))))) (setq message-sendmail-envelope-from 'header) (add-hook 'message-send-mail-hook 'cg-feed-msmtp)