ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Location: Baltimore,MD,USA,Earth,Some Galaxy, We haven't gone that far!
Distribution: Redhat 7.3
Posts: 104
Rep:
Very short PERL question.
Guys, I have a mailform which has a variable that shows the
mailprogram as
"$mailprog = '/usr/sbin/sendmail '
However, as you can see this only works if sendmail is local but I want to use a remote mail server..
How do I change the variable so that my remote mail server understands it?
Well, typing an IP is not working..
Any ideas?
Thank you..
Location: Baltimore,MD,USA,Earth,Some Galaxy, We haven't gone that far!
Distribution: Redhat 7.3
Posts: 104
Original Poster
Rep:
Ok, here's the deal..
We have a RH 7.1 apache web server which we're hosting 5 domains. These are all basic personal homepages.
Whatever, now a customer asked if we could support formmail (formmail is located in apache, )or not. So we said yes..
We already have the script , since we don't use the apache server and mail server together, we have to redirect the $mailprog variable to our remote mail server. I'm looking for a solution for that.
My search on the web turned up to be unsuccesfull, all variables defined as, ... /usr/sbin/sendmail ' which is stupid. I mean all the people around the world using their web servers as mail server just a stupid line said so?????
Any other ideas, I couldn't find anything in CPAN at all,
Ok there are scripts and everything but they are all the same..
Thank you..
Just becuase you have sendmail on your server doesn't necessarily make it need to be a mailserver. Rudimentary linux boxes should have a form of a mail delivery utility to receive system errors and such. I'd suggest putting a basic sendmail package on the box and deny all access from anything but localhost(this *should* prevent hacks).
Alternatively you could write a lovely little perl piece named sendmail that redirects the message in it's entirety to the actual sendmail server, tho you have to know a lot about what's going on for this to occur.
This one package will open a socket to the machine receiving the mail (by looking up the MX records) and deliver it bypassing all executables on your local machine, it would probably even work on a Winders machine.
Two down sides:
1) The program hangs while the lookup and delivery occur so you may need to fork before you invoke the send method.
2) Code already written to pipe things in to sendmail need to be re-coded.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.