I've been running a web platform that needs to send a considerable amount of emails daily. At the implementation date I and my partner decided to setup Postfix on the server and use Swift Mailer class to send the email using a SMTP connection to the local Postfix server.
This allowed us to have multiple email accounts, like
firstname.lastname@example.org and be able to send email with them correctly signed with DKIM.
My question is, can't we configure PHP in some way to avoid a local SMTP connection (which takes time an server resources) and replace with a more direct way to deliver the messages to be sent to the Postfix queue?
Form my understanding I could use PHP
mail() function or even Swift Mailer's
Swift_SendmailTransport class and deliver the messages directly to Postfix queue. But if so, how can we ensure DKIM? Will changing the "FROM" header to the email accounts on the local server be enough?