Apache mod_smtp?

Place to discuss Fedora and/or Red Hat
Buzza24
scripter
scripter
Posts: 59
Joined: Fri Mar 14, 2003 2:01 am
Contact:

Apache mod_smtp?

Post by Buzza24 »

Hey peoples,

It's has been quite a while since I have posted on this forum. Reason being I have learnt a hell of alot about the workings of Linux and I have got alot working to my satifcation. The PQI card reader that I asked about now works and also my graphics card and palm in FC1.

But I am having some trouble installing a module for Apache.
http://1060.oregonstate.edu/module/mod_smtp/
Above is a link to mod_smtp. It's a module that allows mail to be sent on smtp servers.
Thing is I do know how to install it. Can someone tell me the best way to do this or is there a better way?

God Bless,
Daniel B

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

Are you sure that's an Apache module? I can't imagine why it would be in a Java archive format. Do you have any documentation as to what it is and how it is used? Personally, I can't begin to imagine and a Google search hasn't turned up anything.

Buzza24
scripter
scripter
Posts: 59
Joined: Fri Mar 14, 2003 2:01 am
Contact:

Post by Buzza24 »

I was told by a guy talked about a the problem I was having and he said to install the module mod_smtp.
I am quite sure that it is an Apache module but if there are any other ones out there, please let me know.
And everytime I search google for "mod_smtp" i get plenty of links.

The problem I have got is that my webserver needs to send mail out through SMTP. But I need another module. It doesn't use sendmail nor do i want to. The software i am using is PHP-Nuke.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

Buzza24 wrote:I was told by a guy talked about a the problem I was having and he said to install the module mod_smtp.
What problem?

I am quite sure that it is an Apache module but if there are any other ones out there, please let me know.
And everytime I search google for "mod_smtp" i get plenty of links.
Here is a Google search for mod_smtp:

http://www.google.com/search?q=mod_smtp

That is extremely light for what you get for any other Apache module. For example mod_smtp comes up with less than two pages where mod_ssl comes up with over a half million hits:

http://www.google.com/search?q=mod_ssl

I can't find any documentation on it or anything that would indicate it is an Apache module. If you see some could you post a link?
The problem I have got is that my webserver needs to send mail out through SMTP. But I need another module. It doesn't use sendmail nor do i want to. The software i am using is PHP-Nuke.
Hmmm, well you don't really even need a module *or* sendmail to send mail to an SMTP host. You can do it with a small amount of PHP code (or Perl code, or shell script, or many other languages). Sending a message to an SMTP server really is trivial. I'm not quite sure why you don't want to use PHP's "mail()" function (which does require sendmail but it's certainly not a big deal) but if you look down in the comments of the mail() function you will find an example of sending messages to an SMTP host without using Sendmail and PHP's mail function within the comments at the bottom of the mail() function's page. Look at the 3rd user comment here:

http://us4.php.net/manual/en/ref.mail.php

Buzza24
scripter
scripter
Posts: 59
Joined: Fri Mar 14, 2003 2:01 am
Contact:

Post by Buzza24 »

Below is a page that kinda explains what has to be done to solve my problem, but I don't know enough to fix it.

What ur thoughts on it?
http://phpnuke.org/modules.php?name=PHP ... blems.html

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

I guess the problem I am having is that you are not providing enough information. You have mentioned that you have a "problem" but you never describe in detail what your problem actually is. I also didn't see "mod_smtp" listed in the link you refer to.

If I had to guess what your problem actually is I would guess that you want to have your PHP-Nuke send out email messages (activation messages) and that is not getting done for whatever reason. As the link you pointed to mentions PHP-Nuke does indeed use the built-in PHP mail() function which is normally a good thing. It does rely on Sendmail but you mention that you do not want to use sendmail. You do not mention why you do not want to use sendmail which confuses me but if I were to guess what a reason might be for this I would guess that you do not have control over the server or configuration of the server you are running your PHP-Nuke app on, and that server is not configured properly.

Are my guesses on the right track? Rather than having me guess on all of these things it would be much easier on me if you could provide a little more background over what you have control over, what exactly you are trying to accomplish and what your reasons are for not wanting to configure Sendmail properly.

Another guess I might have for your reason for not wanting to use the built-in PHP mail() function (which relies on Sendmail) is that your server is on a Cable/DSL connection and many sites are blocking email coming from your server, and you believe that you can not configure sendmail to use an SMTP server. If this is the reason for not wanting to use Sendmail you should know that you *can* configure sendmail to deliver all mail through a specific smtp server rather than delivering it directly which would solve the problem of sites blocking your cable/dsl address.

At any rate I still haven't seen any documentation on mod_smtp or any piece of information that would lead me to believe that it is an Apache module, nor can I figure out why anyone would need it. Also, it is really hard to help without seeing the big picture. Having the big picture might allow me to point out a better solution to your problem (whatever that problem might be) that you might not have thought of.

Buzza24
scripter
scripter
Posts: 59
Joined: Fri Mar 14, 2003 2:01 am
Contact:

Post by Buzza24 »

I apologise for the lack of details I can see now how that would frustrate you. Well to answer your questions...

My problem is that I need to send mail out from PHP-Nuke and it'd doesn't and the site that I gave you doesn't really describe how fix the problem. The reason I didn't want to use sendmail is that I have been told that sendmail is very insecure and i assumed that it[PHP-Nuke] could do it stand-alone.
I have full control over the server and I will adimit that I still stuggle with somethings with servers on Linux. I have edited many config files where it asks for a smtp host so I have put my ADSL one in, but still no go.

What I want to do is to get PHP-Nuke to be able to send mail without a hitch.
Sorry for the confusion. If you need any more information, please ask.

--Daniel B

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

The reason I didn't want to use sendmail is that I have been told that sendmail is very insecure
Not sure who would have been making such false statements. Most of the internet's mail is delivered via sendmail and has been for like 20 years. Of course you can certainly configure sendmail so it could be insecure but you can do that with anything.
What I want to do is to get PHP-Nuke to be able to send mail without a hitch.
Maybe we should just work from this point. As far as Sendmail being insecure, Fedora ships with a Sendmail configuration that only listens on your loopback adapter (localhost) so you can't even connect to it from an outside machine. It also comes with a default configuration that will not actually work for sending mail out (doubly secure). :) The phpBB forum that we are typing these posts on use the same PHP mail() function to send mail that PHP-Nuke uses. All you have to do is properly configure Sendmail. In my case I only make a couple of simple changes to the /etc/mail/sendmail.mc config file and started sendmail:

# /sbin/chkconfig sendmail on
# /sbin/service sendmail start

Here is a copy of the actual sendmail.mc from this voidmain server:

http://voidmain.is-a-geek.net/files/configs/sendmail.mc

Notice it is configured to listen on 127.0.0.1. That means you can't make an outside connection to sendmail. It also means of course that you can't send mail directly to your server from an outside server. That can certainly be changed if you want it to also be able to receive mail. The most important parts are just changing "voidmain.is-a-geek.net" to whatever your server/domain name is (there are 4 occurances). If you open this file in vim it is nicely color coded and much easier to read.

After you make the above config changes you'll want to test Sendmail before trying to send a message from PHP. You can do this on the command line like so:

$ echo "This is a test message" | mail you@somewhere.com

Of course change "you@somewhere.com" to a real email address that you can receive mail on. You can check the mail queue to see if it's hung up and can't be sent by:

# mailq

This server is running FC1 by the way.

Now, if you are on Cable or DSL and are having problems getting mail to a lot of places because you are on a banned list, you *can* change one line in this file to have all mail forwarded through an external SMTP server. If you have access to an SMTP server then you would just change the line with the "SMART_HOST" to whatever your external smtp server is, and uncomment the line (remove the leading "dnl"). Don't forget to restart sendmail:

# /sbin/service sendmail restart

Buzza24
scripter
scripter
Posts: 59
Joined: Fri Mar 14, 2003 2:01 am
Contact:

Post by Buzza24 »

When looking at your config file and comparing it to mine, it gets very confusing and I'm unsure what to edit.

http://buzza.kicks-ass.net/sendmail.mc

The above link is my file.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

Ok, I just made some slight modifications to your file and actually tested it on my system and it worked just fine. Here is the new one:

http://voidmain.is-a-geek.net/files/con ... l.mc.buzza

This should send mail directly from the machine that it resides on. If you actually want it to go through your SMTP server you would uncomment that SMART_HOST line as I mentioned.

I apologize for my config file not matching up exactly to yours. The machine was originally an earlier version of Red Hat and the config file doesn't get replaced with the new version on an upgrade (thankfully).

Buzza24
scripter
scripter
Posts: 59
Joined: Fri Mar 14, 2003 2:01 am
Contact:

Post by Buzza24 »

so what do i do now and what have you done? just sum up plz

:D

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

Did that work or are you asking what to do with the file? If you have already replaced the sendmail.mc with the sendmail.mc.buzza did you restart sendmail and try to send a message?

$ echo "test message" | buzza@somewhere.com

If that works and you receive the message then you should be done. I'm not familiar with PHP-Nuke so I don't know if it has a test email or some other way of getting it to send an email message. If you are sending mail from PHP-Nuke and they aren't making it to where they should be then do they even show up in the mail queue?

# mailq

If not then you can probably find out what the problem is by looking at the apache logs. You can also turn on PHP debugging to log to a file and then watch that file for error messages.

Buzza24
scripter
scripter
Posts: 59
Joined: Fri Mar 14, 2003 2:01 am
Contact:

Post by Buzza24 »

I have replace the file and I have uncommented the smtp bit and I have tried to test it with the echo command you gave me

Code: Select all

$ echo "test message" | buzza4lord@yahoo.com.au
and i out puts

Code: Select all

bash: buzza4lord@yahoo.com.au: command not found
I have restarted sendmail and done everything you said to do. What am i doing wrong?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

I guess it would help if I could type. I typed it right the first time I told you how to do it but not the second time:

$ echo "This is a test" | mail buzza@somewhere.com

Of course replace the email address above with whatever your real email address is that you receive mail at.

Buzza24
scripter
scripter
Posts: 59
Joined: Fri Mar 14, 2003 2:01 am
Contact:

Post by Buzza24 »

well i did that. I ran that and nothing happend. i didn't get it in my Inbox nor did it come up in queue. How long does it usually take?

could it be a firewall problem?
what would run to allow it?

Post Reply