diff options
Diffstat (limited to 'imap/imapd.c')
| -rw-r--r-- | imap/imapd.c | 33 | 
1 files changed, 22 insertions, 11 deletions
| diff --git a/imap/imapd.c b/imap/imapd.c index 56cdc61..095defb 100644 --- a/imap/imapd.c +++ b/imap/imapd.c @@ -714,7 +714,8 @@ static int store_mailbox(const char *tag, const char *mailbox,  			 time_t	timestamp,  			 struct imaptoken *curtoken,  			 unsigned long *new_uidv, -			 unsigned long *new_uid) +			 unsigned long *new_uid, +			 int *utf8_error)  {  	unsigned long nbytes=curtoken->tokennum;  	char	*tmpname; @@ -797,10 +798,8 @@ static int store_mailbox(const char *tag, const char *mailbox,  	if ((rfc2045_parser->rfcviolation & RFC2045_ERR8BITHEADER) &&  	    curtoken->tokentype != IT_LITERAL8_STRING_START)  	{ -		errmsg=" NO [ALERT] Your IMAP client does not appear to " -			"correctly implement Unicode messages, " -			"see https://tools.ietf.org/html/rfc6855.html\r\n"; -		errflag=1; +		/* in order to [ALERT] the client */ +		*utf8_error=1;  	}  	rfc2045_free(rfc2045_parser); @@ -1335,6 +1334,8 @@ void doNoop(int real_noop)  #endif  		new_maildir_info.msgs[j].copiedflag=  			current_maildir_info.msgs[i].copiedflag; +		new_maildir_info.msgs[j].err8bitflag= +			current_maildir_info.msgs[i].err8bitflag;  		++j;  	} @@ -1479,9 +1480,10 @@ static int doId()  		curtoken = nexttoken(); -		fprintf(stderr, "INFO: ID, user=%s, ip=[%s]", +		fprintf(stderr, "INFO: ID, user=%s, ip=[%s], port=[%s]",  			getenv("AUTHENTICATED"), -			getenv("TCPREMOTEIP")); +			getenv("TCPREMOTEIP"), +			getenv("TCPREMOTEPORT"));  		while ((k < 30) && (curtoken->tokentype != IT_RPAREN)) {  			k++; @@ -1819,9 +1821,10 @@ int log_deletions= cp && *cp != '0';  			}  			if (log_deletions) -				fprintf(stderr, "INFO: EXPUNGED, user=%s, ip=[%s], old_name=%s, new_name=%s: only new_name will be left\n", +				fprintf(stderr, "INFO: EXPUNGED, user=%s, ip=[%s], port=[%s], old_name=%s, new_name=%s: only new_name will be left\n",  					getenv("AUTHENTICATED"),  					getenv("TCPREMOTEIP"), +					getenv("TCPREMOTEPORT"),  					old_name, new_name);  			if (rename(old_name, new_name)) @@ -1857,9 +1860,10 @@ int log_deletions= cp && *cp != '0';  		}  		if (log_deletions) -			fprintf(stderr, "INFO: EXPUNGED, user=%s, ip=[%s], old_name=%s\n", +			fprintf(stderr, "INFO: EXPUNGED, user=%s, ip=[%s], port=[%s], old_name=%s\n",  				getenv("AUTHENTICATED"),  				getenv("TCPREMOTEIP"), +				getenv("TCPREMOTEPORT"),  				old_name);  		free(old_name);  	} @@ -3911,6 +3915,7 @@ static int append(const char *tag, const char *mailbox, const char *path)  	char access_rights[8];  	struct imaptoken *curtoken;  	int need_rparen; +	int utf8_error=0;  	if (access(path, 0))  	{ @@ -4030,7 +4035,7 @@ static int append(const char *tag, const char *mailbox, const char *path)  			  acl_flags_adjust(access_rights, &flags)  			  ? NULL:keywords,  			  timestamp, -			  curtoken, &new_uidv, &new_uid)) +			  curtoken, &new_uidv, &new_uid, &utf8_error))  	{  		libmail_kwmDestroy(keywords);  		unread('\n'); @@ -4052,12 +4057,18 @@ static int append(const char *tag, const char *mailbox, const char *path)  	}  	dirsync(path); +	if (utf8_error) { +		writes("* OK [ALERT] Your IMAP client does not appear to " +		       "correctly implement Unicode messages, " +		       "see https://tools.ietf.org/html/rfc6855.html\r\n"); +	}  	writes(tag);  	writes(" OK [APPENDUID ");  	writen(new_uidv);  	writes(" ");  	writen(new_uid); -	writes("] APPEND Ok.\r\n"); +	writes("] APPEND Ok."); +	writes("\r\n");  	return (0);  } | 
