I was trying to send emails on behalf of another domain user, using MailInaAbox as SMTP server.
But when I am trying to send an email as xyz@gmail.com
as the FROM header, and the actual Sender as my valid SMTP user who is authenticating the request, I am getting an error Sender address rejected: not owned by user
. This happens when the mail client makes a call to validate the FROM address in a method called rcptTo()
in SMTPTransport class.
I tried doing it without authentication but then I was hitting Spamhause policy block list https://www.spamhaus.org/pbl/query/PBL1724244.
I read up and seems like this should have worked - https://tools.ietf.org/html/rfc5322#section-3.6.2
So my question is what am I doing wrong. Also how does the bulk email senders like sendgrid work?
UPDATE
After adding alias of xyz@gmail.com -> sender@mydomain.com I am now able to send emails on behalf of this domain. Of course they are going in Spam as both SPF and DKIM are failing. But if the domain owners add correct DKIM and SPF entries then theoretically I should be able to send emails on their behalf without getting spammed?
UPDATE - Even after DKIM,SPF,Dmaarc entries and following everything on the google list still google is marking my emails as spam.
Again how does the bulk email software do this part?