Exemplo n.º 1
0
//
// Get range of messages to be fetched.
//
DTMailError_t
POP2Server::ptrans_fldstate_read(int *countp, int *newp)
{
    //
    // We should have picked up a count of messages in the user's
    // default inbox from the pop2_getauth() response.
    //
    if (_pound_arg == -1)
	return DTME_MailServerAccess_Error;

    // Maybe the user wanted a non-default folder.
    if (! is_inbox())
    {
	DTMailError_t	ok;
	
	ok = do_transaction("FOLD %s", _folder);
	if (DTME_NoError != ok) return ok;
	if (_pound_arg == -1) return DTME_MailServerAccess_Error;
    }

    *countp = _pound_arg;
    *newp = -1;

    return DTME_NoError;
}
Exemplo n.º 2
0
MailBox::MailBox(MailDatabase* maildb, string name): name(name), maildb(maildb)
{
	inbox = is_inbox(name);
	primary = is_primary(name);
	
	if (inbox) {
		path = maildb->get_maildir();
	}
	
	else {
		path = "." + name; 
			
		// Generate directorypath
		size_t index = 0;	
		while((index = path.find("/", index)) != string::npos)
			path.replace(index, 1, ".");
	
		path = maildb->get_maildir() + path + "/";
	}
}