diff options
Diffstat (limited to 'src/authmode.c')
-rw-r--r-- | src/authmode.c | 75 |
1 files changed, 2 insertions, 73 deletions
diff --git a/src/authmode.c b/src/authmode.c index 3fa5d95..1af40f0 100644 --- a/src/authmode.c +++ b/src/authmode.c @@ -2,7 +2,7 @@ authmode.c This file is part of GNU Anubis. - Copyright (C) 2003, 2004, 2005, 2007 The Anubis Team. + Copyright (C) 2003, 2004, 2005, 2007, 2008 The Anubis Team. GNU Anubis is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -589,78 +589,7 @@ anubis_authenticate_mode (struct sockaddr_in *addr) } else { - if (!(topt & T_LOCAL_MTA) && !session.mta) - { - anubis_error (EXIT_FAILURE, 0, - _("MTA has not been specified. " - "Set either REMOTE-MTA or LOCAL-MTA.")); - } - - /* - Protection against a loop connection. - */ - - if (!(topt & T_LOCAL_MTA)) - { - unsigned long inaddr; - struct sockaddr_in ad; - - memset (&ad, 0, sizeof (ad)); - inaddr = inet_addr (session.mta); - if (inaddr != INADDR_NONE) - memcpy (&ad.sin_addr, &inaddr, sizeof (inaddr)); - else - { - struct hostent *hp = 0; - hp = gethostbyname (session.mta); - if (hp == 0) - { - hostname_error (session.mta); - return EXIT_FAILURE; - } - else - { - if (hp->h_length != 4 && hp->h_length != 8) - { - anubis_error (EXIT_FAILURE, 0, - _("Illegal address length received for host %s"), - session.mta); - } - else - { - memcpy ((char *) &ad.sin_addr.s_addr, - hp->h_addr, hp->h_length); - } - } - } - if (ntohl (ad.sin_addr.s_addr) == INADDR_LOOPBACK - && session.anubis_port == session.mta_port) - { - anubis_error (EXIT_FAILURE, 0, - _("Loop not allowed. Connection rejected.")); - } - } - - alarm (300); - if (topt & T_LOCAL_MTA) - { - remote_server = make_local_connection (session.execpath, - session.execargs); - if (!remote_server) - { - service_unavailable (&remote_client); - return EXIT_FAILURE; - } - } - else - { - remote_server = make_remote_connection (session.mta, - session.mta_port); - if (!remote_server) - service_unavailable (&remote_client); - } - - alarm (900); + session_prologue (); smtp_session (); alarm (0); } |