[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 336
  • Last Modified:

Configuring sendmail for specific use

This ought to be so simple...

I'm trying to set up a simple comments form on our company website. It links to a perl script which sends the contents of the form to the webmaster email. The perl script utilizes the sendmail MTA.

That's the background, here's the problem. The webmaster email account is held on our Exchange 5.5/NT server. I need to get the sendmail MTA to send this perl generated email to the webmaster account. That's all it needs to do, nothing else. As far as I can tell, the perl script generates the text OK, and sends it to sendmail. How do I configure sendmail to forward this email to the Exchange server??
0
FaffMan
Asked:
FaffMan
  • 6
  • 5
  • 2
  • +1
1 Solution
 
gunny051499Commented:
i don't know what you mean by "forwarding this email". i guess your exchange server is known to be the mail exchanger for your webmaster@domain.
if this is the case it should be enough to call sendmail with the recipient (webmaster) email-address and pipe the content of your email to it. that should do it.
0
 
barreroCommented:
How are you sending the mail  via perl? with wich package?

I use Mail::Send and there I can choose which MTA to use.and there you can use the Exchange server address.

MArcel
0
 
mnewnhamCommented:
Assuming that:

1. Your perl script can deliver local mail.
2. Your exchange server is running SMTP services  
3. Your Linux sendmail is configured to deliver mail to the NT server:

you could could just create a local mail account on the Linux system, and add a .forward file to the NT server.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
FaffManAuthor Commented:
Thanks for your comments.

mnewnham: From your assumptions, 1 and 2 are true. The perl script will call sendmail and deliver the mail correctly. The exchange server is setup with SMTP and POP services. I need to set sendmail up so that it can deliver mail to my exchange server. How do I do this? I presume I must specify the (TCP/IP) address of the exchange server, so that sendmail knows where to send the mail. Which file should I enter this information in?
0
 
mnewnhamCommented:
Assuming that you have DNS up and running and you can, for example, ping the NT from the Linux system using DNS resolution (not hosts file), all that would be necessary would be to add an MX record for the NT into the DNS configuration files.
0
 
FaffManAuthor Commented:
We don't use DNS (we used to, but we recently disconnected from the company's other site, which had the DNS server).

I can ping the mail server by IP address, but not by name.

All the same, how does sendmail know where to send the mail? I haven't made any changes to sendmail's default installation settings, 'cos I don't know what to change.
0
 
mnewnhamCommented:
Sendmail relys almost exclusively on DNS to do it's transmission. DNS holds MX (Mail exchanger) records which allows sendmail to resolve mailhubs from domain names. Your configuration really only needs a very simple DNS setup, and I would recommend reading the linux DNS-HOWTO, which has a step by step guide on how to set this up. Once that is running, getting sendmail to deliver to another host is a no-brainer.
0
 
FaffManAuthor Commented:
OK, after a short argument with the my boss I've manager to set up a DNS server, with an MX record for our Exchange server. I tested the script mail, and it still didn't work (well, no mail arrived in the Webmaster's mailbox - which I take to mean it didn't work...).

'getting sendmail to deliver to another host is a no-brainer'

Imagine I have no brain :-) I know you'll enjoy that.

DanF

0
 
mnewnhamCommented:
ok - I apologise for that.

try this:

run nslookup.

set type=mx

enter the domain name - you should get a response which includes the domain, the preference and the ip address of the nt server.

Also look in the /usr/spool/mqueue directory. Check the files in there - there should be an indication why the mail was not delivered.
0
 
gunny051499Commented:
try to use sendmail directly. this will at least avoid you to run into problems caused from the cgi-script/executable. do so by typing "sendmail webmaster@your.domain" on a single line, followed by "Subject: testmail" on a second and the body on the following lines. stop the email with an EOF (CTRL-D).

this will also tell you more in case you have other problems.
0
 
FaffManAuthor Commented:
OK, we've had a small problem. The DNS server I set up has been taken offline again. My boss says we don't need it anyway. Apparently the appropriate MX records are set up on a DNS server hosted by our ISP. So it would appear that I need to get my linux box the address that DNS server. Unfortunately that's outside our firewall. Under NT, there's a 'proxy client' that we install to allow the NT machines to lookup the DNS server. Can the same be done with Linux? I expect it can...so the question is how?

DanF
0
 
FaffManAuthor Commented:
OK, we've had a small problem. The DNS server I set up has been taken offline again. My boss says we don't need it anyway. Apparently the appropriate MX records are set up on a DNS server hosted by our ISP. So it would appear that I need to get my linux box the address that DNS server. Unfortunately that's outside our firewall. Under NT, there's a 'proxy client' that we install to allow the NT machines to lookup the DNS server. Can the same be done with Linux? I expect it can...so the question is how?

DanF
0
 
mnewnhamCommented:
is your proxy server also a default gateway?
It would also be fairly simple to add a forwarding only name server to you NT proxy server.


Try adding the nameserver ip addresss into your /etc/resolv.conf file. then reboot and do a nslookup. see if it can pick up the ISP server as a nameserver.
0
 
FaffManAuthor Commented:
The wierdest thing has happened. Yesterday, I tried gunny's suggestion of sending a mail directly from the command line. Nothing arrived at that point. I checked my mail at about 10 am today and there it was..the mail I sent yesterday!! Since then, any mails I've sent from the command line have arrived after about 10 minutes. It would appear that sendmail is working. But I have no clue what I changed to make it work. I entered the proxy server address as a default gateway, and entered the ISP's DNS server in resolv.conf but NSLOOKUP still does *not* work...
I'm confused. But I'm not going to complain, at least it's working.

Many thanks to everyone

mnewnham gets the points for this question, but I'll post a bonus question for gunny.
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 6
  • 5
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now