Rajko Albrecht | 6 Jan 2004 22:58
Picon

SMTP & TLS

Hi,
is something known about TLS support for SMTP? It seems it isn't implemented 
yet but I would require that. Or had I something misunderstood?

Bye

Alwin

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Gaël Roualland | 7 Jan 2004 04:33

Re: SMTP & TLS

Rajko Albrecht a écrit :
> 
> Hi,
> is something known about TLS support for SMTP? It seems it isn't implemented
> yet but I would require that. Or had I something misunderstood?

It is now available in CVS !

Call mailsmtp_socket_starttls(session), right after a successfull ehlo.
Feedback welcomed ;)

Gaël.

--

-- 
Gaël Roualland -+- gael.roualland@...

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
Alwin | 19 Jan 2004 14:42
Picon

Checking for closed/broken connections

Hi,

I've big problem with unstable network links and libetpan. Eg., how can I 
check if a connection is closed/broken when ein try to make a command?

Well, I hold the connection as long as possible and don't make a login on 
every command 'cause this would be a little bit senseless.

So I tried:

    if (m_imap) {
        err = mailimap_noop(m_imap);
        if (err!=MAILIMAP_NO_ERROR) {
	    err = mailimap_close( m_imap );
	    mailimap_free( m_imap );
	    m_imap = 0;
        } else {
            mailstream_flush(m_imap->imap_stream);
            return;
        }
    }

I thought it would be the best in the first step, but sometimes I get a 
runtime at this point. 

So, what is the best way to check the connection for sending a new command? 
may be, that I didn't see it in the documentation... 

Bye

(Continue reading)

DINH Viet Hoa | 20 Jan 2004 09:18
Picon
Favicon

Re: Checking for closed/broken connections

Alwin a écrit :

> I've big problem with unstable network links and libetpan. Eg., how can I
> check if a connection is closed/broken when ein try to make a command?
>
> So, what is the best way to check the connection for sending a new command?
> may be, that I didn't see it in the documentation...

The other solution is to try to run the command and if this fails,
reconnect to the server.

--

-- 
DINH Viet Hoa

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Alwin | 20 Jan 2004 12:17
Picon

Re: Checking for closed/broken connections

> The other solution is to try to run the command and if this fails,
> reconnect to the server.

Hm. As I did (login() will be called before every command).

Next thing, I had look around the connection handling 'cause we have real 
problems wenn the connection get unstable on SmartDevices like Sharp Zaurus 
or IPAQ.

And therefore I found a (possible) problem inside mailstream_socket.c (see 
patch appended)

- on some systems the tcp/ip environment will give a segfault when you try to 
read from a socket not marked as readable or it ends in a endless read 'cause 
you have the socket marked as blocking (why?)
-tcp/ip file-descriptors I think checking for exceptions is a good idea. There 
are such a lot of thing can going wrong...
- on most systems an application crashes trying writing on a socket not 
writeable (there are a lot of reasons for that possible). I think, you should 
check for that. In most times select will return immediately 'cause most 
sockets are writeable. But... its tcp/ip :) Means, I believe it would be 
better to check for write and exceptions via select (as made in the patch).

And last:

Why not using recv/send on tcp/ip sockets? In most cases it should be have a 
little better handling for that as pure read/write.
And why blocking sockets? it is a real problem: on smart devices you can easy 
lose the connection. In that case read/write hangs. forever in blocking mode 
and we have to kill the application. may be, that blocking sockets have a 
(Continue reading)

DINH Viet Hoa | 21 Jan 2004 10:39
Picon
Favicon

Re: Checking for closed/broken connections

Alwin a écrit :

> And therefore I found a (possible) problem inside mailstream_socket.c (see
> patch appended)

did you reroute SIGPIPE ?

> > - on some systems the tcp/ip environment will give a segfault when you try to
> read from a socket not marked as readable or it ends in a endless read 'cause
> you have the socket marked as blocking (why?)

you can set a mailstream_delay (or such thing like that) to set the delay.

> -tcp/ip file-descriptors I think checking for exceptions is a good idea. There
> are such a lot of thing can going wrong...

is this an alternative to sigpipe ?

> - on most systems an application crashes trying writing on a socket not
> writeable (there are a lot of reasons for that possible).

For example, when the socket is closed on the other side ?

> I think, you should
> check for that. In most times select will return immediately 'cause most
> sockets are writeable. But... its tcp/ip :) Means, I believe it would be
> better to check for write and exceptions via select (as made in the patch).

Then, I am waiting for further explaination about this (see my question).

(Continue reading)

Alwin | 21 Jan 2004 15:15
Picon

Re: Checking for closed/broken connections

On Wednesday 21 January 2004 10:39, you wrote:
> Alwin a écrit :
> > read from a socket not marked as readable or it ends in a endless read
> > 'cause you have the socket marked as blocking (why?)
>
> you can set a mailstream_delay (or such thing like that) to set the delay.
See remarks below: delay won't work with read/recv or write/send when socket 
is blocking. this is just for select.

> > -tcp/ip file-descriptors I think checking for exceptions is a good idea.
> > There are such a lot of thing can going wrong...
>
> is this an alternative to sigpipe ?
See comment to recv.

>
> For example, when the socket is closed on the other side ?
See remarks below: most important thing is when the low-level connection, eg. 
the interface is closed/broken, we have cable problems and so on. All the 
stuff UNDER the tcp/ip layer.

> > Why not using recv/send on tcp/ip sockets? In most cases it should be
> > have a little better handling for that as pure read/write.
>
> it is the same.
No.
with recv you can switch of "SIGPIPE" ;) see manpage about the flags from recv 
(third parameter). read just implements a standard-call on file-descriptors. 
recv / send gives an interface to the socket specials.

(Continue reading)

DINH Viet Hoa | 21 Jan 2004 18:35
Picon
Favicon

Re: Mail (etpan) crashes on storing mail

Alwin a écrit :

> Hi,
> I run into trouble with a specific IMAP server.
>
> even when I try to store a mail there, our application crashes. On other IMIAP
> server it works without any problems. Thats why I believe it is a problem
> within etpan.
> Reading mails from there isn't a problem, or all the other stuff. just when
> storing a mail from outside.
>
> 'cause I have no ideas anymore I would ask, if you can check that, I would
> give you an account on this server on an open port for checking the output.
>
> Sometimes it failes with a core inside mailimap_parse, but not allways. It
> seems, that someone is trashing the stack due a free on a non allocated
> variable or such. But this moment I have no idea, whats going wrong.
>
> Would be great, if you could help

I think that Melvin Hadasht solved the problem in a recent commit.

--

-- 
DINH Viet Hoa

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
(Continue reading)

Melvin Hadasht | 21 Jan 2004 19:56
Picon
Favicon

Re: Re: Mail (etpan) crashes on storing mail

Hi,

> > Sometimes it failes with a core inside mailimap_parse, but not allways. It
> > seems, that someone is trashing the stack due a free on a non allocated
> > variable or such. But this moment I have no idea, whats going wrong.
> >
> > Would be great, if you could help
> 
> I think that Melvin Hadasht solved the problem in a recent commit.

Yes, I had the same symptoms. It was a double-free problem. Please, 
checkout current CVS.

Cheers,

--

-- 
Melvin Hadasht

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

Gmane