The email address in the envelope.from
(a.k.a. bounce address
or return-path
or smtp.mailfrom
) are set to use the email domain of mail.mydomain.com
. If no SPF
record is set for mail.mydomain.com
, the described error will be returned.
Or: There is no address specified in the envelope.from
field, which results in an HELO
lookup for the hostname of the sending server.
This behavior can very well be the result of bounces sent back from your server to the original sender. In which case, quite often the original envelope.from
address is stripped and the hostname of the email server is checked for an SPF
record.
This last situation is easily fixed by setting an SPF
record for the name with which your mail servers set up communication (HELO
name). In your case probably mail.mydomain.com
.
For more information about which checks are performed and about the HELO
check, please see the RFC on SPF, sections 2.3 and 2.4.