darcs

Issue 906 wish: injecting mail (darcs send) directly into remote MTA via SMTP

Title wish: injecting mail (darcs send) directly into remote MTA via SMTP
Priority feature Status unknown
Milestone Resolved in
Superseder recommend msmtp for darcs send for non-MTA users
View: 1395
Nosy List Hairy Dude, darcs-devel, dmitry.kurochkin, karel.gardas, kowey, markstos, thorkilnaur, tommy, tux_rocker, twb
Assigned To
Topics

Created on 2008-06-05.03:36:19 by twb, last changed 2012-12-17.21:00:17 by gh.

Messages
msg4955 (view) Author: twb Date: 2008-06-05.03:36:17
I wish for "darcs send" to support sending mail by speaking SMTP
directly to an remote MTA, in addition to the current support for
/usr/sbin/sendmail.  Below is a summary of arguments for this change.

I work from a subnotebook, which has limited volatile (RAM) and
non-volatile (SSD) storage.

One of the steps I take to reduce resource usage is to refrain from
running an MTA.  All MTAs I'm aware of either have a
permanently-running daemon (e.g. nullmailer), or simply discard
outbound mail instead of queuing it (e.g. ssmtp).

Other tools I use regularly I can configure to inject mail via SMTP
instead of /usr/sbin/sendmail, with a configurable SMTP host.  So I
simply configure them to send the mail directly to my company or ISP's
"smarthost" MTA.  This includes

    - git-send-mail (--smtp-server switch)
    - hg email (email/method in ~/.hgrc)
    - mutt (smtp_url in ~/.muttrc)
    - reportbug (-M switch)
    - bts (BTS_SMTP_HOST environment variable)
    - emacs (SMTPSERVER environment variable)

I believe it is increasingly common for laptops and workstations to
run without a local MTA.  For example, Ubuntu does not include any MTA
in its default desktop install.  Since Etch, the Debian GNU/Linux
distribution ships with an MTA installed by default, but (unlike
Sarge) is not configured during installation, and thus out-of-the-box
outbound mail is queued indefinitely.  Thus a sendmail-reliant "darcs
send" will not work "out of the box" on these distros.
msg4962 (view) Author: kowey Date: 2008-06-05.07:38:39
Sounds handy.
msg4973 (view) Author: tux_rocker Date: 2008-06-05.12:40:31
It would be useful indeed. I've had to configure MTAs for programs requiring 
one a couple of times, and although I managed to get it right (I think), it is 
quite a daunting task to just be able to send e-mail from an app.

I can't find an SMTP package on hackage.haskell.org, though, so we can't just 
use prepackaged functionality like you would in any other language. If we 
choose to build the functionality ourselves, I suggest we make a separate 
package and put it up on hackage.
msg5047 (view) Author: karel.gardas Date: 2008-06-14.06:36:33
It seems that both HaskellNet and HAppS provide kind of SMTP handling. To me
HaskellNet looks more simple to deal with:
http://darcs.haskell.org/SoC/haskellnet/
msg7448 (view) Author: kowey Date: 2009-03-13.12:28:35
Come to think of it, what's the difference between doing this ourselves and
blessing some null mailer to do it for us?
msg7449 (view) Author: markstos Date: 2009-03-13.13:22:22
On Fri, 13 Mar 2009 12:28:38 -0000
Eric Kow <bugs@darcs.net> wrote:

> 
> Eric Kow <kowey@darcs.net> added the comment:
> 
> Come to think of it, what's the difference between doing this ourselves and
> blessing some null mailer to do it for us?

It's the same, if we bundle the null mailer.

I see the issue about being self-contained.

Anyway we can distribute something which speaks SMTP achieves that.

    Mark
msg7450 (view) Author: tux_rocker Date: 2009-03-13.16:30:21
On Friday 13 March 2009 14:22:24 Mark Stosberg wrote:
> > Come to think of it, what's the difference between doing this ourselves
> > and blessing some null mailer to do it for us?
>
> It's the same, if we bundle the null mailer.
>
> I see the issue about being self-contained.

There's two SMTP client libraries on hackage nowadays. Perhaps we can bless 
one of those, so that we don't have to bundle anything?

Reinier
msg7451 (view) Author: kowey Date: 2009-03-13.16:51:25
I'll paste a snippet of Trent's message from the mailing list
<http://lists.osuosl.org/pipermail/darcs-users/2009-March/018333.html>
Message-Id <30hc1xscdl.fsf@Clio.twb.ath.cx>

Peter Hercek said:
> > then it is probably better to send mail directly from darcs (using
> > smtp).

Trent Buck said:
> I did just this with all my other apps for a while, and the conclusion I
> came to was that while it's easy to implement an in-app SMTP client, it
> actually ends up being MORE work, because you have to *separately*
> configure in each app smarthost (and possibly your SSL username,
> password and the remote host's public key).  And then it turns out that
> most in-app SMTP clients are buggy and slow and maybe don't do SSL.
> 
> I went down that path because I was so pissed off at nullmailer and
> ssmtp not working for me (and I didn't want the weight of postfix, which
> I highly recommend for servers).  But then I discovered that msmtp
> actually seems to work fairly reliably, doesn't run a daemon, doesn't
> keep a local queue, and actually waits until the message has been sent
> to the server before exiting (and exits with a non-zero status if that
> didn't work).  Oh, and msmtp can be rolled out without root access.

So we have four issues here:

 (i) implementing the SMTP stuff [which we all agree would have to be a separate
hackage package, and now Reinier points out that they exist]

 (ii) implementing the user configuration of the SMTP stuff (I imagine this
would be a file in _darcs/prefs) and 

 (iii) is this actually good for users? (which Trent seems to be saying that it
may not be so hot after all).

 (iv) can we afford the feature creep?

I'm not so sure about bundling a nullmailer.  I was just thinking we could
update the user documentation to say "if you don't understand all this MTA
stuff, then here's how you might configure darcs to use msmtp, and here's how
you can test to make sure darcs send is working"

Hmm, I suspect this is a do-er decides issue, like many things...
msg7452 (view) Author: markstos Date: 2009-03-13.17:15:02
Trent recommended using 'msmtp'.  Can we redistribute that with darcs to make
this easy for users? Is there Windows support for it?

    Mark
msg7453 (view) Author: kowey Date: 2009-03-13.17:28:44
On Fri, Mar 13, 2009 at 17:15:07 -0000, Mark Stosberg wrote:
> Trent recommended using 'msmtp'.  Can we redistribute that with darcs to make
> this easy for users?

Well, I think that would be too much work for us, and besides, users
would still have to read the msmtp documentation to learn how to
configure it (so they would still have to go to the msmtp site anyway).

But what about the documentation just outright advocating msmtp
with a friendly link to it?

> Is there Windows support for it?

It looks like there is!
  http://msmtp.sourceforge.net/requirements.html
msg7454 (view) Author: twb Date: 2009-03-14.00:51:04
On Fri, Mar 13, 2009 at 04:51:29PM -0000, Eric Kow wrote:
> I was just thinking we could update the user documentation to say
> "if you don't understand all this MTA stuff, then here's how you
> might configure darcs to use msmtp, and here's how you can test to
> make sure darcs send is working"

+1 for this approach.  IMO there are other more important parts of
Darcs to hack on.  This bug can be set to wont-fix or need-volunteer
until someone disagrees enough to actually do this work.  Whether we
actually want an SMTP client in Darcs can wait until we find someone
actually inclined to do the work.
msg7466 (view) Author: kowey Date: 2009-03-15.13:34:10
Ok Thorkil, I'm going to set this to wont-fix, trusting that you'll set this to
something else as needed :-)

I've marked issue1395 as a superseder for this bug, although I don't know if
this is really the right thing to do.
msg15401 (view) Author: gh Date: 2012-03-26.22:57:50
Recent conversation on the topic:

http://irclog.perlgeek.de/darcs/2012-03-25#i_5350183

Having seen the difficulty of making darcs send work under windows
during the last sprint, I suggest we reopen this issue ticket.
msg15809 (view) Author: gh Date: 2012-06-18.18:23:54
Reopening it as the topic of conversation comes back regularly.

As said on IRC:

[15:21] <donri> 
https://git.wiki.kernel.org/index.php/GitTips#Using_gmail_to_send_your_p
atches would be nice if it was this easy with darcs
msg16431 (view) Author: gh Date: 2012-12-17.21:00:15
We should keep an eye on this new library:

http://hackage.haskell.org/package/smtp-mail
History
Date User Action Args
2008-06-05 03:36:19twbcreate
2008-06-05 07:01:53koweylinkissue907 superseder
2008-06-05 07:38:41koweysetpriority: wishlist
nosy: + kowey
status: unread -> unknown
messages: + msg4962
title: Wish for injecting mail (darcs send) directly into MTA via SMTP -> wish: injecting mail (darcs send) directly into MTA via SMTP
2008-06-05 12:40:32tux_rockersetnosy: + tux_rocker
messages: + msg4973
2008-06-14 06:36:34kgardassetnosy: + kgardas
messages: + msg5047
2008-08-11 07:52:04koweysetpriority: wishlist -> feature
nosy: tommy, beschmi, kowey, dagit, twb, tux_rocker, kgardas
2008-08-11 07:53:43koweylinkissue596 superseder
2008-08-11 13:38:46markstossetnosy: + markstos
2008-08-11 16:32:11Hairy Dudesetnosy: + Hairy Dude
2009-03-13 12:27:34koweysetnosy: + dmitry.kurochkin, simon, thorkilnaur
title: wish: injecting mail (darcs send) directly into MTA via SMTP -> wish: injecting mail (darcs send) directly into remote MTA via SMTP
2009-03-13 12:28:38koweysetnosy: tommy, beschmi, kowey, markstos, dagit, simon, twb, thorkilnaur, Hairy Dude, tux_rocker, dmitry.kurochkin, kgardas
messages: + msg7448
2009-03-13 13:22:24markstossetnosy: tommy, beschmi, kowey, markstos, dagit, simon, twb, thorkilnaur, Hairy Dude, tux_rocker, dmitry.kurochkin, kgardas
messages: + msg7449
2009-03-13 16:30:25tux_rockersetnosy: tommy, beschmi, kowey, markstos, dagit, simon, twb, thorkilnaur, Hairy Dude, tux_rocker, dmitry.kurochkin, kgardas
messages: + msg7450
2009-03-13 16:51:29koweysetnosy: tommy, beschmi, kowey, markstos, dagit, simon, twb, thorkilnaur, Hairy Dude, tux_rocker, dmitry.kurochkin, kgardas
messages: + msg7451
2009-03-13 17:15:06markstossetnosy: tommy, beschmi, kowey, markstos, dagit, simon, twb, thorkilnaur, Hairy Dude, tux_rocker, dmitry.kurochkin, kgardas
messages: + msg7452
2009-03-13 17:28:46koweysetnosy: tommy, beschmi, kowey, markstos, dagit, simon, twb, thorkilnaur, Hairy Dude, tux_rocker, dmitry.kurochkin, kgardas
messages: + msg7453
2009-03-14 00:51:07twbsetnosy: tommy, beschmi, kowey, markstos, dagit, simon, twb, thorkilnaur, Hairy Dude, tux_rocker, dmitry.kurochkin, kgardas
messages: + msg7454
2009-03-15 13:34:13koweysetstatus: unknown -> wont-fix
nosy: tommy, beschmi, kowey, markstos, dagit, simon, twb, thorkilnaur, Hairy Dude, tux_rocker, dmitry.kurochkin, kgardas
superseder: + recommend msmtp for darcs send for non-MTA users
messages: + msg7466
2009-08-06 21:07:19adminsetnosy: - beschmi
2009-08-11 00:16:31adminsetnosy: - dagit
2009-08-22 16:10:24koweylinkissue921 superseder
2009-08-25 17:42:05adminsetnosy: + darcs-devel, - simon
2009-08-27 14:29:37adminsetnosy: tommy, kowey, markstos, darcs-devel, twb, thorkilnaur, Hairy Dude, tux_rocker, dmitry.kurochkin, kgardas
2009-10-23 23:59:22adminsetnosy: + karel.gardas, - kgardas
2012-03-26 22:57:51ghsetmessages: + msg15401
2012-06-18 18:23:55ghsetstatus: wont-fix -> unknown
messages: + msg15809
2012-12-17 21:00:17ghsetmessages: + msg16431