Fred Long | 4 Nov 2011 15:35

can't send text containing \r without it being converted to octet attachment

How to reproduce:
echo -e "test\r" | mailx recipient
Is there any solution?

Thanks,

FL
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
nail-devel mailing list
nail-devel@...
https://lists.sourceforge.net/lists/listinfo/nail-devel
jgw | 14 Nov 2011 08:57

Difficulties with Acct-specific SMTP vars

Hello heirloom mailx users,
I'm trying to set up account-specific SMTP variables (see below) but am
not having much luck.  The heirloom mailx(1) manpage seems to suggest the
the proper form is "<smtp_var>-user <at> host=" where the user <at> host is taken
from the value of the "from" variable.  As can be seen, when used in this
way, no authentication occurs and the SMTP server issues a "Relaying
denied". Omiting "user <at> host" results in success.  No problems with
account-specific IMAP vars (been using them for years), just SMTP.

BTW, I also tried:

   "..-smtp_user <at> smtp_server="
   "..-me\ <at> foobar\.org="

No go. :/

Cheers,
Jeff

--
Sample sessions (names changed to protect the innocent..):

# ~/.nailrc

account foobar {
        set folder=imaps://me@.../mail/
        set hold
        set from=me@...
        set password-me@...="imap_passwd"
        ## SMTP server:
        set smtp=mx.foobar.org
        set smtp-auth-me@...=cram-md5
        set smtp-auth-user-me@...=smtp_user
        set smtp-auth-password-me@...="smtp_passwd"
        }

# mailx -v -A foobar someone@...
Subject: test - acct-specific smtp settings
testing 1 2 3
.

...
Resolving host mx.foobar.org . . . done.
Connecting to 192.94.73.19:587 . . . connected.
220 foobar.org ESMTP Sendmail 8.14.5/8.14.3; Mon, 14 Nov 2011 04:44:36 GMT
>>> HELO sleepy.cat
250 foobar.org Hello [216.99.214.24], pleased to meet you
>>> MAIL FROM:<me@...>
250 2.1.0 <me@...>... Sender ok
>>> RCPT TO:<someone <at> ...>
550 5.7.1 <someone@...>... Relaying denied. IP name lookup
failed [216.99.***.***]
smtp-server: 550 5.7.1 <someone@...>... Relaying denied. IP
name lookup failed [216.99.***.***]
"/var/tmp/dead.letter" 24/626
. . . message not sent.

--

# ~/.nailrc
account foobar {
        set folder=imaps://me@.../mail/
        set hold
        set from=me@...
        set password-me@...="imap_passwd"
        ## SMTP server:
        set smtp=mx.foobar.org
        set smtp-auth=cram-md5
        set smtp-auth-user=smtp_user
        set smtp-auth-password="smtp_passwd"
        }

# mailx -v -A foobar someone@...
Subject: test - global smtp settings
test msg
.

...
Resolving host mx.foobar.org . . . done.
Connecting to 192.94.73.19:25 . . . connected.
220 foobar.org ESMTP Sendmail 8.14.5/8.14.3; Mon, 14 Nov 2011 04:46:56 GMT
>>> EHLO sleepy.cat
250-foobar.org Hello [216.99.***.***], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE 100000000
250-ETRN
250-AUTH CRAM-MD5 DIGEST-MD5 PLAIN NTLM
250-DELIVERBY
250 HELP
>>> AUTH CRAM-MD5
334 PDExMDU5NTcyNTIuMTI2MjMyNDZAc2RmLmxvbmVzdGFyLm9yZz4=
>>> amd3LnNkZi5vcmcgNmQ1N2MzMDhlM2I4ZjExN2M3Y2M3OGY1MmQyYTBlNzg=
235 2.0.0 OK Authenticated
>>> MAIL FROM:<me@...>
250 2.1.0 <me@...>... Sender ok
>>> RCPT TO:<someone@...>
250 2.1.5 <someone@...>... Recipient ok
>>> DATA
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 pAE4kuvd027265 Message accepted for delivery
>>> QUIT
221 2.0.0 foobar.org closing connection

--

EOF

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
MJ Ray | 15 Nov 2011 13:24
Gravatar

Re: Difficulties with Acct-specific SMTP vars

jgw@...
> I'm trying to set up account-specific SMTP variables (see below) but am
> not having much luck.  The heirloom mailx(1) manpage seems to suggest the
> the proper form is "<smtp_var>-user <at> host=" where the user <at> host is taken
> from the value of the "from" variable.  [...]

I'm not sure, but smtp.c looks to me like user <at> host is taken from
the headers of email being sent, not the from variable.  My C is poor
and there aren't that many comments in heirloom, so I could be wrong.

Maybe you could use the ~H escape to make sure From is correct in
your test message?

Good luck!
--

-- 
MJ Ray (slef), member of www.software.coop, a for-more-than-profit co-op.
Webmaster, Debian Developer, Past Koha RM, statistician, former lecturer.
In My Opinion Only: see http://mjr.towers.org.uk/email.html
Available for hire for various work through http://www.software.coop/

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
Pierre-Jean | 18 Nov 2011 11:04
Picon

Re: Difficulties with Acct-specific SMTP vars

jgw@... wrote:

> Hello heirloom mailx users,
> I'm trying to set up account-specific SMTP variables (see below) but am
> not having much luck.  The heirloom mailx(1) manpage seems to suggest the
> the proper form is "<smtp_var>-user <at> host=" where the user <at> host is taken
> from the value of the "from" variable.  As can be seen, when used in this
> way, no authentication occurs and the SMTP server issues a "Relaying
> denied". Omiting "user <at> host" results in success.  No problems with
> account-specific IMAP vars (been using them for years), just SMTP.
>
> BTW, I also tried:
>
>    "..-smtp_user <at> smtp_server="
>    "..-me\ <at> foobar\.org="
>
> No go. :/
>

It seems to me that you've found the solution, but didn't knew it!

I am using:

account foo {
	set from=me@...
	set password-me@...="imap_passwd"
	set smtp=smtp.foo.org
	set smtp-auth-user="me@..."
	set smtp-auth-passwd="smtp_passwd"
}

account bar {
	set from=me@...
	set password-me@...="imap_passwd"
	set smtp=smtp.bar.org
	set smtp-auth-user="me@..."
	set smtp-auth-passwd="smtp_passwd"
}

And I can send mails using account specific smtp:

$ mailx -A foo someone@...
Resolving host smtp.foo.org . . . done.
220 relay3-d.mail.foo.org ESMTP Postfix

$ mailx -A bar someone@...
Resolving host smtp.bar.org . . . done.
220 mwinf8512-out ME ESMTP server ready

Bye,

Pierre-Jean.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
jgw | 18 Nov 2011 15:33

Re: Difficulties with Acct-specific SMTP vars

Pierre-Jean <sygne@...> wrote:

> jgw@... wrote:
>
> > Hello heirloom mailx users,
> > I'm trying to set up account-specific SMTP variables (see below) but am
> > not having much luck.  The heirloom mailx(1) manpage seems to suggest the
> > the proper form is "<smtp_var>-user <at> host=" where the user <at> host is taken
> > from the value of the "from" variable.  As can be seen, when used in this
> > way, no authentication occurs and the SMTP server issues a "Relaying
> > denied". Omiting "user <at> host" results in success.  No problems with
> > account-specific IMAP vars (been using them for years), just SMTP.
> >
> > BTW, I also tried:
> >
> >    "..-smtp_user <at> smtp_server="
> >    "..-me\ <at> foobar\.org="
> >
>
>
> It seems to me that you've found the solution, but didn't knew it!
>
> I am using:
>
> account foo {
> 	set from=me@...
> 	set password-me@...="imap_passwd"
> 	set smtp=smtp.foo.org
> 	set smtp-auth-user="me@..."
> 	set smtp-auth-passwd="smtp_passwd"
> }
>
> account bar {
> 	set from=me@...
> 	set password-me@...="imap_passwd"
> 	set smtp=smtp.bar.org
> 	set smtp-auth-user="me@..."
> 	set smtp-auth-passwd="smtp_passwd"
> }
>
> And I can send mails using account specific smtp:
> ...

Thanks for the reply.  This of course works but isn't what I was asking about.
Also, it the above now requires you to reset the various SMTP-related variables
if moving between multiple IMAP accounts in a single mailx session.  That seems
to be what the ..-user <at> host= variables are for.  And they work for IMAP, just
not for SMTP, at least not in the way I'm interpreting the manpage.  To quote
from mailx(1):

  ...
  smtp-auth
                Sets the SMTP authentication method.  If set to  `login',
                or  if  unset  and  smtp-auth-user  is set, AUTH LOGIN is
                used.  If set to `cram-md5', AUTH CRAM-MD5  is  used;  if
                set  to  `plain', AUTH PLAIN is used.  Otherwise, no SMTP
                authentication is performed.

  smtp-auth-user <at> host
                Overrides  smtp-auth  for  specific  values   of   sender
                addresses, depending on the from variable.
  ...

The IMAP-related vars are described similarly and work as described, so I don't
think I'm misinterpreting the manpage.

Per the previous reply, I tried explicitly setting 'from' with the same result:
the ..-user <at> host vars get set but not used.   I've poked around some in the code
but I'm not very proficient in C and nothing stands out WRT patching.

Jeff

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
Pierre-Jean | 19 Nov 2011 21:41
Picon

Re: Difficulties with Acct-specific SMTP vars


Hello,

jgw@... wrote:

> Thanks for the reply.  This of course works but isn't what I was asking about.
> Also, it the above now requires you to reset the various SMTP-related variables
> if moving between multiple IMAP accounts in a single mailx session.  That seems
> to be what the ..-user <at> host= variables are for.  And they work for IMAP, just
> not for SMTP, at least not in the way I'm interpreting the manpage. 

So, sorry, but I can't help you more...

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d

Gmane