[OCLUG-devel] help with sockets
Joshua Robinson
shooki.robinson at gmail.com
Sat May 10 10:34:52 PDT 2014
Greetings OCLugers,
Thank you ALL for suggestions, remarks & codes...finally got it to work !.
Current project I am the "bad" guy - I am writing a small SPAM program (run
inside our system ONLY) to generate dumi emails. Since I never did sockets
before need any help. I think got where to fake_addr should be, but CAN'T
figure where to put user_name, and how to attach an external file
(dumi_spam.txt)
here is some code fragments:
...
char user_name[100] = {0}, fake_add[100] = {0}, filename[100] = {0};
if (argc < 3) {
printf("Usage: -s <host> -u <user_name> -f <file_name>\n");
exit(1);
}
....
s_name = getservbyname("smtp", "tcp");
s_in.sin_port = s_name->s_port; //port 25
s_in.sin_family = AF_INET;
.....
printf("11"); //dbg
h_name = gethostbyname(fake_add);
//-Original- h_name = gethostbyname("scotty.test.static.org");
printf("22"); //dbg
....
Best Wishes,
Joshua Robinson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oclug.org/pipermail/oclug-devel/attachments/20140510/635f417f/attachment.html
More information about the OCLUG-devel
mailing list