-2

I've configured Postfix and Dovecot in my server (in this server I've my website and my mailserver), but if I send an email, it is marked as spam! I've also configured DKIM!!

So, here some information:

$ host MYDOMAIN.COM
MYDOMAIN.COM has address 178.62.48.51
MYDOMAIN.COM mail is handled by 50 mail.MYDOMAIN.COM.

My posfix main.cf:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file=/etc/ssl/certs/mailcert.pem
smtpd_tls_key_file=/etc/ssl/private/mail.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_security_level=may
smtpd_tls_protocols = !SSLv2, !SSLv3
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
myhostname = mail.MYDOMAIN.COM
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mail.MYDOMAIN.COM, MYDOMAIN.COM, localhost, localhost.localdomain
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_alias_domains = MYDOMAIN.COM
virtual_alias_maps = hash:/etc/postfix/virtual
milter_protocol = 2
milter_default_action = accept
smtpd_milters = inet:localhost:12301
non_smtpd_milters = inet:localhost:12301

My postfix master.cf:

smtp      inet  n       -       -       -       -       smtpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce

verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error

retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}

uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -   n   n   -   2   pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py

  ${nexthop} ${user}
submission inet n       -       -       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_wrappermode=no
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
  -o smtpd_sasl_type=dovecot
  -o smtpd_sasl_path=private/auth

My /etc/hosts:

127.0.0.1   localhost
127.0.1.1   MYDOMAIN MYDOMAIN

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

My /etc/hostname:

MYDOMAIN

My /etc/mailname:

MYDOMAIN.COM

I can't explain why email goes in spam, any suggestion?

I underline that in the code I've used my real domain. I also underline that in some file (like hostname) I've used the domain whitout the TLD but I don't know if it is right (example: I've used DOMAIN instead DOMAIN.COM).

ddtnero
  • 37
  • 1
  • 1
  • 4

1 Answers1

0

The IP address you gave in your comment, indeed owned by DigitalOcean, does appear clean to me w.r.t. DNSBLs like SpamHaus and IP reputation sites like SenderBase. That said, DigitalOcean certainly has a bad reputation when it comes to controlling its customers' outbound spam and perhaps some filter is over-aggressive against broad DigitalOcean IP ranges.

I did notice that the domain in your IP's rDNS happens to lack an MX record. Lots of anti-spam systems will reject mail from you in this scenario, especially if that's the domain you actually send from. You appear to have covered the rest of FCrDNS, which I assume is also reflected by your HELO.

(I've omitted references to your actual IP or domain in the event you wanted to retract the IP from your question.)

Adam Katz
  • 14,455
  • 5
  • 68
  • 83