E-mail sent with postfix are marked as spam

9,799

Solution 1

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.

Solution 2

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.

Solution 3

Take this Email server test. It will tell you probable reasons for your emails being considered as SPAM and how to fix the same.

If the fixes cannot be implemented for some reason, use a SMTP Relay Service.

Solution 4

Simple- you do not send them from your machine.

Here are some issues that may mark it as spam:

  • You send for a gmail.com domain- but your IP address is not allowed to do so, which the recipient may check (SPF record in the gmail.com domain).
  • Your IP address has no proper bakcward DNS setting for the domain and is not a MX for the domain
  • Your IP Address is from a dynamic IP Address range which some anti spam settings can figure out (reverse DNS Name in a specific standard format) and thus blocked per definition.

Postfix has nothing to do with it. Depending on your domain you can / have to put in proper entries and move away from your end user dynamic IP (get a small VPX acting as relay), or - in case of an external domain - understand there is nothing you can do, as you abuse the provider domain.

TECHNICALLY are a spammer - like every other bot infected computer trying to send email from home connected computers for domains not properly matching up with the IP address.

Solution 5

Are SenderID, DomainKeys and DKIM properly set? Have a look at this blog post http://www.digitalsanctuary.com/tech-blog/debian/setting-up-spf-senderid-domain-keys-and-dkim.html

Share:
9,799

Related videos on Youtube

Rook
Author by

Rook

The only way to prove the security of anything is through rigorous testing. There are very smart people on SO and there are excellent answers given, although the right answer isn't always chosen, and the question could be oversimplified or misunderstood. I have been writing exploit code for a while. I have found numerous vulnerabilities in applications and critical infrastructure. I have received three severity metrics from the Department of Homeland Security. The most severe was in the top 500 more dangerous software flaws of all time. My CVE numbers: CVE-2011-0050 CVE-2011-0049 CVE-2011-0048 CVE-2009-1759 CVE-2009-0468 CVE-2009-0467 CVE-2009-0389 CVE-2008-6975 CVE-2008-6499 CVE-2008-6498 CVE-2008-5621 CVE-2008-2043 CVE-2008-2002 CVE-2007-6485 CVE-2007-6458 CVE-2007-6459 CVE-2007-6471 CVE-2007-5646 CVE-2007-0134 CVE-2007-0132 CVE-2007-0130 CVE-2006-6781 CVE-2006-6780 CVE-2006-3208 CVE-2006-3207 CVE-2006-3206 CVE-2006-3205 CVE-2006-3204 CVE-2006-3203

Updated on September 17, 2022

Comments

  • Rook
    Rook almost 2 years

    I am using gmail as my email provider for a domain name that I control. I want to send email from my dedicated server that is being hosted by a real hosting company and I don't like the 500 message per day cap. 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. I can send email, however google marks all messages sent with postfix as SPAM. How do I make sure that people know email sent with postfix is valid?

  • Rook
    Rook about 14 years
    (+1) I'm sending mail from a dedicated host. I've added my root domain name to the mx records and I've created spf records for every mx record. Now, I'm waiting for dns to propagate.
  • Rook
    Rook about 14 years
    Btw this never fixed my problem. Google is doing something strange.
  • TomTom
    TomTom about 14 years
    Google id soing nothing strange. Put up a test here. Did you put in the SPF records? They did fix it for me.
  • TomTom
    TomTom about 14 years
    So you do not disagree - postfix does not play into the equation, as you say "every server can send it wrong".
  • Rook
    Rook about 14 years
    +1 my server's IP is on this list... Butm I don't understand why people think i'm trying to send email from my house. This is a dedicated server.
  • Rook
    Rook about 14 years
    I don't think Postfix needs to talk to Google. 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)
  • flooble
    flooble about 14 years
    Which lists are you on? Different DNSBL's have different listing criteria and (don't take this the wrong way I'm just telling it how it is) the people running them are free to choose their criteria and the people who use them are free to use them, or not use them if the impact on legitimate mail is too high. I'd suspect that your hosting provider has been listed, given they're a hosting company it's most likely because of an excess of spam in the past, really it does depend on the specific DNSBL.
  • Philip
    Philip about 14 years
    @The Rook, it doesn't matter if it's a dedicated server or a toaster; it's connected via a residential class connection. That's going to be a problem.
  • Rook
    Rook about 14 years
    @Chris S I have said absolutely nothing about a residential internet connection, I think you are tripping. This is a dedicated server at a real hosting company.
  • Philip
    Philip about 14 years
    @The Rook, my apologies, must have read that too quick. Your server's IP is still blacklisted, which is still the source of the problem.
  • Avery Payne
    Avery Payne about 14 years
    +1 for the answer, but also because I made the stupid assumption that the OP was aware of residential IP blocks being SMTP-blacklisted from here to high heaven...you know what they say about "assume"...next time, I'll ask even the 'obvious'.