SMTP, managed by MTA?

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
decipher
Forum Commoner
Posts: 38
Joined: Mon Mar 13, 2006 6:27 am
Location: south africa

SMTP, managed by MTA?

Post by decipher »

I would like to know some more information regarding using the SMTP mailing class.

Today I sent around 80 emails, each of size 400kb. They were HTML/Text messages with a pdf attachment.
The mailing was managed by cron, sending 25 emails every 5 minutes.

I was under the impression that using the SMTP class, the script communicates directly with the recipient SMTP server. But I logged into my WHM, checked the mail queue and noticed that 2 hours later only half the emails have been sent.
I would like to know the advantages of using the SMTP mailing class if the actual SMTP mailing is managed by the MTA. Why would using the SMTP method be better than the sendmail class if both mailing processes are managed by the MTA (exim), and how can I speed up the time of which the MTA actually delivers the emails?

Thank you for your time.
Rich
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Yes, SMTP is a protocol, the MTA is what's on the receiving end of that protocol ;)

Using SMTP on "localhost" will be slower than using exim directly since you're just adding another layer to the transport. Using SMTP with a remote host means you spread the work load but it will still be slower initially due to network overhead.

If your only option is SMTP-localhost or Exim then use Exim.
decipher
Forum Commoner
Posts: 38
Joined: Mon Mar 13, 2006 6:27 am
Location: south africa

Post by decipher »

Thank you for your reply. I have to apologize for my ignorance yesterday, I clearly wasn't thinking. Using the SMTP communicates with our SMTP server, and not the recipient SMTP server. Doh!

I checked the mail queue on our server this morning and there were still 5 emails waiting to be delivered, 17 hours after adding the messages to the mail queue.
I never realized it would take this long. I guess the reason being the mails were 400k big. But I understand that using the MTA is a whole bunch easier than sending the email by communicating directly with the recipient SMTP server, especially with such a large email.
Is there some method to checking the mail queue/MTA status without using the WHM? I used to assume that once swiftmailer was finished with the mailing, that the mails had actually been sent, but all that happens is that swift adds the mails to the SMTP mail queue.
decipher
Forum Commoner
Posts: 38
Joined: Mon Mar 13, 2006 6:27 am
Location: south africa

Post by decipher »

You know I cant really grasp whats going on here.

If I send batch emails using Swift SMTP class (run by cron daemon), it adds all messages to the Exim Mail Queue. It then takes quite a while for Exim to send the messages.
Now if I send only 1 message, it seems like it communicates directly with the SMTP server, then sends the mail instantly, even if the mail queue is backed up.

I do not want messages to be added to Exim's mail queue, I want the message to be sent at run-time, much like when I send a single email.
I'm struggling to understand the point of using cron to balance the batches if the MTA already does this.
Does anyone have any suggestions as to why the mails get added to the mailing queue instead of just being sent at run-time?
Any pointers or suggestions would be greatly appreciated ;)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Most likely you've got exim running with the -q15 or -q30 option where 15 and 30 are the minutes between queue runs respectively. Bring the time down between queue runs. This is to do with your exim configuration and not to do with Swift. Swift sends the email to the server, that's all it can do and all it will do ;)
Post Reply