开发者

Has Anyone Here ever tried PEAR

Hi I have been reading alot of articles adoring the PEAR mail package and it seems like PEAR is something I need to try out.

I am interested in setting up a full mail server, similar to a conventional SMTP mail service; which incorporates mail queuing, 开发者_运维百科resending with a backend database etc. My impression is that PEAR can do this but can its service be used with mail clients like outlook to send mail, just as how any any smtp server daemon can where one would enter a portnumber, server name and/or security protocol?

Thanks


No, PEAR isn't going to magically solve these problems for you.

PEAR is a collection of PHP classes that are meant to solve common problems faced by PHP users. The Mail packages offer code for interacting with different parts Email systems. They do not contain code for creating email systems from scratch.

For example, form the Mail_Queue documentation

The Mail_Queue class puts mails in a temporary container, waiting to be fed to the MTA (Mail >Transport Agent), and sends them later (e.g. a certain amount of mails every few minutes) by >crontab or in other way.

The MTA in this case in sendmail, postfix, etc.

Another example, from the Mail_Mbox documentation

It can split messages inside a Mbox, return the number of messages, return, update or remove an specific message or add a message on the Mbox

Incorrect use of "an" aside, you are using this to read existing MBOX files, and not caring how they got there.

The Mail package is about interacting with existing mail systems, NOT creating replacements. You'll still need to understand how all those email systems work to create a "full mail server, similar to a conventional SMTP mail service". If you're doing this because you want to learn how email systems work, have at it. If you're doing this because you thing this will give your business some leg up in the email game, I laugh and say "good luck with that"


PEAR is a repository for lots of libraries. Some of them deal with mailing.


PEAR's Mail class is designed for sending mail only. It is not designed as an implementation of an SMTP server.


Pear Mail is an SMTP sender aka client, not an SMTP server. Although it's entirely possible to write server (any kind of server) in php that doesn't mean that writing an SMTP server yourself is necessarily a good idea as it requires quite some expertise to do it right (spam anyone?). If you want to see an SMTP server implemented in a scripting language, go have a look at Lamson, written in Python by Zed Shaw.

And while you're there, do read the About page. This quote says it all

However, as great as Lamson is for processing email intelligently, it isn’t the best solution for delivering mail. There is 30+ years of SMTP lore and myth stored in the code of mail servers such as Postfix and Exim that would take years to replicate and make efficient. Being a practical project, Lamson defers to much more capable SMTP servers for the grunt work of getting the mail to the final recipient.


It seems to me that PEAR's MailQueue package may address your needs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜