Welcome to Geeklog, Anonymous Sunday, September 01 2024 @ 12:45 am EDT
Geeklog Forums
Substitute mail() with smtp()...again (I have the solution, I think?)
celso
Anonymous
It has been discussed here several times about people who just can't configure sendmail, for whatever reasons. Well, I am in the same situation. However, I couldn't really find a solution here that I could just cut and paste to fix my problem. However, several posts posed some clues on how to solve it.
I have come up with what I think is a working solution that meshed very well with Geeklog. Meaning, with my "hack", user could configure his/her own smtp, possibly using his/her ISP's smtp just like a regular email client. Otherwise, it will just act normally and use PHP's mail().
I would like to contribute my mods back to Geeklog, if people find this useful. I for one would like it to be in there so I don't have to re-apply the hack each time there is a new release. BTW, I am on 1.3.7.
Basically here's what I did:From searching through several posts, I learned about the smtp class. I created a function wrapper for the class so it can be used like PHP's mail() function. I added some settings in the config.php to set whether to use the external mailer or mail(). Other settings are the smtp host, port, auth, user, and pw.
I put my function wrapper of the class which I call COM_mail() in lib-common.php. The wrapper basically examines whether external mailer is swithed on in the config file. If off, then just pass along to mail(). Otherwise, read all the smtp config from the config file and use the smtp class for mailing.
Then, I substituted all the calls to mail() with COM_mail(), and everything is taken cared of. The files I've changed the calls were users.php, admin/user.php, admin/mail.php, admin/moderation.php, lib-common.php, and profiles.php. I don't know if I've changed everything supposed to be changed but so far I can now send mail where needed.
That's about it. Let me know if you want me to send my mods so I can clean it up a bit. If so, where should I send this?
celso
5
7
Quote
indy_dude
Anonymous
Screw sendmail. You can waste a lifetime trying to make that monster work. Qmail is the secure and user friendlier (and ONLY, imho) alternative. Goto http://www.lwq.org/
Add a web based cleint like Squirrelmail and spamassasin and you have the complete Linux E-mail solution.
5
3
Quote
Anonymous
Anonymous
This is good stuff, thanks.
As far as sendmail vs ???, I prefer Exim.
6
3
Quote
Anonymous
Anonymous
Qmail is the best, secure, fine...
4
5
Quote
All times are EDT. The time is now 12:45 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content