Linux - SoftwareThis 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.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
There is less than 24 hours left to vote in the 2015 LinuxQuestions.org Members Choice Awards. Click here to go to the polls. Vote now and make sure your voice is heard!
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.
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.
After looking at some different websites I am starting to wornder if this could have any thing to do with the ctladdr=<email@example.com> 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?
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.
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.
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).
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.
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.
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
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.
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).
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 : firstname.lastname@example.org
should do that trick (user1 is a local user, email@example.com 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.