Advantages of using smtp relay over using a programing language's smtp library functions [closed]

StackOverflow https://stackoverflow.com/questions/5903978

문제

I would like to know of any advantages/disadvantages of using an smtp relay (with sendmail/postfix/qmail) over using a programming language's built-in smtp api.

We have always run a mail server off of the same box that runs our web app, so it has always been pretty simple for us to send email, whether it be with PHP or Python or whatever - no worries about network outages or anything like that disrupting emails since the mta is pretty reliable. Now that we are switching to use Google Apps for email, the email needs to go through the gmail smtp server, so I am deciding if I should use the programming language-specific apis that support sending smtp mail, or if I should setup a smtp relay on the server (with postfix, for example) so that the app can continue to send mail with the reliability of a local mta.

It would be great if you could identify advantages/disadvantages of each approach.

도움이 되었습니까?

해결책

If you mean the choice is between your app handling the full mail delivery process, with no intermediate mail server versus handing the mail off to a mail server, I'd choose the latter. The mail server that you hand off to could be your own postfix install or even to the Google apps mail server. Handling the whole delivery with your application will be a bad idea - a real mail server will handle queueing, retries, bounces, etc. You don't want to try and build that into your app.

So, I'd say your choice are:

1) Relay to google apps server

or

2) Install postfix, have it relay to google apps server, and have your app relay to your postfix server.

Advantage of 1 is, no work to do.

Advantage of 2 is, your app may be more efficient with a local MTA, especially if you app may block while sending, but you'll have to install and maintain your MTA.

I do recommend postfix if you go down that route. If you're relaying to another server, the config is pretty easy.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top