Page 1 of 1

What happens in the background when I use Sendmail?

Posted: Wed Apr 16, 2008 4:44 am
by s_volenszki
I can't understand something, I hope anybody can help me.

If I'm sure, than the sendmail is an MTA (message transfer agent) which handles the mails sent from scripts (php) to an SMTP server(???).

If yes, than what happens when my php sends an email (using swift with verbosesending plugin)?

1. swift makes the right mail format to be standardized
2. gives this mail to sendmail and ask it to relay to the SMTP server (???)
3. if it be true, than SMTP has to be indicate back to sendmail the results
4. if any error occured, than verbosesending gives a red line, otherwise a green one.

And than the error handleing:

If an error occures, (sendmail isn't available or SMTP had something problem) than I can operate swift to sleep, and try again or after any time of retrying, give up.

And the last one is the failed mail adresses. It meens that, if any problem occured during the send process (between php and sendmail??? or between sendmail and smtp???) than swift collets the failed mail adresses and stores it?

Sorry if I am asking begginers stupid questions, but I wnat to understand it to do my best!

Thanks

Re: What happens in the background when I use Sendmail?

Posted: Wed Apr 16, 2008 5:11 am
by Chris Corbyn
Not exactly:

1. Swift compiles the message in a standard format
2. Swift starts sendmail in SMTP mode (this is NOT the same as how mail() does things)
3. Swift performs an SMTP transaction with Sendmail
4. If any error occurs the verbose plugin shows a fail
5. Sendmail spools the message to disk
6. Sendmail runs the spooled messages onto their next hop (the MX of the email address)

Effectively by using Sendmail all you're really doing is deferring the job to another process. This is handy because it's asynchronous, but it does give a false perception of speed.

In version 4 there is support for -t mode (same way mail() does things). The plus side of this is that it's faster to execute a runtime (not faster to reach the recipient); the downside is that it will never report failures because it doesn't provide output, it only takes input.

It is getting clear...

Posted: Wed Apr 16, 2008 6:53 am
by s_volenszki
Based on your reply I understand that, when I get the green line from verbose plugin, it meens that, Sendmail spooled my mail to disk and this mail waiting to be sent, so the green line does not meen that the mail has been sent, but it is on the right way for it.

And when I get a red line from verbose plugin, it says to me there were any kind of failure which defeated the mail to be spooled.

Re: It is getting clear...

Posted: Wed Apr 16, 2008 7:01 am
by Chris Corbyn
s_volenszki wrote:Based on your reply I understand that, when I get the green line from verbose plugin, it meens that, Sendmail spooled my mail to disk and this mail waiting to be sent, so the green line does not meen that the mail has been sent, but it is on the right way for it.

And when I get a red line from verbose plugin, it says to me there were any kind of failure which defeated the mail to be spooled.
Since Sendmail will be running in SMTP mode it may verify that:

a) The address has valid syntax
b) The address is routable

Failures would occur if sendmail doesn't think there's any way it can deliver the mail basically.

And yes, you're right, a green bar means sendmail spooled it successfully.