Discussion:
[9fans] mail client; general question web vs command
(too old to reply)
Rudolf Sykora
2011-07-31 20:04:30 UTC
Permalink
Hello everybody!

I've been using a gmail account with the usual access via a web
browser for quite a while.
Sometimes I get little angry when using it, for various reasons, often
due to the firefox's slowness to render the page (scrolling a longer
thread is often pain for me).
I'd like to ask you. Do you use some client like e.g. mutt / heirloom
mailx / some plan9 client, and find its utility superior to a
web-based way? Do you e.g. use imap to connect to gmail and read mail?
I wonder if one can use such thin clients and not loose to much of
comfort / lucity / clarity / ease of use.

What do you generally consider the 'sucklest' way of reading mail?
(except for not reading it...)

Thank you!
Ruda

(I at least want to e.g. know, that using a web-client, although it is
a pain, is probably the way to go, and that I should perhaps have a
look for a quicker / simpler browser...)
Jacob Todd
2011-07-31 20:15:58 UTC
Permalink
Acme has Mail. It doesn't do threading like mutt or anything, but it works.
Akshat Kumar
2011-08-02 04:37:40 UTC
Permalink
Post by Jacob Todd
Acme has Mail. It doesn't do threading like mutt or anything, but it works.
Robert Raschke coded a threaded version of Acme's News.
But that depends on the filesystem hierarchy of messages
in nntpfs. (n)upasfs does not thread messages at the level
of the fs. Indeed, it would be a better approach to thread at
the interface level, which should be possible all the same
and could apply to Acme's News interface as well (so we
can perhaps remove a lot of that code from nntpfs).

If anyone does this, I also suggest using Russ' rc version
(ported to Plan 9) of Acme Mail, instead of adapting the C
code.


Best,
ak
Mathieu Lonjaret
2011-08-04 15:51:56 UTC
Permalink
Btw, for those who don't know yet, I have a version here with
threading for p9p acme Mail:
https://bitbucket.org/mpl/acmemail-with-sort-by-thread/overview
nothing fancy but it suits my needs well enough.
Post by Jacob Todd
Acme has Mail. It doesn't do threading like mutt or anything, but it works.
Rudolf Sykora
2011-08-06 14:19:08 UTC
Permalink
Hello,
Post by Mathieu Lonjaret
Btw, for those who don't know yet, I have a version here with
https://bitbucket.org/mpl/acmemail-with-sort-by-thread/overview
nothing fancy but it suits my needs well enough.
Post by Jacob Todd
Acme has Mail. It doesn't do threading like mutt or anything, but it works.
Can anybody point me to some recipe which would get me from a point
when I have p9p installed to a point when I can read mail from my
gmail account via imap(s) in p9p acme?

(I now spent some time on that, but have been unsuccessful so far.)
Thank you!
Ruda
Rudolf Sykora
2011-08-11 10:45:30 UTC
Permalink
Post by Rudolf Sykora
Can anybody point me to some recipe which would get me from a point
when I have p9p installed to a point when I can read mail from my
gmail account via imap(s) in p9p acme?
Well, that's a pity nobody can help.... :(

Is there any reason for that man pages of p9p
http://swtch.com/plan9port/man/
do not mention neither upas nor mail?
(So nobody actually uses it today?)

Also, although some mail program is present,
/src/cmd/acme/mail
it is apparently not installed by default?

[I'm tired of the web interface. I tried mutt, which was easy to set
up since you can find instructions for this. But I want the acme mail.
And there seem to be many things `somehow around', but not a coherent
explanation of how to put the pieces (and which) together...]

Thanks
Ruda
Mathieu Lonjaret
2011-08-11 11:26:05 UTC
Permalink
I'm not sure I've tried with gmail, I think I did, but a long time ago.
Otherwise it's pretty simple:

cd src/cmd/upas/nfs
mk install
factotum
factotum -g 'key=somekey proto=pass service=imap
server=some.imap.server.com user=your_username !password?'
(it will ask for the pass you want to store for that key)
mailfs -t some.imap.server.com
in acme, button-2 exec on Mail -s

Cheers,
Mathieu
Post by Rudolf Sykora
Post by Rudolf Sykora
Can anybody point me to some recipe which would get me from a point
when I have p9p installed to a point when I can read mail from my
gmail account via imap(s) in p9p acme?
Well, that's a pity nobody can help.... :(
Is there any reason for that man pages of p9p
http://swtch.com/plan9port/man/
do not mention neither upas nor mail?
(So nobody actually uses it today?)
Also, although some mail program is present,
/src/cmd/acme/mail
it is apparently not installed by default?
[I'm tired of the web interface. I tried mutt, which was easy to set
up since you can find instructions for this. But I want the acme mail.
And there seem to be many things `somehow around', but not a coherent
explanation of how to put the pieces (and which) together...]
Thanks
Ruda
Rudolf Sykora
2011-08-13 18:40:38 UTC
Permalink
cd src/cmd/upas/nfs
mk install
factotum
factotum -g 'key=somekey proto=pass service=imap
server=some.imap.server.com user=your_username !password?'
(it will ask for the pass you want to store for that key)
mailfs -t some.imap.server.com
in acme, button-2 exec on Mail -s
Cheers,
Mathieu
Thanks for your answer!
Anyway, I still haven't succeeded, and have a few questions.

1) Is nfs (lookman nfs or mailfs returns nothing) a new program
written for p9p just to be used for an imap connection to some mail
server?

2) Do I really have to add the key to factotum or is it enough (for
testing purposes) to just have it running (and it will ask me for
whatever is later needed)?

3) When I try to use mailfs, I get

% mailfs -t imap.gmail.com
/sbin/stunnel exec failed at /usr/sbin/stunnel3 line 39.
mailfs: imapconnect: no greeting

and I really do not know what's going on...
(I have tried to replace stunnel with stunnel3, as mentioned by Fazlul
Shahriar; but I actually I don't understand the matter.)

If you could clarify the situation for me a bit, I'd be appreciative.

Thanks
Ruda
Fazlul Shahriar
2011-08-13 23:28:05 UTC
Permalink
Post by Rudolf Sykora
% mailfs -t imap.gmail.com
/sbin/stunnel exec failed at /usr/sbin/stunnel3 line 39.
mailfs: imapconnect: no greeting
I think your stunnel3 is broken. stunnel3 is actually a perl script
that runs stunnel 4. In your case, it thinks stunnel 4 is at
/sbin/stunnel, but it's not.

fhs
Rudolf Sykora
2011-08-14 14:51:41 UTC
Permalink
Post by Fazlul Shahriar
Post by Rudolf Sykora
% mailfs -t imap.gmail.com
/sbin/stunnel exec failed at /usr/sbin/stunnel3 line 39.
mailfs: imapconnect: no greeting
I think your stunnel3 is broken. stunnel3 is actually a perl script
that runs stunnel 4. In your case, it thinks stunnel 4 is at
/sbin/stunnel, but it's not.
fhs
Thank you! Really, stunnel3 is a perl script, and it looked for
stunnel at a wrong location (I have it under /usr/sbin, not /sbin). So
now I finally see sth. in my Acme (after executing '9 Mail -s'), which
is much nicer than before...

Thanks!
Ruda
Mathieu Lonjaret
2011-08-13 23:41:37 UTC
Permalink
Post by Rudolf Sykora
cd src/cmd/upas/nfs
mk install
factotum
factotum -g 'key=somekey proto=pass service=imap
server=some.imap.server.com user=your_username !password?'
(it will ask for the pass you want to store for that key)
mailfs -t some.imap.server.com
in acme, button-2 exec on Mail -s
Cheers,
Mathieu
Thanks for your answer!
Anyway, I still haven't succeeded, and have a few questions.
1) Is nfs (lookman nfs or mailfs returns nothing) a new program
written for p9p just to be used for an imap connection to some mail
server?
http://9fans.net/archive/2009/02/415
Post by Rudolf Sykora
2) Do I really have to add the key to factotum or is it enough (for
testing purposes) to just have it running (and it will ask me for
whatever is later needed)?
dunno. I suppose it should, I don't remember why I don't proceed like that.
try it and tell us? :)
Post by Rudolf Sykora
3) When I try to use mailfs, I get
% mailfs -t imap.gmail.com
/sbin/stunnel exec failed at /usr/sbin/stunnel3 line 39.
mailfs: imapconnect: no greeting
and I really do not know what's going on...
(I have tried to replace stunnel with stunnel3, as mentioned by Fazlul
Shahriar; but I actually I don't understand the matter.)
what's your distro? have you checked what stunnel packages are available to you?
Isn't your /usr/bin/stunnel a symlink to another one?
also what Fazlul said.
Post by Rudolf Sykora
If you could clarify the situation for me a bit, I'd be appreciative.
Thanks
Ruda
Rudolf Sykora
2011-08-27 18:00:53 UTC
Permalink
Hello,

On 11 August 2011 12:54, Mathieu Lonjaret
in acme, button-2 exec on Mail -s
When I try to have several inboxes (?; what gmail calls labels), i.e. I run
9 Mail
9 Mail plan9
9 Mail CERN
for some reason it seems that only my INBOX (i.e. the acme window
related to the 1st line) is being updated when a new mail arrives.

Is it only my problem? Should the update work in all windows? Am I
doing sth wrong?

Thanks
Ruda
Fazlul Shahriar
2011-08-11 12:22:26 UTC
Permalink
I just tried -- it works fine with gmail.

mailfs -t imap.gmail.com # -t enable TLS
It'll ask your for your username/password. Then start Mail in acme.

mailfs will look for stunnel in your system. In my system, it found
stunnel 4, which it doesn't know how to use. So, I had to point it to
stunnel3:

--- a/src/cmd/upas/nfs/imap.c Thu Aug 11 07:43:28 2011 -0400
+++ b/src/cmd/upas/nfs/imap.c Thu Aug 11 08:12:24 2011 -0400
@@ -756,8 +756,8 @@
fd[2] = dup(2, -1);
tmp = esmprint("%s:993", server);
if(threadspawnl(fd, "tlsclient", "tlsclient", tmp, nil) < 0
- && threadspawnl(fd, "/usr/sbin/stunnel", "stunnel", "-c", "-r",
tmp, nil) < 0
- && threadspawnl(fd, "/usr/bin/stunnel", "stunnel", "-c", "-r",
tmp, nil) < 0){
+ && threadspawnl(fd, "/usr/sbin/stunnel3", "stunnel", "-c",
"-r", tmp, nil) < 0
+ && threadspawnl(fd, "/usr/bin/stunnel3", "stunnel", "-c", "-r",
tmp, nil) < 0){
free(tmp);
close(p[0]);
close(p[1]);
Post by Rudolf Sykora
Post by Rudolf Sykora
Can anybody point me to some recipe which would get me from a point
when I have p9p installed to a point when I can read mail from my
gmail account via imap(s) in p9p acme?
Well, that's a pity nobody can help.... :(
Is there any reason for that man pages of p9p
http://swtch.com/plan9port/man/
do not mention neither upas nor mail?
(So nobody actually uses it today?)
Also, although some mail program is present,
/src/cmd/acme/mail
it is apparently not installed by default?
[I'm tired of the web interface. I tried mutt, which was easy to set
up since you can find instructions for this. But I want the acme mail.
And there seem to be many things `somehow around', but not a coherent
explanation of how to put the pieces (and which) together...]
Thanks
Ruda
John Floren
2011-08-11 16:37:57 UTC
Permalink
Nice! Works for me too...

But what about sending mail? I've only ever configured Plan 9 to act
as its own smtp server, have never done anything with p9p or a remove
server.


John
Post by Fazlul Shahriar
I just tried -- it works fine with gmail.
mailfs -t imap.gmail.com    # -t enable TLS
It'll ask your for your username/password. Then start Mail in acme.
mailfs will look for stunnel in your system. In my system, it found
stunnel 4, which it doesn't know how to use. So, I had to point it to
--- a/src/cmd/upas/nfs/imap.c   Thu Aug 11 07:43:28 2011 -0400
+++ b/src/cmd/upas/nfs/imap.c   Thu Aug 11 08:12:24 2011 -0400
@@ -756,8 +756,8 @@
               fd[2] = dup(2, -1);
               tmp = esmprint("%s:993", server);
               if(threadspawnl(fd, "tlsclient", "tlsclient", tmp, nil) < 0
-                   && threadspawnl(fd, "/usr/sbin/stunnel", "stunnel", "-c", "-r",
tmp, nil) < 0
-                   && threadspawnl(fd, "/usr/bin/stunnel", "stunnel", "-c", "-r",
tmp, nil) < 0){
+                   && threadspawnl(fd, "/usr/sbin/stunnel3", "stunnel", "-c",
"-r", tmp, nil) < 0
+                   && threadspawnl(fd, "/usr/bin/stunnel3", "stunnel", "-c", "-r",
tmp, nil) < 0){
                       free(tmp);
                       close(p[0]);
                       close(p[1]);
Post by Rudolf Sykora
Post by Rudolf Sykora
Can anybody point me to some recipe which would get me from a point
when I have p9p installed to a point when I can read mail from my
gmail account via imap(s) in p9p acme?
Well, that's a pity nobody can help.... :(
Is there any reason for that man pages of p9p
http://swtch.com/plan9port/man/
do not mention neither upas nor mail?
(So nobody actually uses it today?)
Also, although some mail program is present,
/src/cmd/acme/mail
it is apparently not installed by default?
[I'm tired of the web interface. I tried mutt, which was easy to set
up since you can find instructions for this. But I want the acme mail.
And there seem to be many things `somehow around', but not a coherent
explanation of how to put the pieces (and which) together...]
Thanks
Ruda
David du Colombier
2011-08-11 17:58:03 UTC
Permalink
Post by John Floren
But what about sending mail? I've only ever configured Plan 9 to act
as its own smtp server, have never done anything with p9p or a remove
server.
It's pretty much the same as on Plan 9.

See $PLAN9/mail/lib/rewrite.
--
David du Colombier
Rudolf Sykora
2011-08-28 14:11:46 UTC
Permalink
Hello,
Post by David du Colombier
Post by John Floren
But what about sending mail? I've only ever configured Plan 9 to act
as its own smtp server, have never done anything with p9p or a remove
server.
It's pretty much the same as on Plan 9.
See $PLAN9/mail/lib/rewrite.
I must say that now I have spent about 5 hours trying to make sending
email from p9p work, but so far without success.
[Perhaps it is often much more instructive to write down 10 lines to
explain than just write that it is much the same as somewhere else...]

After reading quite a few man pages, I've tried to simplify my attempts.
Now I have a simple file 'q' with the email I want to send (I put 'cat
Post by David du Colombier
-------
;cat q
From ruda Sun Aug 28 14:52:01 CES 2011 remote from bluestar
To: ***@cern.ch
Date: Sun, 28 Aug 2011 14:52:01 +0200
From: ruda
MIME-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

aahahha

;
<-------

now when I try (74.125.39.108 should be smtp.gmail.com):
cat q | upas/smtp -a -d -h a.com 74.125.39.108 ***@gmail.com
***@cern.ch

I get:
mxlookup returns nothing
220 mx.google.com ESMTP u18sm633897fah.41
EHLO bluestar.ch
250-mx.google.com at your service, [128.141.146.177]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250 ENHANCEDSTATUSCODES
Sun Aug 28 15:33:22 CES 2011 connect to 74.125.39.108:
250-mx.google.com at your service, [128.141.146.177]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250 ENHANCEDSTATUSCODES
QUIT
221 2.0.0 closing connection u18sm633897fah.41

If anybody could suggest what I should do to be able to send...

(E.g. I don't understand why I need any '-h a.com' or what should
really be there. Further, I do not know if I have to have an entry in
factotum before the try or if factotum would ask when neccessary [as
it does in the imap case, i.e. when I just read the email].)

(I on purpose try to bypass all those upas/qer, upas/runq, ... stuff;
I believe a simple line like above should first succeed before any
such stuff is needed. Also, when I tried to use the queues, sth kept
on bringing qmail script to life each few seconds [and I was not able
to tell what], the file log/mail/smtp.fail was steadily growing and I
could not stop it [finally I renamed qmail to stop it].)

Thank you!
(I just so much want to get rid of the web browsers...)
Ruda
Rudolf Sykora
2011-08-27 17:54:03 UTC
Permalink
Hello all!
Post by Mathieu Lonjaret
Btw, for those who don't know yet, I have a version here with
I tried it now, using my gmail account and imap access.
At first the threading seemed to work.
However, when I sent a new mail to myself from another account, about
10 older mails appeared at the top (in the acme list of mails), but
these have nothing to do with my sent e-mail, and I wonder what they
actually have in common...

[I quickly went through $PLAN9/src/cmd/acme/mail/mesg.c, where the
majority of changes appear, but the number of changes is too large,
and since I do not understand the logic...]

Anyway, if the threading worked, I believe it'd be useful.

Best regards
Ruda
dexen deVries
2011-07-31 21:19:10 UTC
Permalink
Post by Rudolf Sykora
I've been using a gmail account with the usual access via a web
browser for quite a while.
Sometimes I get little angry when using it, for various reasons, often
due to the firefox's slowness to render the page (scrolling a longer
thread is often pain for me).
I'd like to ask you. Do you use some client like e.g. mutt / heirloom
mailx / some plan9 client, and find its utility superior to a
web-based way? Do you e.g. use imap to connect to gmail and read mail?
I wonder if one can use such thin clients and not loose to much of
comfort / lucity / clarity / ease of use.
What do you generally consider the 'sucklest' way of reading mail?
(except for not reading it...)
i'm using gmail's IMAP in cached (`disconneted') mode; operations are
performed on local files. that's fast (low latencies). my (linux) mail client:
kmail does threading and has comfy in-line search of title, author etc.
somehow i always end up disabling threading thou.

i assume firefox renders HTML pixel-by-pixel, which causes general slowness
over network. some VNC servers have automatic scroll decetction heueristics
and send scroll events rather than full redraws if client supports that, but
that's a hack. networked X11 seems to work well with scrolling, but firefox's
chrome (widgets) over networked X11 are still damn slow.
--
dexen deVries
Post by Rudolf Sykora
It's called trolling. It's been done since there were bangs in people's
email addresses.

thaumaturgy, on HN
hiro
2011-08-01 04:26:41 UTC
Permalink
I prefer gmail's basic html view. It's working reliably, because it's
not maintained any more: http://mail.google.com/mail/h/
Ethan Grammatikidis
2011-08-01 11:20:10 UTC
Permalink
On Sun, 31 Jul 2011 22:00:57 +0200
Post by Rudolf Sykora
(I at least want to e.g. know, that using a web-client, although it is
a pain, is probably the way to go, and that I should perhaps have a
look for a quicker / simpler browser...)
Indeed. I find Firefox seems to run javascript about half the speed
Opera does while using more CPU.
Lyndon Nerenberg VE6BBM/VE7TFX
2011-08-02 20:33:47 UTC
Permalink
Post by Rudolf Sykora
I've been using a gmail account with the usual access via a web
browser for quite a while.
Sometimes I get little angry when using it, for various reasons, often
due to the firefox's slowness to render the page (scrolling a longer
thread is often pain for me).
I'd like to ask you. Do you use some client like e.g. mutt / heirloom
mailx / some plan9 client, and find its utility superior to a
web-based way?
At Flock we used Gmail as our corporate email service :-P I just
pointed upas/fs at Google's IMAP servers and carried on using Acme
Mail and nedmail as usual. htmlfmt(1) is a superior HTML mail
reader, in my books.

Using a small rc script it was trivial to run two distinct mail client
instances on my terminal — one pointed at Google for work mail, the
other pointed at my own IMAP server for personal mail.

Like Eric, I used nedmail as a dumb threading tool. It was very
useful as a brute force defence against all the cron spam our servers
sent out. I would run a script that invoked nedmail to whack all the
usual suspects based on subject, from, and to headers, then read the
leftovers in Acme. Upas also made it very simple to write adhoc
scripts to usefully process all that cron spam, something you'll never
be able to do with a webmail client.

--lyndon
Mathieu Lonjaret
2011-08-11 11:26:21 UTC
Permalink
gmail wrapped the line; there shouldn't be a break between the service
and the server.

On Thu, Aug 11, 2011 at 12:54 PM, Mathieu Lonjaret
I'm not sure I've tried with gmail, I think I did, but a long time ago.
cd src/cmd/upas/nfs
mk install
factotum
factotum -g 'key=somekey proto=pass service=imap
server=some.imap.server.com user=your_username !password?'
(it will ask for the pass you want to store for that key)
mailfs -t some.imap.server.com
in acme, button-2 exec on Mail -s
Cheers,
Mathieu
Post by Rudolf Sykora
Post by Rudolf Sykora
Can anybody point me to some recipe which would get me from a point
when I have p9p installed to a point when I can read mail from my
gmail account via imap(s) in p9p acme?
Well, that's a pity nobody can help.... :(
Is there any reason for that man pages of p9p
http://swtch.com/plan9port/man/
do not mention neither upas nor mail?
(So nobody actually uses it today?)
Also, although some mail program is present,
/src/cmd/acme/mail
it is apparently not installed by default?
[I'm tired of the web interface. I tried mutt, which was easy to set
up since you can find instructions for this. But I want the acme mail.
And there seem to be many things `somehow around', but not a coherent
explanation of how to put the pieces (and which) together...]
Thanks
Ruda
erik quanstrom
2011-08-28 15:17:09 UTC
Permalink
i'm confused. are you using plan 9 or p9p?

i would think that a.com is wrong. you need to use your real domain.
also i think you want the real target system, not an ip address.
mx lookup for google isn't broken for me.

; fn mxquery {x=`{ndb/dnsquery google.com mx | sort +1n | sed 1q}; echo $x(4)>[1=2]; ndb/dnsquery $x(4)}
; mxquery google.com >[2=]
aspmx.l.google.com ip 74.125.47.27


on plan 9, upas typically uses /mail/lib/remotemail to send
to remote systems. my remotemail looks like

#!/bin/rc
sender = $1; addr = $2; * = $*(3-)
fd=`{/bin/upas/aliasmail -f $sender}
switch($fd){
case *.*
;
case *
fd=quanstro.net
}
exec /bin/upas/smtp -h $fd $addr $sender $*

this is invoked by qmail/kickqueue which are tickled
by sending mail and/or a cron job.

; cat /cron/upas/cron
# kick mail retries (replace ladd with your system)
0,10,20,30,40,50 * * * * ladd /bin/upas/runq -a /mail/queue /mail/lib/remotemail

# clean up after grey list
47 4 * * * ladd rm -rf /mail/grey/tmp/*/*

ymmv, and there may be nupasisms in here.

- erik
Rudolf Sykora
2011-08-28 18:24:21 UTC
Permalink
Hello,
i'm confused.  are you using plan 9 or p9p?
p9p now
i would think that a.com is wrong. you need to use your real domain.
you may well be right. I have no idea what/why I should write there. I
am using a notebook that is used regularly at diferent places and the
only thing I now want is to pass my e-mail to gmail via smtp (where I
have an account) so that it then can be sent further. Thus I'd expect
that all I need is i) the mail itself with the info to whom it should
be sent, and ii) login/password for the gmail account. I don't see any
reason for any other domain name... I just wrote that a.com there so
that there is something (so, simply, understand that I do not
understand...).
also i think you want the real target system, not an ip address.
mx lookup for google isn't broken for me.
       ; fn mxquery {x=`{ndb/dnsquery google.com mx | sort +1n | sed 1q}; echo $x(4)>[1=2]; ndb/dnsquery $x(4)}
       ; mxquery google.com >[2=]
       aspmx.l.google.com ip   74.125.47.27
well, is there any difference if I use smtp.gmail.com or the
corresponding ip? (for the former to work I need, I have a feeling,
add sth somewhere [ndb?], so the ip was easier for the experiment).
on plan 9, upas typically uses /mail/lib/remotemail to send
to remote systems.  my remotemail looks like
       #!/bin/rc
       sender = $1; addr = $2; * = $*(3-)
       fd=`{/bin/upas/aliasmail -f $sender}
       switch($fd){
       case *.*
               ;
       case *
               fd=quanstro.net
       }
       exec /bin/upas/smtp -h $fd $addr $sender $*
on p9p a similar thing is also in remotemail...
this is invoked by qmail/kickqueue which are tickled
by sending mail and/or a cron job.
       ; cat /cron/upas/cron
       # kick mail retries (replace ladd with your system)
       0,10,20,30,40,50 * * * *        ladd            /bin/upas/runq -a /mail/queue /mail/lib/remotemail
       # clean up after grey list
       47 4 * * *      ladd    rm -rf /mail/grey/tmp/*/*
ymmv, and there may be nupasisms in here.
- erik
Ok. But putting aside the way how different programs are invoked,
finally there is always that line with
/bin/upas/smtp -h $fd $addr $sender $*
that actually sends the mail (which it reads from stdin). This line of
yours has to have -a added since gmail needs authentication (so
finally a key in factotum). So before engaging the rewrite,
remotemail, vf, qer, runq, ... (?) programs, I would like to be able
to send an email using just this and be sure it works...

Thanks
Ruda
Richard Miller
2011-08-31 14:23:49 UTC
Permalink
To use the plan9port version of upas/smtp with authenticated connections,
you need a couple of fixes which I've just submitted. 'hg pull -u' will
get them.

The plan9port upas/smtp also does not support tls, which is required
by gmail. The workaround is to run smtp inside a tls tunnel, as shown
below. Note that you can't use 'localhost' to address the near end
of the tunnel because smtp doesn't like forwarding to 127.0.0.1.

bash-3.1$ hostname
epia
bash-3.1$ cat msg
Subject: test

hello
bash-3.1$ 9p read factotum/ctl
key proto=pass role=client server=epia service=smtp user=***@gmail.com !password?
bash-3.1$ sudo /usr/sbin/stunnel3 -c -d 12345 -r smtp.gmail.com:465
bash-3.1$ $PLAN9/bin/upas/smtp -ai 'tcp!epia!12345' ***@hamnavoe.com ***@example.com <msg
epia Aug 31 15:01:34 ***@hamnavoe.com sent 127 bytes to ***@example.com
Rudolf Sykora
2011-09-09 19:51:09 UTC
Permalink
Hello,
Post by Richard Miller
To use the plan9port version of upas/smtp with authenticated connections,
you need a couple of fixes which I've just submitted. 'hg pull -u' will
get them.
The plan9port upas/smtp also does not support tls, which is required
by gmail. The workaround is to run smtp inside a tls tunnel, as shown
below. Note that you can't use 'localhost' to address the near end
of the tunnel because smtp doesn't like forwarding to 127.0.0.1.
bash-3.1$ hostname
epia
bash-3.1$ cat msg
Subject: test
hello
bash-3.1$ 9p read factotum/ctl
bash-3.1$ sudo /usr/sbin/stunnel3 -c -d 12345 -r smtp.gmail.com:465
I tried to follow this recipe, however, not fully succeeded...
1) I ran 'hg pull' and 'hg update' in my $PLAN9 directory.
2) My computer has a name 'bluestar' (output of 'hostname').
3) I created the testing message 'mesg'.
4) I added the key to factotum by running:
factotum -g 'proto=pass role=client server=bluestar service=smtp
user=***@gmail.com !password?'
and I entered my gmail password when promted.
5) I issued:
sudo /usr/sbin/stunnel3 -c -d 12345 -r smtp.gmail.com:465
6) then issued:
$PLAN9/bin/upas/smtp -ai 'tcp!bluestar!12345' ***@gmail.com
***@cern.ch <msg
and got this:
smtp: bad network /net/tcp!bluestar!12345 (tcp!bluestar!12345)
so I tried
$PLAN9/bin/upas/smtp -ai 'tcp!128.141.146.215!12345'
***@gmail.com ***@cern.ch <msg
where 128.141.146.215 is my current ip address. (What and where should
I add so that the name bluestar would be resolved? I obtain the ip
using dhcp, thus it can vary from boot to boot, together with the
domain...) The result is:

Fri Sep 9 21:34:17 CES 2011 connect to tcp!128.141.146.215!12345:
250-mx.google.com at your service, [128.141.146.215]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH
250 ENHANCEDSTATUSCODES

but it does not seem like any email has been sent anywhere...

Btw. I don't quite understand what '***@hamnavoe.com' really stands
for. Plan9 man page says it should perhaps be a sender, but then, I
want to send as if from my gmail account; and more, even from gmail
web I can send under different names, but these are not arbitrary, but
must have been varified in advance. So should there stand any of these
addresses I can use when sending from the web interface?

Thanks for help!

Ruda
Richard Miller
2011-09-14 12:41:25 UTC
Permalink
Post by Rudolf Sykora
smtp: bad network /net/tcp!bluestar!12345 (tcp!bluestar!12345)
This should have been corrected by the hg update. But update only
changes the source code - you still have to rebuild the command with
cd $PLAN9/src/cmd/upas/smtp
mk smtp.install
Post by Rudolf Sykora
so I tried
$PLAN9/bin/upas/smtp -ai 'tcp!128.141.146.215!12345'
250-mx.google.com at your service, [128.141.146.215]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH
250 ENHANCEDSTATUSCODES
but it does not seem like any email has been sent anywhere...
If the login to gmail smtp server is not successful, smtp just exits
quietly.

Since you are using 128.141.146.215 as the server name, you have to
use 'server=128.141.146.215' instead of 'server=bluestar' in the
factotum entry.
Rudolf Sykora
2011-09-19 13:08:21 UTC
Permalink
Post by Rudolf Sykora
smtp: bad network /net/tcp!bluestar!12345 (tcp!bluestar!12345)
This should have been corrected by the hg update.  But update only
changes the source code - you still have to rebuild the command with
 cd $PLAN9/src/cmd/upas/smtp
 mk smtp.install
Ok. I wonder how I could forget to rebuilt then, but I did.
Anyway, after rebuilding I get:

;$PLAN9/bin/upas/smtp -ai 'tcp!128.141.146.215!12345'
***@gmail.com ***@cern.ch <msg
Segmentation fault
;

... so still unsuccessful to send email...
Thanks for further comments.
I will also try to find out some details about the segmentation fault.

Ruda
David du Colombier
2011-09-20 07:48:58 UTC
Permalink
Post by Rudolf Sykora
Ok. I wonder how I could forget to rebuilt then, but I did.
;$PLAN9/bin/upas/smtp -ai 'tcp!128.141.146.215!12345'
Segmentation fault
;
I obtained the same behavior on Fedora 15. It doesn't happen
on earlier releases of Fedora, even when using the same
dynamically linked smtp binary.

Probably you updated something like glibc before rebuilding.

Program received signal SIGSEGV, Segmentation fault.
0x00000035db80edbb in raise () from /lib64/libpthread.so.0
--
David du Colombier
Rudolf Sykora
2011-09-21 15:48:07 UTC
Permalink
Hello,
Post by David du Colombier
I obtained the same behavior on Fedora 15. It doesn't happen
on earlier releases of Fedora, even when using the same
dynamically linked smtp binary.
Probably you updated something like glibc before rebuilding.
Program received signal SIGSEGV, Segmentation fault.
0x00000035db80edbb in raise () from /lib64/libpthread.so.0
--
David du Colombier
I don't quite understand whether this knowledge can help me or not...
Thanks for comments.
Ruda
David du Colombier
2011-11-16 19:12:48 UTC
Permalink
Post by Rudolf Sykora
;$PLAN9/bin/upas/smtp -ai 'tcp!128.141.146.215!12345'
Segmentation fault
Yesterday, I found time to fix this problem.

It happens when gethostbyname fail to resolve your hostname.

You can apply this patch:
http://codereview.appspot.com/download/issue5370105_1.diff

It hasn't been merged in plan9port yet, but I'm sure it will be soon.
--
David du Colombier
erik quanstrom
2011-09-10 11:54:04 UTC
Permalink
Post by Rudolf Sykora
but it does not seem like any email has been sent anywhere...
for. Plan9 man page says it should perhaps be a sender, but then, I
want to send as if from my gmail account; and more, even from gmail
when the man page refers to the command-like "sender" it
means the envelope sender. the envelope sender appears in unix mbox
format as the 'From ' line at the beginning of each message. this is
not the same as the 'From: ' line in the smtp header.

but none of this has anything to do with gmail's willingness to relay
mail.

- erik
Continue reading on narkive:
Loading...