* [PATCH 1/2] gnu: Add libesmtp.
@ 2015-11-03 14:54 Andy Wingo
2015-11-03 14:54 ` [PATCH 2/2] gnu: Add esmtp Andy Wingo
0 siblings, 1 reply; 5+ messages in thread
From: Andy Wingo @ 2015-11-03 14:54 UTC (permalink / raw)
To: guix-devel
* gnu/packages/mail.scm (libesmtp): New public variable.
---
gnu/packages/mail.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 25407b8..9a70341 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -931,4 +931,28 @@ Email::Send library.")
format and headers.")
(license (package-license perl))))
+(define-public libesmtp
+ (package
+ (name "libesmtp")
+ (version "1.0.6")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "http://www.stafford.uklinux.net/libesmtp/libesmtp-"
+ version ".tar.bz2"))
+ (sha256
+ (base32
+ "02zbniyz7qys1jmx3ghx21kxmns1wc3hmv80gp7ag7yra9f1m9nh"))))
+ (build-system gnu-build-system)
+ (propagated-inputs
+ `(("openssl" ,openssl)))
+ (home-page "http://www.stafford.uklinux.net/libesmtp/")
+ (synopsis "Library for sending mail via remote hosts using SMTP")
+ (description "libESMTP is an SMTP client which manages posting (or
+submission of) electronic mail via a preconfigured Mail Transport Agent (MTA).
+It may be used as part of a Mail User Agent (MUA) or other program that must
+be able to post electronic mail where mail functionality may not be that
+program's primary purpose.")
+ (license (list lgpl2.1+ gpl2+))))
+
;;; mail.scm ends here
--
2.5.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] gnu: Add esmtp.
2015-11-03 14:54 [PATCH 1/2] gnu: Add libesmtp Andy Wingo
@ 2015-11-03 14:54 ` Andy Wingo
2015-11-03 15:21 ` Thompson, David
2015-11-03 15:32 ` Andy Wingo
0 siblings, 2 replies; 5+ messages in thread
From: Andy Wingo @ 2015-11-03 14:54 UTC (permalink / raw)
To: guix-devel
* gnu/packages/mail.scm (esmtp): New public variable.
---
gnu/packages/mail.scm | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 9a70341..dfc8ec9 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -30,6 +30,7 @@
#:use-module (gnu packages base)
#:use-module (gnu packages backup)
#:use-module (gnu packages bash)
+ #:use-module (gnu packages bison)
#:use-module (gnu packages curl)
#:use-module (gnu packages cyrus-sasl)
#:use-module (gnu packages databases)
@@ -44,6 +45,7 @@
#:use-module (gnu packages gsasl)
#:use-module (gnu packages gtk)
#:use-module (gnu packages guile)
+ #:use-module (gnu packages flex)
#:use-module (gnu packages libcanberra)
#:use-module (gnu packages libidn)
#:use-module (gnu packages linux)
@@ -70,6 +72,7 @@
(expat . license:expat)))
#:use-module (guix packages)
#:use-module (guix download)
+ #:use-module (guix git-download)
#:use-module (guix utils)
#:use-module (guix build-system gnu)
#:use-module (guix build-system perl)
@@ -955,4 +958,41 @@ be able to post electronic mail where mail functionality may not be that
program's primary purpose.")
(license (list lgpl2.1+ gpl2+))))
+(define-public esmtp
+ (package
+ (name "esmtp")
+ (version "1.2")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/andywingo/esmtp.git")
+ (commit "01bf9fc")))
+ (sha256
+ (base32
+ "1ay282rrl92h0m0m8z5zzjnwiiagi7c78aq2qvhia5mw7prwfyw2"))
+ (file-name (string-append name "-" version "-checkout"))))
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (add-before
+ 'configure 'autoconf
+ (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("bison" ,bison)
+ ("flex" ,flex)
+ ("libesmtp" ,libesmtp)
+ ("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("libtool" ,libtool)))
+ (home-page "http://www.stafford.uklinux.net/libesmtp/")
+ (synopsis "Relay-only mail transfer agent (MTA)")
+ (description "Esmtp is a simple relay-only mail transfer agent built using
+libESMTP. It sends e-mail via a remote SMTP server using credentials from the
+user's @file{$HOME/.esmtprc} configuration file; see the @command{esmtprc} man
+page for more on configuration. This package also provides minimal
+compatibility shims for the @command{sendmail}, @command{mailq}, and
+@command{newaliases} commands.")
+ (license gpl2+)))
+
;;; mail.scm ends here
--
2.5.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] gnu: Add esmtp.
2015-11-03 14:54 ` [PATCH 2/2] gnu: Add esmtp Andy Wingo
@ 2015-11-03 15:21 ` Thompson, David
2015-11-03 15:32 ` Andy Wingo
1 sibling, 0 replies; 5+ messages in thread
From: Thompson, David @ 2015-11-03 15:21 UTC (permalink / raw)
To: Andy Wingo; +Cc: guix-devel
On Tue, Nov 3, 2015 at 9:54 AM, Andy Wingo <wingo@igalia.com> wrote:
> * gnu/packages/mail.scm (esmtp): New public variable.
> ---
> gnu/packages/mail.scm | 40 ++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
>
> diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
> index 9a70341..dfc8ec9 100644
> --- a/gnu/packages/mail.scm
> +++ b/gnu/packages/mail.scm
> @@ -30,6 +30,7 @@
> #:use-module (gnu packages base)
> #:use-module (gnu packages backup)
> #:use-module (gnu packages bash)
> + #:use-module (gnu packages bison)
> #:use-module (gnu packages curl)
> #:use-module (gnu packages cyrus-sasl)
> #:use-module (gnu packages databases)
> @@ -44,6 +45,7 @@
> #:use-module (gnu packages gsasl)
> #:use-module (gnu packages gtk)
> #:use-module (gnu packages guile)
> + #:use-module (gnu packages flex)
> #:use-module (gnu packages libcanberra)
> #:use-module (gnu packages libidn)
> #:use-module (gnu packages linux)
> @@ -70,6 +72,7 @@
> (expat . license:expat)))
> #:use-module (guix packages)
> #:use-module (guix download)
> + #:use-module (guix git-download)
> #:use-module (guix utils)
> #:use-module (guix build-system gnu)
> #:use-module (guix build-system perl)
> @@ -955,4 +958,41 @@ be able to post electronic mail where mail functionality may not be that
> program's primary purpose.")
> (license (list lgpl2.1+ gpl2+))))
>
> +(define-public esmtp
> + (package
> + (name "esmtp")
> + (version "1.2")
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/andywingo/esmtp.git")
> + (commit "01bf9fc")))
> + (sha256
> + (base32
> + "1ay282rrl92h0m0m8z5zzjnwiiagi7c78aq2qvhia5mw7prwfyw2"))
> + (file-name (string-append name "-" version "-checkout"))))
> + (arguments
> + `(#:phases (modify-phases %standard-phases
> + (add-before
> + 'configure 'autoconf
> + (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
> + (build-system gnu-build-system)
> + (native-inputs
> + `(("bison" ,bison)
> + ("flex" ,flex)
> + ("libesmtp" ,libesmtp)
Should this be a regular input instead?
> + ("autoconf" ,autoconf)
> + ("automake" ,automake)
> + ("libtool" ,libtool)))
> + (home-page "http://www.stafford.uklinux.net/libesmtp/")
Wrong home page?
> + (synopsis "Relay-only mail transfer agent (MTA)")
> + (description "Esmtp is a simple relay-only mail transfer agent built using
> +libESMTP. It sends e-mail via a remote SMTP server using credentials from the
> +user's @file{$HOME/.esmtprc} configuration file; see the @command{esmtprc} man
> +page for more on configuration. This package also provides minimal
> +compatibility shims for the @command{sendmail}, @command{mailq}, and
> +@command{newaliases} commands.")
> + (license gpl2+)))
> +
> ;;; mail.scm ends here
> --
> 2.5.0
>
>
LGTM sans those minor nits.
- Dave
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] gnu: Add esmtp.
2015-11-03 14:54 ` [PATCH 2/2] gnu: Add esmtp Andy Wingo
2015-11-03 15:21 ` Thompson, David
@ 2015-11-03 15:32 ` Andy Wingo
2015-11-03 15:40 ` Andy Wingo
1 sibling, 1 reply; 5+ messages in thread
From: Andy Wingo @ 2015-11-03 15:32 UTC (permalink / raw)
To: guix-devel
On Tue 03 Nov 2015 14:54, Andy Wingo <wingo@igalia.com> writes:
> * gnu/packages/mail.scm (esmtp): New public variable.
This patch adds a "sendmail" that works, more or less. In my ~/.esmtprc
I have:
hostname = your.smtp.server:port
username = user@email.com
password = 'yourpasswordhere'
starttls = required
That configures the esmtp MTA. Then in Emacs you have these variables:
(setq send-mail-function 'sendmail-send-it)
(setq sendmail-program "/home/USER/.guix-profile/sbin/sendmail")
And install esmtp:
guix package -i esmtp
So now C-x m works, cool. You probably also want to install
git-send-email:
guix package -i git:send-email
and configure it globally:
git config --global sendemail.from "Your Name <your@email>"
# Don't Cc: yourself on mails.
git config --global sendemail.suppressfrom true
git config sendemail.smtpserver $HOME/.guix-profile/sbin/sendmail
git config envelopesender auto
And probably in your guix checkout you want to do:
git config sendemail.to guix-devel@gnu.org
And if all that is set up... well then you should be able to
git send-email 0001-foo.patch 0002-bar.patch
or
git send-email origin/master..HEAD
or whatever. Anyway you all have probably already hooked all of this up
but I was really struggling, and maybe this is useful to someone else.
Finally, the esmtp daemon will normally block on sending mails and never
queue anything. If you want to queue, there's the esmtp-wrapper shell
script shipped with esmtp; simply do:
ln -s ~/.guix-profile/bin/esmtp-wrapper ~/bin/sendmail
ln -s ~/.guix-profile/bin/esmtp-wrapper ~/bin/mailq
It will queue to ~/.esmtp_queue. This gives you the ability to send
mails while being offline. Later to send them, you can "mailq -q".
OK, that's all! At some point it would be nice to rewrite this hacky
pile of C and shell with a nice Guile relay-only MTA, but that day is
not today, at least for me :)
Cheers,
Andy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] gnu: Add esmtp.
2015-11-03 15:32 ` Andy Wingo
@ 2015-11-03 15:40 ` Andy Wingo
0 siblings, 0 replies; 5+ messages in thread
From: Andy Wingo @ 2015-11-03 15:40 UTC (permalink / raw)
To: guix-devel
On Tue 03 Nov 2015 15:32, Andy Wingo <wingo@igalia.com> writes:
> If you want to queue, there's the esmtp-wrapper shell
> script shipped with esmtp; simply do:
>
> ln -s ~/.guix-profile/bin/esmtp-wrapper ~/bin/sendmail
> ln -s ~/.guix-profile/bin/esmtp-wrapper ~/bin/mailq
If you do this you will probably want to do this instead:
; in .emacs
(setq sendmail-program "/home/USER/bin/sendmail")
# at the shell
git config sendemail.smtpserver $HOME/bin/sendmail
Andy
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-11-03 15:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-03 14:54 [PATCH 1/2] gnu: Add libesmtp Andy Wingo
2015-11-03 14:54 ` [PATCH 2/2] gnu: Add esmtp Andy Wingo
2015-11-03 15:21 ` Thompson, David
2015-11-03 15:32 ` Andy Wingo
2015-11-03 15:40 ` Andy Wingo
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).