Угу, пойдет.
Я бы еще злобнее подрезал там где он хостнейм и юзернейм тянет...
Code:
--- mini_sendmail.c.orig 2006-10-21 18:19:59 +0400
+++ mini_sendmail.c 2006-10-21 22:50:49 +0400
@@ -134,11 +134,7 @@
++argn;
}
-#ifndef WL600
username = getlogin();
-#else
- username = "WL600";
- //fprintf(stderr, "%s\n", username);
#endif
if ( username == (char*) 0 )
{
@@ -156,15 +152,15 @@
#endif /* DO_GETPWUID */
}
-#ifndef WL600
if ( gethostname( hostname, sizeof(hostname) - 1 ) < 0 )
show_error( "gethostname" );
-#else
- strcpy(hostname,"MAILER");
-#endif
if ( fake_from == (char*) 0 )
+#ifdef WL600
+ (void) snprintf( from, sizeof(from), "%s", argv[argn]);
+#else
(void) snprintf( from, sizeof(from), "%s@%s", username, hostname );
+#endif
else
if ( strchr( fake_from, '@' ) == (char*) 0 )
(void) snprintf( from, sizeof(from), "%s@%s", fake_from, hostname );
@@ -212,11 +208,7 @@
exit( 1 );
}
-#ifdef WL600
- (void) snprintf( buf, sizeof(buf), "MAIL FROM:<%s>", argv[argn] );
-#else
(void) snprintf( buf, sizeof(buf), "MAIL FROM:<%s>", from );
-#endif
send_command( buf );
status = read_response();
if ( status != 250 )