Eric Abrahamsen writes: > 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): I'm using whatever the default is with Debian testing, sorry! Exim4? I don't know what it is, but reportbug is able to send through it. Sharon. > > (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) > > > -- A taste of linux = http://www.sharons.org.uk my git repo = https://bitbucket.org/boudiccas/dots TGmeds = http://www.tgmeds.org.uk Debian testing, fluxbox 1.3.5, emacs 24.3.93.1