Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-04-02 19:07:26

argetlam
New Member
Registered: 2008-04-02
Posts: 5

Textpattern SMTP plugin?

Hello, all.

I’ve just been informed by my host that PHP’s mail() function does not work on their servers, because they don’t allow connections to local sendmail. They do allow sending emails out via SMTP, though (the SMTP server requires authentication). I tried searching on this forum and on Google to find a workaround for this, since Textpattern does use the mail() function to send out emails, but to no avail.

I have a WordPress installation on the same server. My hosting provider directed me to a plugin that “enables WordPress to send e-mail via SMTP instead of via PHP’s mail() function (aka sendmail).” The plugin works and I’ve been able to sidestep the problem with WordPress. But I’d rather use Textpattern to power websites, because, well, it’s so damn cool :)

I was wondering if there was any similar plugin for Textpattern out there, and if so, where could I find it? I’ve looked around a lot for this, and haven’t quite found anything yet. Any help would be appreciated :) I don’t know if it’s too much to ask, but if a plugin for this doesn’t already exist, would anyone be interested in creating a plugin that does this? I’ve seen quite a few topics on this forum with users having the same issue without a proper workaround.

Thanks for your time and patience. Looking forward to hearing from others on the forum about this issue.

Offline

#2 2008-04-02 19:42:05

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Textpattern SMTP plugin?

I think the better solution is to find a host with a clue.
Requiring SMTP authentication for local users does not make sense.

Offline

#3 2008-04-03 03:34:26

argetlam
New Member
Registered: 2008-04-02
Posts: 5

Re: Textpattern SMTP plugin?

This is from my host:

“We made the deliberate decision to separate our mail and web services: only mail servers can send and receive e-mails. This makes it easier to monitor e-mails, maintain sendmail, etc. Plus web servers don’t get clogged by people sending or receiving lots of e-mails.”

Obviously quite a few people are inconvenienced by this, but I’m sure I’m not the only TXP user facing this problem. Plus, I’ve already paid for the entire year, so finding a new host is not really a solution for me at this point :(

Would it be possible to create a plugin for Textpattern using PHPMailer? Anyone know of any such existing plugins?

Offline

#4 2008-04-03 03:58:45

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Textpattern SMTP plugin?

argetlam wrote:

Plus, I’ve already paid for the entire year, so finding a new host is not really a solution for me at this point :(

They don’t give refunds? There’s absolutely no reason to suffer with a crappy host – there are quite a few cheap hosts that work with TXP.

Offline

#5 2008-04-03 04:14:22

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Textpattern SMTP plugin?

argetlam wrote:

This is from my host: “We made the deliberate decision to separate our mail and web services: only mail servers can send and receive e-mails. This makes it easier to monitor e-mails, maintain sendmail, etc. Plus web servers don’t get clogged by people sending or receiving lots of e-mails.”

I wonder how it makes it easier to maintain. Well if server dies then, but in general…

That must be a joke, if your host states something like that, it’s just a nutshell. As ruud said it doesn’t make any sense, not even a little. If their email servers are so drained out and suffer from lack of power, then it’s their fault. They also should give refunds, as if you don’t use their services, then they don’t need the money, but that is their desicion if they give the money back or not – also there can be quite odd tiny prints on the contract & terms. Also you could use “the worst service ever” as a excuse that infact is true what comes to the emails.

Offline

#6 2008-04-03 06:38:49

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Textpattern SMTP plugin?

A plugin isn’t possible, you would have to modify the txpMail() function inside textpattern/lib/txplib_misc.php.

Offline

#7 2008-04-03 06:55:28

argetlam
New Member
Registered: 2008-04-02
Posts: 5

Re: Textpattern SMTP plugin?

ruud, jm, Gocom, Mary: Thank you all for your help, I really appreciate it :)

Mary: I’ll look into modifying the txpMail() function, thank you!

My current host is really good for things like Django, etc., so I think I’ll continue hosting with them for that, but after hearing your views, I am considering getting another server to host PHP-based applications, because a lot of applications I use (and plan to use) require the use of PHP’s mail() function.

Thanks again for all your help!

Last edited by argetlam (2008-04-03 06:56:14)

Offline

#8 2008-04-03 11:34:34

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Textpattern SMTP plugin?

Ah, a separate SMTP server. Then it does make sense to have authentication, to avoid it from becoming an open relay, but similar to how an SMTP server works at an ISP, why don’t they allow acces based on IPnr, since all their servers have static IPnrs, that shouldn’t be too hard. Hmm… unless of course they use the authentication credentials to track down abusers on their servers in case of complaints.

Offline

#9 2008-04-09 11:53:18

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: Textpattern SMTP plugin?

Well, as an amateur sysadmin, I can also say that mail() is way more trouble than it’s worth. It is quick and easy but at the same time dirty (pretty much like all PHP), and sending e-mails via SMTP is the proper way to do it. I mean, the e-mails usually go to an e-mail address, right, so that e-mail address will have both POP3/IMAP and SMTP support so why not use the SMTP part as well?

I am seeing loads of problems on my boxes due to mail() because not all people use CAPTCHAs etc. and then, well, spam frickin’ galore.

I personally think argetlam’s host has the right approach to this. If they focus on Django and other similar frameworks, they all use classes that work directly with SMTP.

If I had more time mate, I would put a plugin together, but I’m absolutely choker full, and although I need it myself, there are other priorities. One day though, one day… : )

Offline

#10 2008-04-09 12:16:44

argetlam
New Member
Registered: 2008-04-02
Posts: 5

Re: Textpattern SMTP plugin?

gerhard: Thanks for your reply. The hosting provider that I mentioned isn’t all that bad, it’s just this and a couple other issues where they require users to use workarounds for things. An SMTP plugin for Textpattern would definitely be useful for lots of people, though.

As far as my situation is concerned, I’ve moved to Mediatemple for now. I’ve had a good experience in the one week that I’ve hosted with them. Hopefully that will continue.

Offline

#11 2008-04-09 13:03:31

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Textpattern SMTP plugin?

Whether you use mail() or SMTP… if the script/program is not written properly, you still get spam.

Offline

#12 2008-09-07 21:16:11

EliVZ
New Member
Registered: 2008-09-07
Posts: 2

Re: Textpattern SMTP plugin?

argetlam, or anyone else with this problem:

I host all my sites with Webfaction, which I assume is who you are using, and also can’t use the php sendmail function. Fortunately, I found a solution in their forums: http://forum.webfaction.com/viewtopic.php?pid=3868#p3868

The code there is a direct replacement for the mail() function that uses smtp. Just paste it into a new file at lib/pearmail.php

Then open up lib/txplib_misc.php and go down to line #931. On that line type: include_once('pearmail.php');

On line #983 (or so, depending on how much space you added around the include statement) you see return mail($to_address..., change it to return smtp($to_address....

That should do it. Try changing your password to be sure it worked. It’s not as nice as a plugin, and you will have to remember to redo it any time you upgrade TextPattern, but it is a pretty easy fix.

Offline

Board footer

Powered by FluxBB