[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-mailutils] figuring out mailuils...
From: |
Sergey Poznyakoff |
Subject: |
Re: [bug-mailutils] figuring out mailuils... |
Date: |
Tue, 12 May 2009 13:58:19 +0300 |
Alfred M. Szmidt <address@hidden> ha escrit:
> I am finding the documentation a bit lacking over what each function
> does, specially on a protocol basis.
Yes, that's true. The docs leave a lot to be desired.
> Does for example mu_mailbox_get_message remove messages when fetching
> from a POP3 server?
No, it does not. It only returns a message, as its name suggests,
nothing more.
Another important thing is that all mu_.* functions work the same way,
no matter what the type of the mailbox is (UNIX mbox, pop3, imap4,
anything).
> Does mu_attribute_set_deleted touched all messages when doing POP3?
Mu_attribute_set_deleted sets the `deleted' bit on the attribute object
given as its argument. That is, it operates on a single message.
> Is there some simple overview of how the protocol side is implemented?
Unfortunately, currently there is not. Feel free to ask for any piece
of info you might need.
> Where would the best place be to add some kind of a UIDL list (if a
> server supports it)--not file location, but codewise--of messages
> retrived, so one doesn't fetch duplicate messages?
I'd place it in the move_message function, like that:
int
move_message (mu_mailbox_t src, mu_mailbox_t dst, size_t msgno)
{
int rc;
mu_message_t msg;
char uidbuf[256];
if ((rc = mu_mailbox_get_message (src, msgno, &msg)) != 0)
{
fprintf (stderr, _("Cannot read message %lu: %s\n"),
(unsigned long) msgno, mu_strerror (rc));
return rc;
}
if ((rc = mu_mailbox_append_message (dst, msg)) != 0)
{
fprintf (stderr, _("Cannot append message %lu: %s\n"),
(unsigned long) msgno, mu_strerror (rc));
return rc;
}
/* <-- Here it goes --> */
/*
mu_message_get_uidl (msg, uidbuf, sizeof(uidbuf), NULL);
save_uid(uidbuf);
...
It is supposed that save_uid() does the main work.
Regards,
Sergey