Gnus development mailing list
 help / color / mirror / Atom feed
* Any way to captuer smtp output when sending mail?
@ 2014-10-17 16:13 Harry Putnam
  2014-10-17 16:36 ` Filipp Gunbin
  2014-10-18 14:10 ` Dave Goldberg
  0 siblings, 2 replies; 12+ messages in thread
From: Harry Putnam @ 2014-10-17 16:13 UTC (permalink / raw)
  To: ding

How would I go about sending mail in such a way as to capture the smtp
output like one can do with `mailx -v'

I'd like to collect that smtp output in a buffer as I send mail.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Any way to captuer smtp output when sending mail?
  2014-10-17 16:13 Any way to captuer smtp output when sending mail? Harry Putnam
@ 2014-10-17 16:36 ` Filipp Gunbin
  2014-10-17 21:37   ` Harry Putnam
  2014-10-18 14:10 ` Dave Goldberg
  1 sibling, 1 reply; 12+ messages in thread
From: Filipp Gunbin @ 2014-10-17 16:36 UTC (permalink / raw)
  To: Harry Putnam; +Cc: ding

Hi,

On 17/10/2014 20:13 +0400, Harry Putnam wrote:

> How would I go about sending mail in such a way as to capture the smtp
> output like one can do with `mailx -v'
>
> I'd like to collect that smtp output in a buffer as I send mail.

C-h v smtpmail-debug-info

-- 
    Filipp



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Any way to captuer smtp output when sending mail?
  2014-10-17 16:36 ` Filipp Gunbin
@ 2014-10-17 21:37   ` Harry Putnam
  2014-10-18  0:37     ` Filipp Gunbin
  0 siblings, 1 reply; 12+ messages in thread
From: Harry Putnam @ 2014-10-17 21:37 UTC (permalink / raw)
  To: ding

Filipp Gunbin <fgunbin@fastmail.fm> writes:

> Hi,
>
> On 17/10/2014 20:13 +0400, Harry Putnam wrote:
>
>> How would I go about sending mail in such a way as to capture the smtp
>> output like one can do with `mailx -v'
>>
>> I'd like to collect that smtp output in a buffer as I send mail.
>
> C-h v smtpmail-debug-info

Haven't found anything about that on couple of different hosts running
emacs-24.3

Is that something new or do I need something particular loaded to see
it?

I checked emacs.info with Index search with no luck either.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Any way to captuer smtp output when sending mail?
  2014-10-17 21:37   ` Harry Putnam
@ 2014-10-18  0:37     ` Filipp Gunbin
  2014-10-18 11:56       ` Filipp Gunbin
  2014-11-01 18:35       ` Harry Putnam
  0 siblings, 2 replies; 12+ messages in thread
From: Filipp Gunbin @ 2014-10-18  0:37 UTC (permalink / raw)
  To: Harry Putnam; +Cc: ding

Harry,

On 18/10/2014 01:37 +0400, Harry Putnam wrote:

> Filipp Gunbin <fgunbin@fastmail.fm> writes:
>
>> C-h v smtpmail-debug-info
>
> Haven't found anything about that on couple of different hosts running
> emacs-24.3
>
> Is that something new or do I need something particular loaded to see
> it?
>
> I checked emacs.info with Index search with no luck either.

Check the file list/mail/smtpmail.el in the emacs installation
directory.  It should be there.  Maybe that variable appeared very
recently, but I don't think so.

Setting that variable to `t' should give you what you want.

-- 
    Filipp



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Any way to captuer smtp output when sending mail?
  2014-10-18  0:37     ` Filipp Gunbin
@ 2014-10-18 11:56       ` Filipp Gunbin
  2014-11-01 18:35       ` Harry Putnam
  1 sibling, 0 replies; 12+ messages in thread
From: Filipp Gunbin @ 2014-10-18 11:56 UTC (permalink / raw)
  To: Harry Putnam; +Cc: ding

On 18/10/2014 04:37 +0400, Filipp Gunbin wrote:

> Check the file list/mail/smtpmail.el in the emacs installation
                 ^^^^
lisp, of course :)                 

-- 
    Filipp



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Any way to captuer smtp output when sending mail?
  2014-10-17 16:13 Any way to captuer smtp output when sending mail? Harry Putnam
  2014-10-17 16:36 ` Filipp Gunbin
@ 2014-10-18 14:10 ` Dave Goldberg
  2014-11-01 18:24   ` Harry Putnam
  1 sibling, 1 reply; 12+ messages in thread
From: Dave Goldberg @ 2014-10-18 14:10 UTC (permalink / raw)
  To: ding

> How would I go about sending mail in such a way as to capture the smtp
> output like one can do with `mailx -v'

> I'd like to collect that smtp output in a buffer as I send mail.

What is your outgoing email setup?  As another poster noted, if you use smtpmail (as I do) you can set smtpmail-debug-info and smtpmail-debug-verb to t to get a trace buffer each time you send a message (it gets overwritten for each one, though, so be prepared to save it off if you need the record).

However, there are other ways to configure emacs to send mail and the fact that you are not finding that variable suggests you may be using one of them.  Most likely is sendmail since I think that's the default, in which case you may find you have a buffer named " sendmail errors" that has the trace in it.  You might also want to take a look at the mail-interactive variable.  If it's nil I don't think you get the trace.

-- 
Dave Goldberg
david.goldberg6@verizon.net



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Any way to captuer smtp output when sending mail?
  2014-10-18 14:10 ` Dave Goldberg
@ 2014-11-01 18:24   ` Harry Putnam
  0 siblings, 0 replies; 12+ messages in thread
From: Harry Putnam @ 2014-11-01 18:24 UTC (permalink / raw)
  To: ding

david.goldberg6@verizon.net (Dave Goldberg) writes:

>> How would I go about sending mail in such a way as to capture the smtp
>> output like one can do with `mailx -v'
>
>> I'd like to collect that smtp output in a buffer as I send mail.
>
> What is your outgoing email setup?  As another poster noted, if you
> use smtpmail (as I do) you can set smtpmail-debug-info and
> smtpmail-debug-verb to t to get a trace buffer each time you send a
> message (it gets overwritten for each one, though, so be prepared to
> save it off if you need the record).

Thanks for the input, it is informed and very helpful:

You hit it on the head... I don't use smtpmail ... only once a few yrs
ago when I set up gnus on windows. 

I've done my mail activity on linux using gnus for many yrs, with sendmail
as the sending software.

> However, there are other ways to configure emacs to send mail and the
> fact that you are not finding that variable suggests you may be using
> one of them.  Most likely is sendmail since I think that's the
> default, in which case you may find you have a buffer named " sendmail
> errors" that has the trace in it.  You might also want to take a look
> at the mail-interactive variable.  If it's nil I don't think you get
> the trace.

Do you know if that trace buffer would appear only if there were errors?

I use this in gnus 
 (setq mail-user-agent  'gnus-user-agent)

for many years.  

That would have meant sendmail for many yrs but last few I've started
using exim4 on debian.

Since exim4's executable is named `sendmail'.... After seeing your
post, I thought it might still work.... but apparently not since the
variable you mentioned: `mail-interactive' is set to `t'. But still I
don't have that buffer.
    
Do you think there might be still more factors that need resetting or
the like to be able to follow that smtp output regularly?

Of course, I can and do follow the smtp output using a homeboy mail
sending script that uses `mailx -v' for testing situations.  It records
the smtp output, but it would be nice to have that output available
all the time.   And I didn't really see a handy way to capture it when
sending from gnus which is my normal way.

And, of course again, there are exim logs, mail.log and so forth.
Still it would be handy to have a continuing buffer in gnus to refer
to when a problem arises.

Perhaps there is some way to hook into that smtp activity in verbose
mode by scripting something? .... but that is a bit over my pea brain
comprehension. 




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Any way to captuer smtp output when sending mail?
  2014-10-18  0:37     ` Filipp Gunbin
  2014-10-18 11:56       ` Filipp Gunbin
@ 2014-11-01 18:35       ` Harry Putnam
  2014-11-01 19:02         ` W. Greenhouse
  1 sibling, 1 reply; 12+ messages in thread
From: Harry Putnam @ 2014-11-01 18:35 UTC (permalink / raw)
  To: ding

Filipp Gunbin <fgunbin@fastmail.fm> writes:

> Harry,
>
> On 18/10/2014 01:37 +0400, Harry Putnam wrote:
>
>> Filipp Gunbin <fgunbin@fastmail.fm> writes:
>>
>>> C-h v smtpmail-debug-info
>>
>> Haven't found anything about that on couple of different hosts running
>> emacs-24.3
>>
>> Is that something new or do I need something particular loaded to see
>> it?
>>
>> I checked emacs.info with Index search with no luck either.
>
> Check the file list/mail/smtpmail.el in the emacs installation
> directory.  It should be there.  Maybe that variable appeared very
> recently, but I don't think so.
>
> Setting that variable to `t' should give you what you want.

Thanks... I see that is not going to happen in my setup.  DaveG has
pointed out that my sending setup probably is responsible.

I use this in ~/.gnus
(setq mail-user-agent  'gnus-user-agent)
for roughly 1000 yrs or so.

It ended up meaning sendmail for yrs... but now using exim4 on debian.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Any way to captuer smtp output when sending mail?
  2014-11-01 18:35       ` Harry Putnam
@ 2014-11-01 19:02         ` W. Greenhouse
  2014-11-02  0:46           ` Harry Putnam
  0 siblings, 1 reply; 12+ messages in thread
From: W. Greenhouse @ 2014-11-01 19:02 UTC (permalink / raw)
  To: ding-smP1P7uqpqc

Harry Putnam <reader-kFrNdAxtuftBDgjK7y7TUQ@public.gmane.org> writes:

[...]

> Thanks... I see that is not going to happen in my setup.  DaveG has
> pointed out that my sending setup probably is responsible.
>
> I use this in ~/.gnus
> (setq mail-user-agent  'gnus-user-agent)
> for roughly 1000 yrs or so.
>
> It ended up meaning sendmail for yrs... but now using exim4 on debian.

Yeah, smtpmail-debug-info is only going to be relevant if you are using
the all-elisp "smtpmail.el" smtp client to send outgoing mail; mail sent
to sendmail/exim/postfix/etc. via their /usr/sbin/sendmail executables
wouldn't cross that bridge.

Perhaps you could customize `message-sendmail-extra-arguments' to a
value that would log more verbosely. something like "-D some-file.txt"
would send error reporting info there in sendmail's sendmail; perhaps
exim has a similar setting.

--
Good luck,
WGG




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Any way to captuer smtp output when sending mail?
  2014-11-01 19:02         ` W. Greenhouse
@ 2014-11-02  0:46           ` Harry Putnam
  2014-11-02 23:55             ` W. Greenhouse
  0 siblings, 1 reply; 12+ messages in thread
From: Harry Putnam @ 2014-11-02  0:46 UTC (permalink / raw)
  To: ding

W. Greenhouse <wgreenhouse@riseup.net>
writes:

> Harry Putnam <reader@newsguy.com> writes:
>
> [...]
>
>> Thanks... I see that is not going to happen in my setup.  DaveG has
>> pointed out that my sending setup probably is responsible.
>>
>> I use this in ~/.gnus
>> (setq mail-user-agent  'gnus-user-agent)
>> for roughly 1000 yrs or so.
>>
>> It ended up meaning sendmail for yrs... but now using exim4 on debian.
>
> Yeah, smtpmail-debug-info is only going to be relevant if you are using
> the all-elisp "smtpmail.el" smtp client to send outgoing mail; mail sent
> to sendmail/exim/postfix/etc. via their /usr/sbin/sendmail executables
> wouldn't cross that bridge.

[...] checking in to the snipped bit: `nessage-sendmail-extra-arguments'

Before getting too involved in the snipped suggestion... I think I
would like to ask at this point if users of smtpmail.el can offer any
arguments in favor of that method as apposed to others.

I know at one time, some years ago, it was about the only way to use
gnus on windows.  But I'm not dealing with windows in this
discussion. 

Perhaps there are good reasons to do it and I would be better off
spending my time getting setup for that.

Any speed or cpu differences of note?

Any other points infavor of all smtpmail.el?




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Any way to captuer smtp output when sending mail?
  2014-11-02  0:46           ` Harry Putnam
@ 2014-11-02 23:55             ` W. Greenhouse
  2014-11-03 16:59               ` Harry Putnam
  0 siblings, 1 reply; 12+ messages in thread
From: W. Greenhouse @ 2014-11-02 23:55 UTC (permalink / raw)
  To: ding-smP1P7uqpqc

Harry Putnam <reader-kFrNdAxtuftBDgjK7y7TUQ@public.gmane.org> writes:

[...]

> Perhaps there are good reasons to do it and I would be better off
> spending my time getting setup for that.
>
> Any speed or cpu differences of note?
>
> Any other points infavor of all smtpmail.el?

As I see it, the pros of smtpmail.el are:

1. Fewer moving parts--sometimes following the "UNIX philosophy"
   to the extreme for a problem like email means that it's hard to know
   what has failed when you change something in your delivery pipeline
   and it stops working:
   
   Is your MTA using the right smtp server for each of your outgoing
   mail addresses?

   Is mail getting stuck in a queue somewhere and you'd never know
   unless you poked around in your logs?

   ...etc, etc.

2. Emacs can store SMTP authentication credentials in an encrypted file,
   instead of leaving them sitting in plaintext on the disk (I know that
   some MTAs can store them as salted and hashed values after which you
   can delete the plaintext original, but Emacs with authinfo.gpg is
   even better).

3. Fairly tuneable behavior as far as TLS usage. Emacs unfortunately has
   nasty "fail open" behavior as a TLS client per default, and there are
   a couple of bug reports open about this, but it is possible to tune
   it to implement a "Trust on First Use" or certificate pinning scheme,
   which will "fail closed" if an unfamiliar certificate is seen
   (similar to the behavior of openssh when seeing a new host). See

   https://blogs.fsfe.org/jens.lechtenboerger/2014/03/23/certificate-pinning-for-gnu-emacs/

   for an example.

The cons are:

1. Delivery through smtpmail.el is synchronous, blocks your Emacs, and
   can be slow. Normally when using the /usr/sbin/sendmail binary on a
   *nix system, you are only copying standard output to a queue file,
   and delivery happens separately in the background when the mailserver
   flushes the queue, so this can be faster (and more importantly feels
   faster because you aren't sitting there waiting for your Emacs to
   return control to you :-) ). John Wiegley's async.el
   library comes with an example which works around the smtpmail
   blocking problem:

   https://github.com/jwiegley/emacs-async

   but because that library relies on using a second Emacs instance to
   do the background work, there can be issues with error reporting to
   the "master" Emacs, and getting this to work with encrypted auth
   credentials is pretty painful.

2. There is no easy recipe built into Gnus and smtpmail.el for the very
   common modern case of having several mail identities and needing to
   use a different outgoing smtp server for each. For that you need to
   figure out (info "(gnus) Posting Styles") and (info "(message) Mail
   Variables") and the care and feeding of the "X-Message-SMTP-Method"
   header, or else use an addon library like

   http://www.emacswiki.org/emacs/GnusAlias

   to make it easier to switch ougoing servers. Most MTAs have some
   example configuration for the "sender dependent smarthost" problem
   and it just works transparently after you set it up. Or people use a
   special tiny remote-client-only MTA like msmtp, which handles this
   multiple-outgoing-servers case brilliantly using just the -f flag to
   /usr/sbin/sendmail.
   




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Any way to captuer smtp output when sending mail?
  2014-11-02 23:55             ` W. Greenhouse
@ 2014-11-03 16:59               ` Harry Putnam
  0 siblings, 0 replies; 12+ messages in thread
From: Harry Putnam @ 2014-11-03 16:59 UTC (permalink / raw)
  To: ding

W. Greenhouse <wgreenhouse@riseup.net>
writes:

> Harry Putnam <reader@newsguy.com> writes:
>
> [...]
>
>> Perhaps there are good reasons to do it and I would be better off
>> spending my time getting setup for that.
>>
>> Any speed or cpu differences of note?
>>
>> Any other points infavor of all smtpmail.el?
>
> As I see it, the pros of smtpmail.el are:

[...]

Thanks for such a complete walkthru covering so much.  Very helpful.

Even though my needs are pretty basic, I suspect most of the work
needed to get that working is a bit above my pay grade. (READ skill
level) ;)

I think I'll stick with my current setup and go for the smtp output
when I need it, with my trusty `mailx -v'.  Just thought there might
be an easy yet more automated way... but it does not sound like it. At
least not without a good dose of heaving and hawing along the way.




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-11-03 16:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-17 16:13 Any way to captuer smtp output when sending mail? Harry Putnam
2014-10-17 16:36 ` Filipp Gunbin
2014-10-17 21:37   ` Harry Putnam
2014-10-18  0:37     ` Filipp Gunbin
2014-10-18 11:56       ` Filipp Gunbin
2014-11-01 18:35       ` Harry Putnam
2014-11-01 19:02         ` W. Greenhouse
2014-11-02  0:46           ` Harry Putnam
2014-11-02 23:55             ` W. Greenhouse
2014-11-03 16:59               ` Harry Putnam
2014-10-18 14:10 ` Dave Goldberg
2014-11-01 18:24   ` Harry Putnam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).