</command>
</term>
<listitem>Default global IMAP server. Arguments are: "host
- user pass [-i interval (in seconds)] [-f folder] [-p port]
- [-e command] [-r retries]". Default port is 143, default
+ user pass [-i interval (in seconds)] [-f 'folder'] [-p port]
+ [-e 'command'] [-r retries]". Default port is 143, default
folder is 'INBOX', default interval is 5 minutes, and
default number of retries before giving up is 5. If the
password is supplied as '*', you will be prompted to enter
</command>
</term>
<listitem>Default global POP3 server. Arguments are: "host
- user pass [-i interval (in seconds)] [-p port] [-e command]
+ user pass [-i interval (in seconds)] [-p port] [-e 'command']
[-r retries]". Default port is 110, default interval is 5
minutes, and default number of retries before giving up is
5. If the password is supplied as '*', you will be prompted
IMAP inbox by default. You can define individual IMAP
inboxes seperately by passing arguments to this object.
Arguments are: "host user pass [-i interval (in seconds)]
- [-f folder] [-p port] [-e command] [-r retries]". Default
+ [-f 'folder'] [-p port] [-e 'command'] [-r retries]". Default
port is 143, default folder is 'INBOX', default interval is
5 minutes, and default number of retries before giving up
is 5. If the password is supplied as '*', you will be
global IMAP inbox by default. You can define individual
IMAP inboxes seperately by passing arguments to this
object. Arguments are: "host user pass [-i interval (in
- seconds)] [-f folder] [-p port] [-e command] [-r retries]".
+ seconds)] [-f 'folder'] [-p port] [-e 'command'] [-r retries]".
Default port is 143, default folder is 'INBOX', default
interval is 5 minutes, and default number of retries before
giving up is 5. If the password is supplied as '*', you
global POP3 inbox by default. You can define individual
POP3 inboxes seperately by passing arguments to this
object. Arguments are: "host user pass [-i interval (in
- seconds)] [-p port] [-e command] [-r retries]". Default
+ seconds)] [-p port] [-e 'command'] [-r retries]". Default
port is 110, default interval is 5 minutes, and default
number of retries before giving up is 5. If the password is
supplied as '*', you will be prompted to enter the password
in your global POP3 inbox by default. You can define
individual POP3 inboxes seperately by passing arguments to
this object. Arguments are: "host user pass [-i interval
- (in seconds)] [-p port] [-e command] [-r retries]". Default
+ (in seconds)] [-p port] [-e 'command'] [-r retries]". Default
port is 110, default interval is 5 minutes, and default
number of retries before giving up is 5. If the password is
supplied as '*', you will be prompted to enter the password
if (type == IMAP_TYPE) {
tmp = strstr(arg, "-f ");
if (tmp) {
+ int len = 1024;
tmp += 3;
- sscanf(tmp, "%s", mail->folder);
+ if (tmp[0] == '\'') {
+ len = strstr(tmp + 1, "'") - tmp - 1;
+ if (len > 1024) {
+ len = 1024;
+ }
+ }
+ strncpy(mail->folder, tmp + 1, len);
} else {
strncpy(mail->folder, "INBOX", 128); // default imap inbox
}
break;
}
- strncpy(sendbuf, "a2 STATUS ", MAXDATASIZE);
+ strncpy(sendbuf, "a2 STATUS \"", MAXDATASIZE);
strncat(sendbuf, mail->folder, MAXDATASIZE - strlen(sendbuf) - 1);
- strncat(sendbuf, " (MESSAGES UNSEEN)\r\n",
+ strncat(sendbuf, "\" (MESSAGES UNSEEN)\r\n",
MAXDATASIZE - strlen(sendbuf) - 1);
if (imap_command(sockfd, sendbuf, recvbuf, "a2 OK")) {
fail++;
old_messages = mail->messages;
if (has_idle) {
- strncpy(sendbuf, "a4 SELECT ", MAXDATASIZE);
+ strncpy(sendbuf, "a4 SELECT \"", MAXDATASIZE);
strncat(sendbuf, mail->folder, MAXDATASIZE - strlen(sendbuf) - 1);
- strncat(sendbuf, "\r\n", MAXDATASIZE - strlen(sendbuf) - 1);
+ strncat(sendbuf, "\"\r\n", MAXDATASIZE - strlen(sendbuf) - 1);
if (imap_command(sockfd, sendbuf, recvbuf, "a4 OK")) {
fail++;
break;
fail++;
break;
}
- strncpy(sendbuf, "a2 STATUS ", MAXDATASIZE);
+ strncpy(sendbuf, "a2 STATUS \"", MAXDATASIZE);
strncat(sendbuf, mail->folder, MAXDATASIZE - strlen(sendbuf) - 1);
- strncat(sendbuf, " (MESSAGES UNSEEN)\r\n",
+ strncat(sendbuf, "\" (MESSAGES UNSEEN)\r\n",
MAXDATASIZE - strlen(sendbuf) - 1);
if (imap_command(sockfd, sendbuf, recvbuf, "a2 OK")) {
fail++;