LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-18-2006, 02:10 AM   #1
aaronruss
Member
 
Registered: Mar 2004
Posts: 90

Rep: Reputation: 15
Running CGI on FC3


I have installed CGI 1.6 from MIT's web site. every thing looks good when I use the sample test page I get a message that says my information was sent.

The issue is I never get the email I have check the template and all looks good.

Could it be a issue with sendmail?

The address where I downloaded the source is

http://web.mit.edu/wwwdev/cgiemail/w....html#download

Can any one help?

Last edited by aaronruss; 01-18-2006 at 02:11 AM.
 
Old 01-18-2006, 02:23 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Well, you could start by giving us some configuration details. For instance, do you send mail to a mail server, deliver it locally on the same machine, etc.
Next, you should verify that sendmail is configured properly and is up and running.
Sendmail is an MTA (mail transport agent) - often called a mail server - and listens to port 25 on a certain network interface (loopback interface by default probably) for incoming mails (SMTP protocol).

All that the website does is probably open a connection to port 25 on the same machine (if it knows SMTP) or call the "sendmail" binary directly (the sendmail program itself also supports sending mail from the command line).

You could also check sendmail's logs in /var/log/something for clues. Checking the mail queue with the "mailq" command is also a good idea. If a mail stays in the queue for quite some time, it's probably due to an error (sending out mails doesn't take very long normally).

Finally, what do you try to accomplish using the cgiemail stuff? I haven't used that myself.
 
Old 01-18-2006, 09:43 AM   #3
aaronruss
Member
 
Registered: Mar 2004
Posts: 90

Original Poster
Rep: Reputation: 15
The CGI mail program takes the html form input and sends it in an email to another server. This is what I want to accomplish.

I did the mailq and have found the mail is listed there here is an example.

Deferred: Connection reset by email.com
Myaccount@email.com


When looking in the log I have something like this

Jan 18 10:36:58 localhost sendmail[****] ******** : to=myaccount@email.com > ctladdr=<apache@localhost.localdomain> 48/48 delay=18:22:05 xdelay=00:00:00, mailer=esmtp pri=1740513 relay-email.com dsn=4.0.0 stat=Deferreed Connection reset by email.com


every thing is install as default. apachie intalled with FC3 so did send mail the cgi program that was downloaded from MIT is configred with default settings.

What do I do now?

Last edited by aaronruss; 01-18-2006 at 09:47 AM.
 
Old 01-18-2006, 09:56 AM   #4
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
A "deferred" email is typically related to a temporary unavailability of the mail server at the domain email.com.
In short, this means that email.com can't handle your mail now, since it's too busy with other mails.
It will get to handling your mail as soon as possible (automatically).
If you don't see your mail, let's say after 1 day or so, then there is definitely a problem.
In such a case, I'd advise you to check the logs once more.

It is however reassuring to know that your CGI script has been able to reach email.com to send the mail
(assuming that's what you wanted). Again, if you didn't want to send an e-mail to someone at email.com, then
you have misconfigured your destination e-mail address.
 
Old 01-18-2006, 11:24 AM   #5
aaronruss
Member
 
Registered: Mar 2004
Posts: 90

Original Poster
Rep: Reputation: 15
sendmail

Yes this is what I want and It has been over a day. I have tried sending the message from two different networks and on two different linux boxes. The sendmail is the default install with FC3.

I have talked with the postmaster of one of the receiving email server and he is also looking in to the issue on his end.

Ive tried to send the message to two different email domains.

When I type mail on my linux box I see the messages saying they are Deferred: Connection reset by email.com
Warning: message still undelivered after 4 hours

Keep in mind some of the messages are still in the Que after a day.

I think it has something to do with sendmail on my local linux box.
What do I do next?
 
Old 01-18-2006, 04:37 PM   #6
aaronruss
Member
 
Registered: Mar 2004
Posts: 90

Original Poster
Rep: Reputation: 15
After looking at some different websites I am starting to wornder if this could have any thing to do with the ctladdr=<apache@localhost.localdomain> in my log file.

Seeing this is a local address and can not be resloved by the receiving email server.

My issues are possibley due to not running a DNS server. I am currently using the DNS server address that is given to me with my DHCP IP address. and to my knowlage no MX records have been added to the DNS server.


Could this be the issue?

Is there any way to change the ctladdr when sending out a email?
 
Old 01-19-2006, 03:03 AM   #7
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
The fact that your DNS doesn't include a mail server for your domain can play a role. By default, sendmail listens to port 25 on the "localhost" interface (IP 127.0.0.1). If your CGI program doesn't contact the mailserver on "localhost", but instead uses for instance the fully qualified hostname (==hostname + domain), then it may be looking for a mail server in your domain, without finding one.
However, since sendmail is clearly seeing the message (it is queueing it), I doubt that this is the case.

Can you please check all your system logs (in /var/log typically) and post every relevant message?

As for the ctladdr, I'm not sure. I think it's the e-mail sender address or maybe the envelope address.
You could try changing it.
Remote mail server may deny e-mails if they come from an unexisting domain (as part of spam countermeasures for instance).
So, I would recommend that you do some research/reading on the subject of the ctladdress and maybe even try to modify it to see if that helps.
 
Old 01-19-2006, 12:26 PM   #8
aaronruss
Member
 
Registered: Mar 2004
Posts: 90

Original Poster
Rep: Reputation: 15
[root@fc3 log]# cat maillog
Jan 19 13:04:32 fc3 sendmail[1966]: alias database /etc/aliases rebuilt by root
Jan 19 13:04:32 fc3 sendmail[1966]: /etc/aliases: 69 aliases, longest 10 bytes, 679 bytes total
Jan 19 13:04:32 fc3 sendmail[1971]: starting daemon (8.12.11): SMTP+queueing@01:00:00
Jan 19 13:04:32 fc3 sendmail[1971]: STARTTLS=server: file /etc/mail/certs/cert.pem unsafe: No such file or directory
Jan 19 13:04:33 fc3 sm-msp-queue[1980]: starting daemon (8.12.11): queueing@01:00:00
Jan 19 13:04:56 fc3 sendmail[1972]: k0JHvLSI002605: to=<target@email.com>, ctladdr=<root@myhost.name> (0/0), delay=00:06:55, xdelay=00:00:23, mailer=esmtp, pri=120303, relay=email.com. [*.*.*.*], dsn=4.0.0, stat=Deferred: Connection reset by email.com.

I have replaced the domain names and IP address for security reasons.
one note about [*.*.*.*] This IP I am getting is a public IP address.

[root@fc3 log]# mailq
/var/spool/mqueue (1 request)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------k0JJXRlG002569 5 Thu Jan 19 14:33 <root@fc3.email.com>
(reply: read error from email.com.)
<target@email.com>
Total requests:

You are right about The CIG program. It does send it to sendmail and it gets spooled. The remote server is rejecting the incomming mail for some reason.

I have even tried by using the mail command at the console. as listed above in the logs.

If the mail server is rejecting due to me not having a registered domain name what options do I have that dose not require getting a registered domain name?

can I make my linux box part of the same domain the email server is in? And how? would adding a hostA record and an MX recoard the the email domain help?

Last edited by aaronruss; 01-19-2006 at 12:46 PM.
 
Old 01-20-2006, 02:21 AM   #9
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Have you tried looking up the mail server of email.com (ie via nslookup)
and doing a telnet to that server, on port 25 (the SMTP port).
If you can't reach the mail server on port 25, then your mail won't get through, I believe.

Have you tried sending out a mail using /bin/mail?

You probably don't need a registered domain name. Think of all the people at home that just send out mails.

Quote:
<root@fc3.email.com>
Does this mean that your host is part of the email.com domain? Try doing "hostname" or "uname -a" to find out.
I was under the impression that you're sending a mail to some external mail server. If your host (and your sendmail) however believe that you are part of email.com, it may try to simply deliver the mail (if sendmail is configured for local delivery).

Please post /etc/hosts and /etc/resolv.conf.
 
Old 01-25-2006, 11:12 PM   #10
aaronruss
Member
 
Registered: Mar 2004
Posts: 90

Original Poster
Rep: Reputation: 15
No im not part of that domain Im just trying to trick it by adding that line in the host and having the DNS administrator create a host A record and a MX record to point back to me. All Of this is on a private network accross different domains.
 
Old 01-26-2006, 01:44 AM   #11
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
First of all, if you're not part of the domain email.com, why do you want to pretend to be their mail server?
If this were at all possible, it may be considered as computer fraud (spoofing). Secondly, I doubt very much that you can "make" yourself a member of someone else's domain just by adding some records to your DNS server.
Or were you talking about email.com's DNS server?

Secondly, is the domain email.com under your control? ie have you bought the domain name "email.com"?
If not, then what you're doing is probably illegal and I won't help you.
 
Old 01-27-2006, 02:29 PM   #12
aaronruss
Member
 
Registered: Mar 2004
Posts: 90

Original Poster
Rep: Reputation: 15
yes we have have control of our domain we have many domains. email.com is just a made up name to repersent ours I am on a private network that is not email.com the DNS server is ours and every thing we are doing is legal because we own it.

the reason I am trying to add DNS records to our domain for this linux box is for routing across subnets.

now for the info your requested and of course its has all been masked for security reasons. I can not post real names and ip address.

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 computer.domain.com computer localhost.localdomain localhost
Private IP computer.domain.com computer
public IP email.com


resolve.conf

nameserver *.*.*.* (private IP address)

OK when it all comes down to it I want to have a private webserver send some form information to our email server. the CGI mail part works and send mail spools it but I get error message differed email server reset connection it will not accept mail from me. I dont understand why the email server will not receive mail from my linux box. This is all I want to do is send mail when some one summits a webform.

PS please remove the above comment now we have the legal issue clear.

Last edited by aaronruss; 01-27-2006 at 02:58 PM.
 
Old 01-30-2006, 02:10 AM   #13
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Sorry. But I had to make sure.

If I understood you correctly, you have:
-a linux box with a webserver and sendmail that is supposed to send e-mails out via a mail server (ie a central mail server that handles mails for all your domains);
-a DNS server for hostname/IP lookups
-DHCP, so dynamic IP addresses. The DNS server's IP address is also distributed by DHCP.
-A mail server, configured by someone else, for your domains.

First of all, I would like to point out that, in your /etc/hosts file, you shouldn't mention the same computer name on the lines for the localhost interface (IP = 127.0.0.1) and for you private IP.
If you have put the same "computer.domain.com" and "computer" entries on those 2 lines, then you'll only confuse your system (when it encounters your hostname or fully qualified domain name, it won't know to which IP address it should be translated and will probably use the first entry - localhost - which may be what you want).

As I already mentioned, have you tried connecting to the mail server via port 25, by doing a simple telnet?
If that fails, then your mails won't get through either.

Since you have a separate mail server, the sendmail on your webserver should be configured:
-to listen to port 25 on localhost interface only (so that it will disregard any mails incoming from other machines)
-no local mail delivery (unless you want to deliver mails to some users of your web server)
-probably also no relaying.
Can you confirm that your sendmail is configured in this way?

If the mail server and the web server are 2 different machines, then your MX record needs to point to the mail server, not the web server.

Furthermore, I believe that, if sendmail doesn't deliver the mail locally (=on the machine it is running, so on your web server), it will try to contact the destinations e-mail server via the MX record for that domain.
So, it will use DNS to find the MX record and then try to open a connection to port 25 on that host.

If your webserver isn't allowed to send out mails outside your domain (ie for security, by firewall rules, etc), but instead needs to send every mail to your central mail server which will then send it out (=to someone outside your domains) in it's place, then your mail server must be configured for relaying of messages originating from your domain(s).
 
Old 02-27-2006, 02:21 PM   #14
aaronruss
Member
 
Registered: Mar 2004
Posts: 90

Original Poster
Rep: Reputation: 15
I can connect to the mail server with telnet.

the sendmail is a default install that come with FC2
and I can send local mail to local linux users. I dont really need to but I can.

Im not sure how to check the sendmail settings you are
asking for. where do I look?
 
Old 02-28-2006, 02:58 AM   #15
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
A simple solution would be to add some alias configurations that would forward any mail that has one of the local users (of the web server) as destination, to the full e-mail address.
Aliases of the form:
user1 : user1@mailserver.yourdomain
should do that trick (user1 is a local user, user1@mailserver.yourdomain is the full e-mail address that the mail needs to be sent to)
The "mailserver." is probably optional, if the MX record in your domain's DNS server points to the mail server.
The annoying thing about this solution is that you need to update your aliases each time a new user is added.

An alternate solution would be to configure sendmail to send all mails to your mail server (no local delivery).
However, I'm no sendmail configuration expert, so I can't help you with that. Personally, I don't even use sendmail, I use postfix instead and a small program called "nail" to send mails via SMTP directly.

Your sendmail config is probably somewhere in /etc/sendmail or something like that.
With the default config, if I'm not mistaken, sendmail:
-will only accept mails originating from the machine it's running on (it listens to port 25 of the localhost interface) - which is fine for you;
-doesn't do any relaying - maybe you'll need this to forward all mails to the mail server
-does local delivery - should be changed to delivery at your mail server. I'm not sure how, though.
 
  


Reply

Tags
sendmail


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
running cgi as root prinski Programming 2 01-07-2007 11:43 AM
php running as CGI twk Programming 1 05-25-2004 08:26 AM
cgi running on apache foop37 Linux - Newbie 1 08-06-2003 09:34 AM
Running CGI version of PHP Agento- Linux - General 4 02-18-2003 06:39 PM
Need help for running perl/cgi... raymond Linux - General 2 11-20-2002 08:20 AM


All times are GMT -5. The time now is 04:34 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration