It was being used here:
But I took it out and just replaced it with portno=25; because &tail wasn't declared anywhere (if I remember correctly). Since this will always be used for e-mail, I figured it was safe to assume a hard coded port of 25.
btw, thank you for helping with this. I'd be lost completely.
---------- Post updated at 11:45 AM ---------- Previous update was at 11:32 AM ----------
Oh, also - I've renamed all occurrences of the_socket to sockfd (including the class definition). Should I take out the declaration of sockfd at the beginning of get_connected() ?
Okay, so the second parameter is the port number, or service name, in the form of a character string.
Not all mail servers have the same port, I'm not sure it's safe to ignore it. Never understand why people still mess with strtol for short ints when they've got scanf. This code should do the job:
You need a 'struct servent *s;' up in the group of variables at the top. You'll need <stdio.h>, which I give good odds that you've included already. And you'll need to stop manually setting it to 25 of course. The htons() is needed since s->s_port is already swapped for you, and you do swapping below too, we just want it as a normal int here...
I tested it on service strings like "telnet", and arbitrary ports like "8888".
---------- Post updated at 11:41 AM ---------- Previous update was at 11:00 AM ----------
Quote:
Originally Posted by ctote
Oh, also - I've renamed all occurrences of the_socket to sockfd (including the class definition). Should I take out the declaration of sockfd at the beginning of get_connected() ?
Gack... I wouldn't have reccomended doing that. Before, the_socket would never have been changed. With the one change I suggested, it would never have been changed unless you knew for a fact that sockfd was valid. Now, it will never change because the local variable's the same name. Get rid of the local definition and it'll change all the time, potentially getting left at invalid values somewhere inbetween.
Just the one line the_socket=sockfd; right at the bottom of the connection function would have done without altering all your connection code.
---------- Post updated at 03:46 PM ---------- Previous update was at 12:42 PM ----------
Ok great. I'm getting a socket connection now!
Now the problem is still this segfault. I return out of my methods to this point:
And at get_smtp_line() != 220, I get a segfault. I'm just posting on the off chance you've seen this code before.
Hi,
I need to grant read permission to a normal user on sulog file on AIX 6.1.
As root I did acledit sulog and aclget shows "extended permissions" as "enabled" and normal user "splunk" has read permissions. When I try to access sulog as splunk user it won't allow and aclget for splunk user... (6 Replies)
Hello ,
I am working on AIX. I have to convert Unix timestamp to normal timestamp. Below is the file. The Unix timestamp will always be preceded by
EFFECTIVE_TIME as first field as shown and there could be multiple EFFECTIVE_TIME in the file : 3.txt
Contents of... (6 Replies)
Hi,
My OS version is AIX 7.1. I am trying to send an email with a file to my mail address. sendmail or uuencode does not work. Can someone give me the correct format ?
I use:
uuencode <file name> | mail -s "subject" emailaddress
Thanks
Use code tags, thanks. (3 Replies)
plzzz help me, I want to send emails for exchange group members when the used file-system % gets more than 90%, this notification must include df -g, netstat -i,and errpt with the hostname
thx in advance (0 Replies)
Hi,
I am trying to call sql script from ksh job with parameters.The parameters passed from ksh job will be used in SELECT query in sql file to SPOOL the data in extract file.My questions are:
1) How to call a sql script from ksh job with parameters?
2) How to use the parameter in sql file to... (1 Reply)
I have an Oracle database running on AIX, and I have a procedure that is calling OS commands from an oracle (and it's not working anymore)...
so, there was an Java stored proc in Oracle
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED COMMON."Host" as import java.io.*;
public class Host {... (1 Reply)
Hello everyone,
I am trying to create a forwarding scenario, and I do not seem to get it right!
I created a .forward file in the directory where my personal mailbox resides. In the file is the full address to deliver email to ... yet the emails do not seem to get forwarded.
Is there something... (3 Replies)
When we as normal user try to login, the session startup terminates and we are presented with the login screen.The root user is able to login without any problem.I can log in to the Aix server as normal user through telnet & using xmanager but not directly through server terminal .The Aix version... (1 Reply)
Hi,
Am jus trying to find the Total RAM Size of a AIX m/c (in MB)..svmon works perfectly for a superuser...But i want to achive this as a normal user...Please help me out with correct command..
Best Regards,
Muthukumaran.M (3 Replies)
I am new to the world of AIX. I want to get certified in AIX and learn it but fast. with in 3 months
Could you give me some advise of a good site that with teach you
or a bootcamp that is reasonable.
I am really in need
I am in atlanta (0 Replies)