How to set up SPF for sending mail from other machine than the mail server itself?

0

This is more of a general question independent of what specific mail server software one might use. I'm renting a single server and using it as a mail server. It only has one SPF record, for that server's IP. This means I can send mail just fine when I SSH into the server and use the command line, or when I proxy my home machine's traffic through it. But when I try to use my email client on my home machine like with any other email provider, I get an SPF fail (not authorized).

The problem is that my home network IP address is not fixed, So I can't just add my home PC's IP as an SPF record and be done with it (besides, I really don't think that would be the way to go about this). I'd also like to take my laptop to any network whatsoever and be able to send mails. So what does my setup have to look like for that?

I guess the mail shouldn't include my home machine's IP to begin with, but I can't find a setting in my client to change that, and it works without having to change anything for the usual email providers.

Keno

Posted 2019-06-17T07:29:41.657

Reputation: 11

Answers

1

If everything is properly configured, then authentication with username and password will prevent this error. See here: https://en.wikipedia.org/wiki/Open_mail_relay#Closing_relays In my case, the problem was that I picked the wrong authentication method in my email client.

Keno

Posted 2019-06-17T07:29:41.657

Reputation: 11

0

If your home IP is not fixed, and ypu need to have an SPF record that "default drops" you cant send email directly from your jome system.

There way round this problem is to set your home email system to relay email through another system whose IP addresses are known and can directly or indirectly be added to your SPF revord. If you use a provider like gmail, you add (for example include:_spf.google.com)

Alternatively set your mail server to relay for you and use.that and add "mx" to your SPF record. To set this up you will need to configure smtp authentication on the server and client.

Alternatively some ISPs still allow you to relay email through there mail server if you are a user (based on their IP range). You can find out if your provider foes this and add their SPF include record...

davidgo

Posted 2019-06-17T07:29:41.657

Reputation: 49 152