0

So I'm attempting to setup a mail server on my web server using this guide: https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassassin

I've since completed it but after trying to go through the steps I am still getting caught in spam filters. Using mail-helper it shows that I'm still missing some errors which rates my emails at a 6.5/10 on their site.

Delivered-To: phlexplexico@gmail.com
Received: by 10.31.184.13 with SMTP id i13csp1858421vkf;
        Tue, 31 May 2016 00:47:50 -0700 (PDT)
X-Received: by 10.140.96.67 with SMTP id j61mr28418706qge.74.1464680869983;
        Tue, 31 May 2016 00:47:49 -0700 (PDT)
Return-Path: <me@website.me>
Received: from website.me (website.me. [0.0.0.0])
        by mx.google.com with ESMTP id b129si30231541qkf.106.2016.05.31.00.47.49
        for <phlexplexico@gmail.com>;
        Tue, 31 May 2016 00:47:49 -0700 (PDT)
Received-SPF: pass (google.com: domain of x@x.me designates 0.0.0.0 as permitted sender) client-ip=0.0.0.0;
Authentication-Results: mx.google.com;
       dkim=pass header.i=@x.me;
       dkim=pass header.i=@x.me;
       spf=pass (google.com: domain of me@website.me designates 0.0.0.0 as permitted sender) smtp.mailfrom=me@website.me;
       dmarc=pass (p=NONE dis=NONE) header.from=website.me
Received: by website.me (Postfix, from userid 1000)
    id 5ACCC144672; Tue, 31 May 2016 03:47:49 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=x.me;
    s=mail; t=1464680869;
    bh=LAjdjLF5TLqUzQ9W6ajSnTWHw30oLlaB2WJ/DtN87Ns=;
    h=Date:Subject:From:To:From;
    b=SszwsO83h0XKdkD5JxPv43f4Tvt40L6tyu450u9LgRyl1RfHwiozl1kdtmtRENnqY
     Zrsvs8FcY+ZKks3rla8pdJ/b1bbvsR8dca30wXMpXbnFrmVw4gzC0FKpP+Xf8nut9X
     zUlBgx0nESOk1i8aScE+Xt9OGw4QwSfiWg8317rk=
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on website.me
X-Spam-Level: **
X-Spam-Status: No, score=2.7 required=5.0 tests=ALL_TRUSTED,HTML_MESSAGE,
    HTML_MIME_NO_HTML_TAG,MIME_HTML_ONLY,MISSING_MID,MISSING_MIMEOLE,
    T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0
Received: from [192.168.0.141] ()
    by website.me (Postfix) with ESMTPSA id EB7A5144670
    for <phlexplexico@gmail.com>; Tue, 31 May 2016 03:47:48 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=x.me;
    s=mail; t=1464680869;
    bh=LAjdjLF5TLqUzQ9W6ajSnTWHw30oLlaB2WJ/DtN87Ns=;
    h=Date:Subject:From:To:From;
    b=SszwsO83h0XKdkD5JxPv43f4Tvt40L6tyu450u9LgRyl1RfHwiozl1kdtmtRENnqY
     Zrsvs8FcY+ZKks3rla8pdJ/b1bbvsR8dca30wXMpXbnFrmVw4gzC0FKpP+Xf8nut9X
     zUlBgx0nESOk1i8aScE+Xt9OGw4QwSfiWg8317rk=
Date: Tue, 31 May 2016 01:47:46 -0600
Subject: Tester
From: Me <me@website.me>
To: phlexplexico@gmail.com
Importance: Normal
X-Priority: 3
X-MSMail-Priority: Normal
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
Message-Id: <20160531074749.5ACCC144672@website.me>

PHAgZGlyPSJsdHIiPkhleSB0aGVyZSEgTGV0J3Mgc2VlIGlmIHRoaXMgaXMgbm90IGJsb2NrZWQu
PC9wPgo=

I removed some info about my website as it is personal, but I know the DNS checks are correct and they all work. However, what mail-tester gives me an error about is certain headers, such as missing MIME-OLE and

Message only has text/html MIME parts
You should also include a text version of your message (text/plain)

So what am asking mainly is where can I edit my headers to include or remove X-MSMail-Priority from the headers, and how can I send a text version of the email via postfix/dovecot? I'm also just using the gmail app to send these emails through my account. Thanks in advance for the help!

Phlex
  • 103
  • 3
  • As for the answers listed there I tried getting my DKIM, reverse DNS and SPF setup properly, so I don't think it'd be a complete duplicate as it has more to do with Header specifics I think? – Phlex May 31 '16 at 20:00

1 Answers1

2

In your question, you state:

I'm also just using the gmail app to send these emails through my account.

while in the header of the attached e-mail, I see:

Received: by website.me (Postfix, from userid 1000)

so, actually, you're sending such an e-mail via your local Postfix (...and not the GMAIL APP... whatever it is!).

Also:

So what am asking mainly is where can I edit my headers to include or remove X-MSMail-Priority from the headers

the answer is quite easy, as such an header (X-MSMail-Priority), exactly like any other X-whatever headers, are added by MUAs. In simple terms, it's the application that you have used to send above e-mail that added such header. So, to remove such header, you only need to "fix" such application.

Finally:

and how can I send a text version of the email via postfix/dovecot?

here you're referring to the complaints about the MIME parts. The reason for such a complaint is that your e-mail declares, in the headers:

MIME-Version: 1.0

so, basically, it say: "Hei! I'm a MIME 1.0 e-mail". Actually, it say that the message is compliant with RFC 2045.

Right after such a declaration, than, it say:

Content-Type: text/html; charset=utf-8

so, something like "Hei! here follow a text/html content....". And, actually, the content of the e-mail is not even an HTML! It's the string "Hey there! Let's see if this is not blocked" BASE64-encoded. In other words, the message is NOT compliant with the RFC 2045 above.

The mail-structure-check-service you've used, has noted such a mismatch and it correctly report this to you.

In the end: I strongly suggest you to carefully check the structure of the to-be-sent e-mails. Even more important, I really think that to send automatic e-mails, it's much, much better to use one of the readily-available libraries, that have been developed to correctly deal with problems you're experiencing (in PERL, for example, I like this; but there are plenty, for every programming language). By proceeding writing code by hand, from scratch, might result in a very hard path.

Damiano Verzulli
  • 3,948
  • 1
  • 20
  • 30
  • Hmm, okay well I'll make sure to take a look into this! And it's more of a personal contact thing for my webpage as opposed to a 'newsletter-esque' email. Thank you for all this information and will look more deeply into this! As for making it RFC 2045 compliant, is there any guide for this for postfix to aid in making this work properly? Thanks for the help! – Phlex May 31 '16 at 20:01
  • 1
    Postfix is NOT your problem! To properly generate a MIME-compliant message, just use an existing library or... study MIME structure and write an application that will pass, to postfix, a properly-MIME-formatted message. Postfix will receive, from your application, whatever it (the application) will send, and will pass upstream, to other SMTP server, such a stream without any change in the "DATA" area. So, again, is up to your application to properly format the data-area (the content-message) so to be compliant with MIME standard (and MIME declaration included in the header). – Damiano Verzulli May 31 '16 at 21:42
  • Add to that that the GMail app does add "X-MSMail-Priority: Normal" without "X-MimeOLE" which triggers a 1.9 MISSING_MIMEOLE in spamassassin. I noticed this when my messages from the Android GMail app only containing the word "test" scored a 5.4 which got a firm 550 reject before arrival. There's another report of that here: https://support.google.com/mail/forum/AAAAK7un8RU0aPMaxTezHM/?hl=hi – tudor -Reinstate Monica- Mar 03 '20 at 02:19