tmueller | 3 Oct 2005 05:36
Favicon

Re: RFE: specifying SMTP server by cmdline option

>  It would be convenient to have a command line option, specifying SMTP 
>  server (with optional user, password and port). For example:

>  nail   -<OPT>  [user[:password] <at> ]host[:port]   recipient .....

 
>  Dmitry Butskoy

If you look through the man page (man nail), you will find the "account"
statement; further down you will find details about setting up for SMTP
and POP3.  So in your nail.rc file, you need a section where you define
an account.  I can put this message together, editing with elvis or vim
(open-source enhanced vi clones), including the headers, and naming this
file nail1.out, I can send it with

nail -A bluegrass -t < nail1.out

bluegrass is my account defined in /etc/nail.rc, and I will be in the
path where nail1.out is located, otherwise I could prepend nail1.out
with the path to that file.

You can even set up for authenticated SMTP if the server requires that.

Tom

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
(Continue reading)

Dmitry Butskoy | 3 Oct 2005 17:07
Picon

Re: Re: RFE: specifying SMTP server by cmdline option

>
>
> nail -A bluegrass -t < nail1.out
> 
> bluegrass is my account defined in /etc/nail.rc ...
>
Yes, I know that it is possible to specify smtp server/user/password 
now. But it requires a file editing first. I want a feature, when we can 
specify all such an information at command line immediately...

Dmitry Butskoy

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
Gunnar Ritter | 4 Oct 2005 16:51
Picon
Favicon

Re: Re: Re: RFE: specifying SMTP server by cmdline option

Dmitry Butskoy <buc@...> wrote:

> Yes, I know that it is possible to specify smtp server/user/password 
> now. But it requires a file editing first. I want a feature, when we can 
> specify all such an information at command line immediately...

What exactly is wrong with "env smtp=hostname nail ..."?

	Gunnar

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
Gunnar Ritter | 4 Oct 2005 17:46
Picon
Favicon

Re: Re: Re: RFE: specifying SMTP server by cmdline option

Dmitry Butskoy <buc@...> wrote:

> Gunnar Ritter wrote:
> >What exactly is wrong with "env smtp=hostname nail ..."?
> "env smtp=user <at> hostname nail ..."  will work too?...
> Nail is very useful for testing remote servers.
> With "nail -f imap://user <at> host" I can conveniently test an imap server, 
> etc. But to do the same things with SMTP servers, I currently must 
> either edit some files (nailrc), or play with environment, which is not 
> such convenient as with pop3/imap case...

But what is the crucial difference between, say,

    nail -S smtp=host recipient

and

    env smtp=host nail recipient

?

	Gunnar

P.S. Note that I do want to discuss this and similar issues on the
mailing list and not in private, Cc adjusted.

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
(Continue reading)

Dmitry Butskoy | 4 Oct 2005 17:58
Picon

Re: Re: Re: RFE: specifying SMTP server by cmdline option

Gunnar Ritter wrote:

>But what is the crucial difference between, say,
>
>    nail -S smtp=host recipient
>
>and
>
>    env smtp=host nail recipient
>  
>
"nail -S host recipient" -- 3 symbols (space, '-' and 'S'),
"env smtp=host nail recipient" -- 10 symbols... :)

Besides that the environment variant is much less elegant. Environment 
variables are used usually to change some things in underlaying 
libraries etc. To control a command itself, normally options are used.

>P.S. Note that I do want to discuss this and similar issues on the
>mailing list and not in private, Cc adjusted.
>  
>
Sure.

Dmitry Butskoy

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
(Continue reading)

Gunnar Ritter | 4 Oct 2005 19:18
Picon
Favicon

Re: Re: Re: RFE: specifying SMTP server by cmdline option

Dmitry Butskoy <buc@...> wrote:

> "nail -S host recipient" -- 3 symbols (space, '-' and 'S'),
> "env smtp=host nail recipient" -- 10 symbols... :)

No. If I assign a letter to each setting which somebody might want to
use on the command line, I will quickly run out of ASCII letters.

> Besides that the environment variant is much less elegant. Environment 
> variables are used usually to change some things in underlaying 
> libraries etc. To control a command itself, normally options are used.

Maybe, but use of environment variables has always been mailx/Berkeley
Mail style.

	Gunnar

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
Gunnar Ritter | 4 Oct 2005 20:47
Picon
Favicon

Re: Re: Re: RFE: specifying SMTP server by cmdline option

Gunnar Ritter <gunnarr@...> wrote:

> Dmitry Butskoy <buc@...> wrote:
> > "nail -S host recipient" -- 3 symbols (space, '-' and 'S'),
> > "env smtp=host nail recipient" -- 10 symbols... :)
> No. If I assign a letter to each setting which somebody might want to
> use on the command line, I will quickly run out of ASCII letters.

I have now introduced "-S variable=[value]", but for the given reason,
this is all you can get. The change should be available from the public
CVS repository within six hours at the latest (sf.net delay).

	Gunnar

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
Gunnar Ritter | 4 Oct 2005 20:48
Picon
Favicon

Re: RFE: passwords in URL

Dmitry Butskoy <buc@...> wrote:

>   A lot of Internet applications allow to specify passwords in URL, for 
> example:
> ftp://user:password <at> host/path
>   Certainly, it is unsafe and insecure way, but if a user want it, let 
> him do it...

RFC 2192, page 1, section 2, disallows this for IMAP URLs.

	Gunnar

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
Dmitry Butskoy | 5 Oct 2005 13:19
Picon

Re: Re: Re: RFE: specifying SMTP server by cmdline option

Gunnar Ritter wrote:
"nail -S host recipient" -- 3 symbols (space, '-' and 'S'), "env smtp=host nail recipient" -- 10 symbols... :)
No. If I assign a letter to each setting which somebody might want to use on the command line, I will quickly run out of ASCII letters.
I meant not "each settings", just for smtp-server...
I have now introduced "-S variable=[value]", but for the given reason, this is all you can get.
OK. Some useful feature anyway.

BTW, there can be another additional way to specify SMTP server, using a style of UNIX "rcp" command. I.e.:
  nail   smtp_host:recipient
  nail   login <at> host:user-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org
etc.
(It even looks a little better than my initial idea of making a special option).

> A lot of Internet applications allow to specify passwords in URL, > for > example: > ftp://user:password <at> host/path > RFC 2192, page 1, section 2, disallows this for IMAP URLs.
Sadly. :-|

As mailx, nail can be used in scripts for mail sending. Therefore there should be a possibility to obtain user password not from /dev/tty only...


             buc






Gunnar Ritter | 6 Oct 2005 01:10
Picon
Favicon

Re: Re: Re: RFE: specifying SMTP server by cmdline option

Dmitry Butskoy <buc@...> wrote:

> Gunnar Ritter wrote:
> >>>"nail -S host recipient" -- 3 symbols (space, '-' and 'S'),
> >>>"env smtp=host nail recipient" -- 10 symbols... :)
> >>No. If I assign a letter to each setting which somebody might want to
> >>use on the command line, I will quickly run out of ASCII letters.
> I meant not "each settings", just for smtp-server...

But you are not the first person who made a proposal to add a command
line option for whatever.

> style of UNIX "rcp" command. I.e.:
>   nail   smtp_host:recipient
>   nail   login <at> host:user@...
> etc.
> (It even looks a little better than my initial idea of making a special 
> option).

If you have a personal demand to specify an SMTP server with the smallest
amount of characters possible, write a shell script wrapper. In case it
has not become clear yet, I am not interested in optimizing this.

> >> A lot of Internet applications allow to specify passwords in URL, > for 
> >> example:
> >> ftp://user:password <at> host/path
> >>   
> >
> >RFC 2192, page 1, section 2, disallows this for IMAP URLs.
> >
> Sadly. :-|
>
> As mailx, nail can be used in scripts for mail sending. Therefore there 
> should be a possibility to obtain user password not from /dev/tty only...

Both the environment variable approach and the -S option can be used
to specify a password.

	Gunnar

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl

Gmane