From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/81987 Path: news.gmane.org!not-for-mail From: Richard Riley Newsgroups: gmane.emacs.gnus.general Subject: Re: Can't send message through smtp with gmail Date: Thu, 28 Jun 2012 19:40:28 +0200 Organization: aich tea tea pea dicky riley dot net Message-ID: References: Reply-To: ding@gnus.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1340905326 32210 80.91.229.3 (28 Jun 2012 17:42:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 28 Jun 2012 17:42:06 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M30257@lists.math.uh.edu Thu Jun 28 19:42:05 2012 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 1SkIjE-0000JQ-KZ for ding-account@gmane.org; Thu, 28 Jun 2012 19:42:04 +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 1SkIi4-00055K-MO; Thu, 28 Jun 2012 12:40:52 -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 1SkIi2-00055A-VC for ding@lists.math.uh.edu; Thu, 28 Jun 2012 12:40:50 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1SkIhx-0002Ly-PA for ding@lists.math.uh.edu; Thu, 28 Jun 2012 12:40:50 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1SkIhv-0003DH-Ma for ding@gnus.org; Thu, 28 Jun 2012 19:40:43 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SkIhs-0006r5-Ss for ding@gnus.org; Thu, 28 Jun 2012 19:40:40 +0200 Original-Received: from 85.183.18.158 ([85.183.18.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Jun 2012 19:40:40 +0200 Original-Received: from rileyrg by 85.183.18.158 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Jun 2012 19:40:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 68 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 85.183.18.158 X-Message-Smtp-Method: smtp smtp.gmail.com 587 rileyrg Mail-Copies-To: never User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) Cancel-Lock: sha1:nI1XMVdZWnzvh8WJVWPG2GHIpqM= X-Spam-Score: 0.2 (/) X-Spam-Report: SpamAssassin (3.3.1 2010-03-16) analysis follows Bayesian score: 0.0000 Ham tokens: 0.000-2081--10150h-0s--0d--H*u:Emacs, 0.000-315--1533h-0s--0d--H*u:Gnus, 0.000-291--1418h-0s--0d--H*u:linux, 0.000-291--1418h-0s--0d--H*UA:linux, 0.000-286--1392h-0s--0d--H*u:gnu Spam tokens: 0.973-3206--573h-23379s--0d--HX-Spam-Relays-External:quimby.gnus.org, 0.973-3206--573h-23379s--0d--H*RU:quimby.gnus.org, 0.970-3009--609h-22384s--0d--HTo:D*gnus.org, 0.966-31687--7545h-242736s--0d--HContent-Transfer-Encoding:8bit, 0.965-3068--772h-23758s--0d--HX-Spam-Relays-Internal:quimby.gnus.org Autolearn status: no 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (rileyrg[at]gmail.com) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 1.2 RCVD_NUMERIC_HELO Received: contains an IP address used for HELO -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.9 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:81987 Archived-At: mihkel writes: > Hi and thanks for reply. > > On Thu, Jun 28, 2012 at 1:28 AM, Katsumi Yamaoka wrote: >> (smtpmail-via-smtp RECIPIENT SMTPMAIL-TEXT-BUFFER &optional >> ASK-FOR-PASSWORD) >> >> How about replacing those `(defvar ...' and `(defun ...' with >> the defadvice form as follows rather than redefining the function? >> >> (defadvice smtpmail-via-smtp (before change-smtp activate) >>  "Run `change-smtp' in advance." >>  (with-current-buffer smtpmail-text-buffer >>    (change-smtp))) >> >> This is essentially the same, but you don't have to care >> the arguments spec change. > > I changed these two defvar and defun with defadvice as you suggested. > Now when I send a message gnus asks for a SMTP user name for > smtp.gmail.com. When I enter one, then all messages go through this > smtp account. I have this snippet for changing smtp server according > to "from" filed. > > ;; Change smtp server according to "from" field > (defun change-smtp () > "Change the SMTP server according to the current from line." > (save-excursion > (loop with from = (save-restriction > (message-narrow-to-headers) > (message-fetch-field "from")) > for (acc-type address . auth-spec) in smtp-accounts > when (string-match address from) > do (cond > ((eql acc-type 'plain) > (return (apply 'set-smtp-plain auth-spec))) > ((eql acc-type 'ssl) > (return (apply 'set-smtp-ssl auth-spec))) > (t (error "Unrecognized SMTP account type: '%s'." acc-type))) > finally (error "Cannot interfere SMTP information.")))) > > Does the defadvice code change mentioned above break this function? I > really have to ask you to bear with me, since I'm not a programmer... > just a emacs user :) > > mihkel > my advice would be to use nognus and the built in multi smtp support. in your .authinfo: something like: machine smtp.gmail.com login accid1 port 587 password password1 machine smtp.gmail.com login accid2 port 587 password password2 In your gnus posting styles for the group in question:- (X-Message-SMTP-Method "smtp smtp.gmail.com 587 acc1") Its there somewhere in the gnus manual. But googling for x-message-smtp-method will show a previous thread on this. regards r.