updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / mailcheck / 001_username.diff
blob22025a70d9b8e525dfa9e739a638f1965bf3eb00
1 ## 001_username.dpatch by Kevin Coyner <kcoyner@debian.org>
2 ##
3 ## DP: Username fix. Original diff from Martin Wickman <martin@wickman.com>
4 ## DP: mailcheck gets confused if username contains an @-sign. This simple
5 ## DP: patch fixes this. I also noticed that some pop3 servers don't understand
6 ## DP: the LAST command. Patch uses STAT information in this case.
7 ## DP: See Debian bug #272749
9 --- mailcheck-1.91.2/mailcheck.c~ 2001-05-11 22:38:50.000000000 +0200
10 +++ mailcheck-1.91.2/mailcheck.c 2004-09-21 21:08:17.000000000 +0200
11 @@ -188,7 +188,7 @@
12 else
13 strcpy (box, "INBOX");
14 /* determine username -- look for user@hostname, else use USER */
15 - p = strchr (h, '@');
16 + p = strrchr (h, '@');
17 if (p)
19 *p = '\0';
20 @@ -283,7 +283,7 @@
21 fgets (buf, BUF_SIZE, fp);
22 if (buf[0] != '+')
24 - fprintf (stderr, "mailcheck: Error Receiving Stats '%s@%s:%d'\n",
25 + fprintf (stderr, "mailcheck: Error Receiving STAT '%s@%s:%d'\n",
26 user, hostname, port);
27 return 1;
29 @@ -298,9 +298,9 @@
30 fgets (buf, BUF_SIZE, fp);
31 if (buf[0] != '+')
33 - fprintf (stderr, "mailcheck: Error Receiving Stats '%s@%s:%d'\n",
34 - user, hostname, port);
35 - return 1;
36 + /* Server does not support LAST. Assume total as new */
37 + *new_p = total;
38 + *cur_p = 0;
40 else