Home > Archive > AWK > January 2006 > Anyone every implement a mail client in awk?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Anyone every implement a mail client in awk?
|
|
| Joe User 2006-01-29, 9:55 pm |
|
I have heard several times how easy it would be to make a mail client
using gawk and their tcp/ip extensions.
Has anyone ever seen one done?
I just installed Damn Small Linux on an old machine, and I would like to
be able to programmatically mail things to my newer machine over the
intranet.
Thanks.
--
First they ignore you, then they laugh at you,
then they fight you, then you win.
-- Mahatma Ghandi
| |
| William Park 2006-01-29, 9:55 pm |
| Joe User <axyz@yahoo.com> wrote:
>
> I have heard several times how easy it would be to make a mail client
> using gawk and their tcp/ip extensions.
>
> Has anyone ever seen one done?
>
> I just installed Damn Small Linux on an old machine, and I would like to
> be able to programmatically mail things to my newer machine over the
> intranet.
man mail nail mutt
--
William Park <opengeometry@yahoo.ca>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
http://freshmeat.net/projects/bashdiff/
| |
| Juergen Kahrs 2006-01-30, 3:55 am |
| Joe User wrote:
> I have heard several times how easy it would be to make a mail client
> using gawk and their tcp/ip extensions.
>
> Has anyone ever seen one done?
Yes, you can find a very simplistic email client here
in the official doc of gawk:
http://www.gnu.org/software/gawk/ma...inet.html#Email
These 16 lines of AWK are enough for basic work,
but not very convenient. I once heard that Arnold
Robbins tried to write a more complete client, but
I dont remember if he made his code available.
> I just installed Damn Small Linux on an old machine, and I would like to
> be able to programmatically mail things to my newer machine over the
> intranet.
William Park is probably right when he says that
tools already exist for this purpose.
| |
| Joe User 2006-01-30, 6:56 pm |
| On Mon, 30 Jan 2006 10:09:56 +0100, Juergen Kahrs wrote:
> Joe User wrote:
>
>
> Yes, you can find a very simplistic email client here in the official doc
> of gawk:
>
> http://www.gnu.org/software/gawk/ma...inet.html#Email
>
> These 16 lines of AWK are enough for basic work, but not very convenient.
> I once heard that Arnold Robbins tried to write a more complete client,
> but I dont remember if he made his code available.
Thanks. I was looking for that document, but googling did not suffice.
It does not appearantly show how to SEND mail, but I think I can figure it
out, in time.
--
The shepherd drives the wolf from the sheep's throat,
for which the sheep thanks the shepherd as his liberator,
while the wolf denounces him for the same act....
Plainly the sheep and the wolf are not agreed upon a
definition of liberty.
-- Former President Abraham Lincoln
| |
| Jürgen Kahrs 2006-01-30, 6:56 pm |
| Joe User wrote:
>
> Thanks. I was looking for that document, but googling did not suffice.
>
> It does not appearantly show how to SEND mail, but I think I can figure it
> out, in time.
Yes, sending email can also be done in a script of
similar length. But remember to use the SMTP protocol,
which is defined in a different RFC and uses a different
"well-known port number".
| |
| Todd Coram 2006-01-30, 6:56 pm |
| I have a ~40 line gawk function that sends email through SMTP (with an
additional 40 lines to handle base64 AUTH authentification if you need
to do that). If you want it, let me know.
/todd
t**d at maplefish dot com
| |
| William Park 2006-01-30, 6:56 pm |
| Joe User <axyz@yahoo.com> wrote:
> On Mon, 30 Jan 2006 10:09:56 +0100, Juergen Kahrs wrote:
>
>
> Thanks. I was looking for that document, but googling did not suffice.
>
> It does not appearantly show how to SEND mail, but I think I can figure it
> out, in time.
When everything is working, talking to remote port 25 is easy. If you
can talk to POP3 server, then you can talk to SMTP server. Try few
'telnet' sessions. The killer, of course, is handling of errors.
If interested, take a look at my POP3 script at
http://freshmeat.net/projects/popchecksh
--
William Park <opengeometry@yahoo.ca>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
| |
| John DuBois 2006-01-30, 6:56 pm |
| In article <pan.2006.01.30.16.14.13.104214@yahoo.com>,
Joe User <axyz@yahoo.com> wrote:
>On Mon, 30 Jan 2006 10:09:56 +0100, Juergen Kahrs wrote:
>
....[color=darkred]
>It does not appearantly show how to SEND mail, but I think I can figure it
>out, in time.
Here's one that only sends:
ftp://ftp.armory.com/pub/admin/awkmail
It isn't quite what you're looking for; it uses a telnet coprocess instead
of gawk's tcp capability because the built-in capability does not include
timeouts, without which you will encounter situations in which your smtp
client hangs forever. I tried to write it in such a way that it would be
straightforward to convert to use the internal tcp capability if/when gawk
acquires IO timeouts; you could probably do that pretty easily if you aren't
concerned about hangs.
Use -h for help. It is really a utility for testing all sorts of mail
submission protocols. An example of using it for smtp submission:
echo "This is my test body" | awkmail -pD -s"Test mail" someone@domain.org
John
--
John DuBois spcecdt@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/
| |
| Joe User 2006-01-30, 9:55 pm |
| On Mon, 30 Jan 2006 12:48:46 -0800, Todd Coram wrote:
> I have a ~40 line gawk function that sends email through SMTP (with an
> additional 40 lines to handle base64 AUTH authentification if you need to
> do that). If you want it, let me know.
>
> /todd
> t**d at maplefish dot com
Yes, I have sent you a seperate e-mail and I want to thank those who
responded for their help.
-- WB
--
Time sure flies when you don't know what
you're doing.
-- slashdot.org
|
|
|
|
|