From: Mateusz_madi on
Hi, i was wondering how to write a program in C to connect to mail
box, and read a messages on it. What i need to know to do it? Are tho
ere any simple open souce programs that i can look into to to figure
it out?
From: Rainer Weikusat on
Mateusz_madi <madi.czadi(a)gmail.com> writes:
> Hi, i was wondering how to write a program in C to connect to mail
> box, and read a messages on it. What i need to know to do it? Are tho
> ere any simple open souce programs that i can look into to to figure
> it out?

It is not possible to 'connect to a mailbox'. That's basically just a
named set of somehow related messages. 'mailboxes' are usually
accessed by connecting to some server implementing a suitable protocol
(for 'boxes', that would be IMAP). fetchmail is a C implementation of
an IMAP (and POP and ...) client but calling that 'simple' would be
quite of an understatement.
From: Gordon Burditt on
>Hi, i was wondering how to write a program in C to connect to mail
>box, and read a messages on it. What i need to know to do it? Are tho
>ere any simple open souce programs that i can look into to to figure
>it out?

Some neighborhood vandals drive by homes and connect to mailboxes
with a baseball bat. Occasionally they wreck their cars in the
process.

What you probably want is either:

(1) The way to open a UNIX *local* mailbox, with proper locking,
for a mail client to use, or
(2) The way to open an IMAP or POP3 connection to a mail server
and read messages on the connection.