E-mail sent with postfix are marked as spam

Before you put any time at all into Postfix go here and check the public IP address that you're using.

http://www.dnsblcheck.co.uk

If you're on a residential DSL block you may be screwed regardless of anything you do.


I am using gmail as my email provider.

Ok, so I'm working under the assumption that you have an address, let's call it [email protected] that you're sending from, and you're receiving email at google using that address.

I want to send email from my dedicated server and I don't like the 500 message per day cap.

Ok, you want to switch to a server you control because there is a limit to the number of messages in a day. Got it.

To address this issue I would like to run postfix to only send email, i would prefer if incoming port 25 blocked by my firewall.

Right here is the first problem. Blocking all inbound traffic without regard to the reason for the traffic arriving at that port will create problems all the way around. SMTP is a bidirection communication protocol and you'll just confuse the bejeebers out of whatever SMTP server you're sending to upstream.

The short of that is, unblock port 25.

I can send email, however google marks all messages sent with postfix as SPAM.

Ok, at this point, you'll need to provide some headers for examination, or some logs. Your mail could be blocked for a variety of reasons and without knowing how you have it set up, any guesses I would make would be shots in the dark.

I will say that Google would have to be insane to allow any SMTP server to send an email into itself that didn't originate from their domain but claims to be coming from it; it could be as simple as the fact that your SMTP server is not "authorized" on their servers to handle mail for Google's domain. This is a common anti-relay setting for most SMTP servers and would certainly explain alot about your problem, but it's still just guesswork on my part.

How do I make sure that people know email sent with postfix is valid?

Postfix isn't the issue, it's how you've configured postfix to "talk" with Google. I can send email from my postfix mailer to gmail all the time, and have done so for years.

Post the additional information needed to resolve this (log file info and/or headers from a sample email) so that we can get to the heart of the issue. Otherwise, it's all speculation, and will be nothing but guesswork.


Follow-up to comments

I don't think Postfix needs to talk to Google.

Either postfix connects directly to Google (which is how most SMTP deliveries are done), or you are using a relay to talk with Google (which is rare anymore). In the former, you need to have a correct MX and SPF setup, and a postfix main.cf that isn't borked. In the later, well, Google probably isn't going to take kindly to any email you send to a relay that doesn't have a SPF record that covers your originating server.

The third option is: you have found some magic internet vortex that relays email from server to server without the two servers ever talking to each other. I am doubtful of this.

Further more I fail to see why I should allow incoming 25 if i'm not accepting incoming email (except for bounces which i'm choosing to ignore because each email address has to be registered)

Because you'll break email in general.

I'm not one to repeat myself, but...

Post the additional information needed to resolve this (log file info and/or headers from a sample email) so that we can get to the heart of the issue. Otherwise, it's all speculation, and will be nothing but guesswork.