Code fuer ext. Mails entfernt.

Die Anbindung fuer externe EMails (nicht Intermud-Mails)
ist schon ewig inaktiv (seit der ersten Vorratsdatenspeicherung).
Es ist nicht absehbar, dass wir das wieder einfuehren. Daher
Code ganz entfernt.

Change-Id: Ibc302c3bb2532c880b68780d8a1b0e1eb268c988
diff --git a/secure/master.c b/secure/master.c
index cae4be1..22d4675 100644
--- a/secure/master.c
+++ b/secure/master.c
@@ -410,10 +410,6 @@
   for (i=sizeof(wl); i--; )
     set_extra_wizinfo(wl[i][WL_NAME], wl[i][WL_EXTRA] * 99 / 100);
 
-  // Dann noch Mails bearbeiten
-  mails_last_hour=0;
-  mailread();
-
   return;
 }
 
diff --git a/secure/master/network.c b/secure/master/network.c
index f60cc40..10beccb 100644
--- a/secure/master/network.c
+++ b/secure/master/network.c
@@ -60,165 +60,6 @@
     return (passwd == pwhash);
 }
 
-static int doReadMail( string file )
-{
-    string str, *lines, *parts, *tmp;
-    mixed *message;
-    int i, j;
-
-    if ( (i = file_size(file)) > 50000 || i < 5 ){
-        rm(file);
-        DEBUG( "Mail size invalid\n" );
-        return -1;
-    }
-
-    if ( !(str = read_bytes( file, 0, 50000 )) )
-        return -1;
-
-    if ( !(j = sizeof(lines = explode( str, "\n" ))) )
-        return -2;
-
-    i = 0;
-
-    while ( i < j && lines[i] != "" )
-        i++;
-
-    if ( i == j )
-        return -2;
-
- DEBUG( sprintf( "Have %d headerlines:\n", i ) );
-
-    message= allocate(9);
-    message[MSG_CC] = ({});
-    message[MSG_BCC] = ({});
-    message[MSG_BODY] = implode( lines[i..], "\n" );
-
-    for ( j = 0; j < i; j++ ){
-        parts = explode( lines[j], ":" );
-
-        if ( sizeof(parts) > 1 ){
-            str = lower_case(parts[0]);
-            parts[0] = implode( parts[1..], ":" );
-
-            switch (str){
-            case "subject":
-                message[MSG_SUBJECT] = parts[0];
-                break;
-
-            case "from":
-                DEBUG( "Found from\n" );
-                DEBUG( sprintf( "PARTS[0]=%s\n", parts[0] ) );
-                message[MSG_FROM] = mail_normalize(parts[0]);
-                message[MSG_SENDER] = parts[0];
-                DEBUG( sprintf( "FROM: %s\nSENDER: %s\n",
-                                message[MSG_FROM],
-                                message[MSG_SENDER] ) );
-                break;
-
-            case "cc":
-                DEBUG( sprintf("FOUND CC: %O\n", parts[0]) );
-                message[MSG_CC] += mk_rec_list(parts[0]);
-                break;
-
-            case "bcc":
-                DEBUG( sprintf("FOUND BCC: %O\n", parts[0]) );
-                message[MSG_BCC] += mk_rec_list(parts[0]);
-                break;
-
-            case "to":
-                DEBUG( sprintf("FOUND TO: %O\n", parts[0]) );
-                tmp = mk_rec_list(parts[0]);
-
-                if ( !message[MSG_RECIPIENT] )
-                    message[MSG_RECIPIENT] = tmp[0];
-
-                message[MSG_CC] += tmp;
-                break;
-
-            // Das MUD-TO: wird vom Perlskript als erste Headerzeile eingefuegt
-            case "mud-to":
-                DEBUG( sprintf("FOUND MUD-TO: %O\n", parts[0]) );
-                message[MSG_RECIPIENT] = mail_normalize(lower_case(parts[0]));
-                break;
-            }
-        }
-    }
-
-    // Eigentlichen Empfaenger aus CC: loeschen
-    message[MSG_CC] -= ({ message[MSG_RECIPIENT],
-                          message[MSG_RECIPIENT]+"@mg.mud.de",
-                          message[MSG_RECIPIENT]+"@morgengrauen.mud.de" });
-
-
- DEBUG( sprintf( "TO: %O\n", message[MSG_RECIPIENT] ) );
-    DEBUG( sprintf( "CC: %O\n", message[MSG_CC] ) );
-    DEBUG( sprintf( "BCC: %O\n", message[MSG_BCC] ) );
-
-    if ( !stringp(message[MSG_FROM]) )
-        return -2;
-
-    if ( !stringp(message[MSG_RECIPIENT]) ){
-        str = explode( file, "/" )[<1];
-        i = 0;
-        j = sizeof(str);
-
-        while ( i < j && str[i] <= '9' && str[i] >= '0' )
-            i++;
-
-        if ( i >= j )
-            return -2;
-        
-        message[MSG_RECIPIENT] = str[i..];
-  DEBUG( sprintf( "EMERGENCY RECIPIENT=%s\n", str[i..] ) );
-    }
-
-    rm(file);
-
-    // Da vom Master besser nichts von ausserhalb /secure #include't wird,
-    // direkt die '5'. Normalerweise hiesse der Aufruf:
-    // DeliverMail( message, NO_USER_ALIASES|NO_CARBON_COPIES );
-    "/secure/mailer"->DeliverMail( message, 5 );
-    return 1;
-}
-
-
-public void mailread()
-{
-    string *files;
-    int i;
-
-    DEBUG( "mailread called\n" );
-
-    if ( mails_last_hour >= MAX_MAILS_PER_HOUR )
-        return;
-
-    files = (get_dir( "/mail/inbound/*" )||({})) - ({ "..", "." });
-    i = sizeof(files);
-
-    while ( i-- && mails_last_hour < MAX_MAILS_PER_HOUR ){
-        DEBUG( "FOUND FILE \"" + files[i] + "\" ...\n" );
-        mails_last_hour++;
-
-        if ( doReadMail( "/mail/inbound/" + files[i]) < -1 ){
-            mixed message;
-
-            message = allocate(9);
-            mails_last_hour++;
-            rename( "/mail/inbound/" + files[i],
-                    "/secure/ARCH/MAIL/" + files[i] );
-            message[MSG_SENDER] = geteuid();
-            message[MSG_FROM] = getuid();
-            message[MSG_SUBJECT] = "Fehlerhafte Mail: /secure/ARCH/MAIL/" +
-                files[i];
-            message[MSG_RECIPIENT] = "mud@mg.mud.de";
-            message[MSG_BODY] = "Bitte Ueberpruefen!\n";
-            // NO_SYSTEM_ALIASES|NO_USER_ALIASES == 3
-            "/secure/mailer"->DeliverMail( message, 3 );
-        }
-    }
-}
-
-
 static void udp_query( string query, string host, int port )
 {
 #if __EFUN_DEFINED__(send_udp)
@@ -246,11 +87,6 @@
                             finger_single( lower_case(mess[2]), 0 ), "\n" );
         break;
 
-    case "mailread":
-        data = ({ "Okay" });
-        mailread();
-        break;
-
     default:
         data = ({ "Error: unknown request " + mess[1] + "\n" });
     }