Fix against hang when pop3 login fails

This commit is contained in:
Michiel Broek 2004-06-24 19:43:42 +00:00
parent 41b1428c5f
commit 8efb45e7a3
3 changed files with 69 additions and 62 deletions

View File

@ -16,6 +16,7 @@ v0.61.1 20-Jun-2004.
mbsebbs: mbsebbs:
Added user@domain login for pop3 mailboxes. Added user@domain login for pop3 mailboxes.
If pop3 login fails, the bbs won't hang.
mbsetup: mbsetup:
Added user@domain login for pop3 servers in screen 1.12. Added user@domain login for pop3 servers in screen 1.12.

View File

@ -43,10 +43,6 @@
void error_popmail(char *); void error_popmail(char *);
void error_popmail(char *umsg) void error_popmail(char *umsg)
{ {
char *p;
pop3_send((char *)"QUIT\r\n");
p = pop3_receive();
pop3_close(); pop3_close();
colour(LIGHTRED, BLACK); colour(LIGHTRED, BLACK);
printf("%s\r\n", umsg); printf("%s\r\n", umsg);
@ -136,6 +132,9 @@ void check_popmail(char *user, char *pass)
/* /*
* If nothing is retrieved from the POP3 mailbox, the user sees nothing. * If nothing is retrieved from the POP3 mailbox, the user sees nothing.
*/ */
if (CFG.UsePopDomain)
Syslog('+', "POP3: connect user %s@%s", user, CFG.sysdomain);
else
Syslog('+', "POP3: connect user %s", user); Syslog('+', "POP3: connect user %s", user);
if (pop3_connect() == -1) { if (pop3_connect() == -1) {
WriteError("Can't connect POP3 server"); WriteError("Can't connect POP3 server");

View File

@ -870,7 +870,7 @@ void s_intmailcfg(void)
mvprintw( 5, 5, "1.12 EDIT INTERNET MAIL AND NEWS PROCESSING"); mvprintw( 5, 5, "1.12 EDIT INTERNET MAIL AND NEWS PROCESSING");
set_color(CYAN, BLACK); set_color(CYAN, BLACK);
mvprintw( 7, 2, "1. POP3 node"); mvprintw( 7, 2, "1. POP3 node");
mvprintw( 8, 2, "2. User@domain"); mvprintw( 8, 2, "2. Usr@domain");
mvprintw( 9, 2, "3. SMTP node"); mvprintw( 9, 2, "3. SMTP node");
switch (CFG.newsfeed) { switch (CFG.newsfeed) {
case FEEDINN: mvprintw(10, 2, "4. N/A"); case FEEDINN: mvprintw(10, 2, "4. N/A");
@ -897,22 +897,29 @@ void s_intmailcfg(void)
mvprintw(17, 1, "11. UUCP aka"); mvprintw(17, 1, "11. UUCP aka");
mvprintw(18, 1, "12. Emailmode"); mvprintw(18, 1, "12. Emailmode");
mvprintw(12,42, "13. Articles"); mvprintw(13,42, "13. Articles");
mvprintw(13,42, "14. News mode"); mvprintw(14,42, "14. News mode");
mvprintw(14,42, "15. Split at"); mvprintw(15,42, "15. Split at");
mvprintw(15,42, "16. Force at"); mvprintw(16,42, "16. Force at");
mvprintw(16,42, "17. Control ok"); mvprintw(17,42, "17. Control ok");
mvprintw(17,42, "18. No regate"); mvprintw(18,42, "18. No regate");
set_color(WHITE, BLACK); set_color(WHITE, BLACK);
show_str( 7,16,64, CFG.popnode); show_str( 7,16,64, CFG.popnode);
show_bool(8,16, CFG.UsePopDomain); show_bool(8,16, CFG.UsePopDomain);
show_str( 9,16,64, CFG.smtpnode); show_str( 9,16,64, CFG.smtpnode);
show_str(10,16,64, CFG.rnewspath); switch (CFG.newsfeed) {
show_str(11,16,64, CFG.nntpnode); case FEEDINN: show_str(11,16,64, CFG.nntpnode);
show_bool(12,16, CFG.modereader); show_bool(12,16, CFG.modereader);
show_str(13,16,15, CFG.nntpuser); show_str(13,16,15, CFG.nntpuser);
show_str(14,16,15, (char *)"**************"); show_str(14,16,15, (char *)"**************");
break;
case FEEDRNEWS: show_str(10,16,64, CFG.rnewspath);
break;
case FEEDUUCP: show_str(10,16,64, CFG.rnewspath);
show_str(11,16,64, CFG.nntpnode);
break;
}
show_int(15,16, CFG.nntpdupes); show_int(15,16, CFG.nntpdupes);
show_aka(16,16, CFG.EmailFidoAka); show_aka(16,16, CFG.EmailFidoAka);
@ -977,7 +984,7 @@ void e_intmailcfg(void)
switch(select_menu(18)) { switch(select_menu(18)) {
case 0: return; case 0: return;
case 1: E_STR( 7,16,64, CFG.popnode, "The ^FQDN^ of the node where the ^POP3^ server runs.") case 1: E_STR( 7,16,64, CFG.popnode, "The ^FQDN^ of the node where the ^POP3^ server runs.")
case 2: E_BOOL( 8,16, CFG.UsePopDomain, "Use ^user@maildomain^to login the POP3 server.") case 2: E_BOOL( 8,16, CFG.UsePopDomain, "Use ^user@maildomain^ to login the POP3 server.")
case 3: E_STR( 9,16,64, CFG.smtpnode, "The ^FQDN^ of the node where the ^SMTP^ server runs.") case 3: E_STR( 9,16,64, CFG.smtpnode, "The ^FQDN^ of the node where the ^SMTP^ server runs.")
case 4: if (CFG.newsfeed == FEEDRNEWS) case 4: if (CFG.newsfeed == FEEDRNEWS)
strcpy(CFG.rnewspath, edit_pth(10,16,64, CFG.rnewspath, (char *)"The path and filename to the ^rnews^ command.", 0775)); strcpy(CFG.rnewspath, edit_pth(10,16,64, CFG.rnewspath, (char *)"The path and filename to the ^rnews^ command.", 0775));