This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[SOLVED] Emails sent with kmail are treated as spam

Tags: None
(comma "," separated)
kbios
Registered Member
Posts
8
Karma
0
OS
Hi all, first post here.
I have used kmail as my mua for years and I have never had problems. Recently however I switched to a payed mail domain (@mysurname.info) and since then all the email I send through kmail and that domain is considered spam by most providers (gmail, for example). The smtp server is a local one (192.168.1.1). But the strange thing is, messages sent by thunderbird or even squirrelmail (webmail) are correctly sent! Here is the source of a mail sent by kmail (considered spam):

Subject: Prova lorem ipsum
To: <my other email address, hosted at virgilio.it>
From: <my payed-domain email address>
Date: Fri, 21 May 2010 15:02:55 +0200
X-KMail-Transport: Intranet
X-KMail-QuotePrefix: >
MIME-Version: 1.0
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201005211502.55556.myname@mysurname.info>
Status: RO
X-Status: RS
X-KMail-EncryptionState: N
X-KMail-SignatureState: N
X-KMail-MDN-Sent:

Email text

And here is the same email sent by squirrelmail (properly received):

Received: from 79.40.166.223
(SquirrelMail authenticated user myname)
by webmail.mysurname.info with HTTP;
Fri, 21 May 2010 15:04:13 +0200
Message-ID: <5d6d3b1c6e3f21bd3c88c51c2f0eda21.squirrel@webmail.mysurname.info>
Date: Fri, 21 May 2010 15:04:12 +0200
Subject: Prova lorem ipsum
From: <my payed-domain email address>
To: <my other email address, hosted at virgilio.it>
User-Agent: SquirrelMail/1.4.20
MIME-Version: 1.0
Content-Type: text/plain;charset=utf-8
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal

Same email text

Any clues? I'm really desperate about that, since I love KMail and would like to continue using it.
Thanks

Last edited by kbios on Wed May 26, 2010 1:47 pm, edited 1 time in total.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Is KMail using the same server as Squirrel Mail?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
kbios
Registered Member
Posts
8
Karma
0
OS
Hi bcooksley, thanks for your answer.
Yes: both are using my home server (postfix on 192.168.1.1). The only difference is that since squirrelmail is installed on the same machine where postfix is, it refers to it as localhost:25, while kmail uses server.intranet.home:25 which points at 192.168.1.1:25.

Would you find it useful to see the source of two received messages (one sent from KMail and one from Squirrelmail), the first marked as spam, the second correctly received?
Thanks again
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Yes that would likely be most helpful.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
annew
Manager
Posts
1155
Karma
11
OS
It sounds to me as though those mails are being seen as relays, which would explain their spam status. Try sending everything through your server. Set up poast fix server transport something along these lines:

.mydomain.lan smtp:[192.168.1.40]
mydomain.lan smtp:[192.168.1.40]
* smtp:[smtp:your.isp]
.* smtp:[smt[:your.isp]

adapted as necessary.

Don't forget to run 'postmap transport' when you have edited the file.


annew, proud to be a member of KDE forums since 2008-Oct and a KDE user since 2002.
Join us on http://userbase.kde.org
kbios
Registered Member
Posts
8
Karma
0
OS
@bcooksley
Here it is (long message following :) )
Email sent by KMail and considered spam:
Code: Select all
Return-Path: <myname@mysurname.info>
Original-Recipient: rfc822;otheremail@virgilio.it
Received: from vsmtp15.tin.it (192.168.70.119) by ims5a.cp.tin.it (8.0.022)
        id 4ACD0F29027759C1 for otheremail@virgilio.it; Mon, 24 May 2010 14:15:56 +0200
Received: from smtp-out12.alice.it (85.37.17.107) by vsmtp15.tin.it (8.5.113)
        id 4BCE30370A10B34D for theremail@virgilio.it; Mon, 24 May 2010 14:15:56 +0200
Received: from FBCMMO04.fbc.local ([192.168.184.135]) by smtp-out12.alice.it with Microsoft SMTPSVC(6.0.3790.3959);
    Mon, 24 May 2010 14:15:57 +0200
Received: from FBCMCL01B05.fbc.local ([192.168.69.86]) by FBCMMO04.fbc.local with Microsoft SMTPSVC(6.0.3790.3959);
    Mon, 24 May 2010 14:15:57 +0200
Received: from mysurname.info ([79.40.166.223]) by FBCMCL01B05.fbc.local with Microsoft SMTPSVC(6.0.3790.3959);
    Mon, 24 May 2010 14:15:55 +0200
Received: from alby.localnet (unknown [192.168.1.55])
   by mysurname.info (Postfix) with ESMTPS id A65B02CE067
   for <otheremail@virgilio.it>; Mon, 24 May 2010 14:17:50 +0200 (CEST)
To: otheremail@virgilio.it
Subject: Test message
From: myname@mysurname.info
Date: Mon, 24 May 2010 14:15:53 +0200
MIME-Version: 1.0
Content-Type: text/plain;
  charset=ISO-8859-15;
  =?iso-8859-15?q?format=3Dflowed
Content-Transfer-Encoding: 7bit
Message-Id: <201005241415.54212.myname@mysurname.info>
X-OriginalArrivalTime: 24 May 2010 12:15:55.0172 (UTC) FILETIME=[DC08CE40:01CAFB3A]
Status: R
X-Status: N
X-KMail-EncryptionState: 
X-KMail-SignatureState: 
X-KMail-MDN-Sent: 

This is a test message. Please ignore this message.
This is a test message. Please ignore this message.
This is a test message. Please ignore this message.
This is a test message. Please ignore this message.


Corresponding Postfix log:
Code: Select all
May 24 14:12:30 server postfix/smtpd[27217]: connect from unknown[192.168.1.55]
May 24 14:12:30 server postfix/smtpd[27217]: 5F8412CE067: client=unknown[192.168.1.55]
May 24 14:12:30 server postfix/cleanup[27220]: 5F8412CE067: message-id=<201005241410.33931.myname@mysurname.info>
May 24 14:12:30 server postfix/qmgr[8854]: 5F8412CE067: from=<myname@mysurname.info>, size=776, nrcpt=1 (queue active)
May 24 14:12:30 server postfix/smtpd[27217]: disconnect from unknown[192.168.1.55]
May 24 14:12:31 server postfix/smtp[27221]: 5F8412CE067: to=<otheremail@virgilio.it>, relay=out.alice.it[85.33.2.55]:25, delay=1.6, delays=0.05/0.08/1.2/0.19, dsn=2.6.0, status=sent (250 2.6.0  <201005241410.33931.myname@mysurname.info> Queued mail for delivery)
May 24 14:12:31 server postfix/qmgr[8854]: 5F8412CE067: removed


Email sent by Thunderbird and correctly received:
Code: Select all
Return-Path: <myname@mysurname.info>
Original-Recipient: rfc822;otheremail@virgilio.it
Received: from vsmtp5.tin.it (192.168.70.231) by ims5a.cp.tin.it (8.0.022)
        id 4ACD0F2902775C63 for otheremail@virgilio.it; Mon, 24 May 2010 14:20:25 +0200
Received: from smtp-out24.alice.it (85.33.2.24) by vsmtp5.tin.it (8.5.113)
        id 4BBEE7050D8FBC67 for otheremail@virgilio.it; Mon, 24 May 2010 14:20:25 +0200
Received: from fbcmmo06.fbc.local ([192.168.184.137]) by smtp-out24.alice.it with Microsoft SMTPSVC(6.0.3790.3959);
    Mon, 24 May 2010 14:20:26 +0200
Received: from FBCMCL01B06.fbc.local ([192.168.69.87]) by fbcmmo06.fbc.local with Microsoft SMTPSVC(6.0.3790.3959);
    Mon, 24 May 2010 14:20:24 +0200
Received: from mysurname.info ([79.40.166.223]) by FBCMCL01B06.fbc.local with Microsoft SMTPSVC(6.0.3790.3959);
    Mon, 24 May 2010 14:20:23 +0200
Received: from [192.168.1.55] (unknown [192.168.1.55])
   by mysurname.info (Postfix) with ESMTP id BC6182CE067
   for <otheremail@virgilio.it>; Mon, 24 May 2010 14:22:17 +0200 (CEST)
Message-ID: <4BFA6F05.3020108@mysurname.info>
Date: Mon, 24 May 2010 14:20:21 +0200
From: myname@mysurname.info>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4
MIME-Version: 1.0
To: otheremail@virgilio.it
Subject: Test message
Content-Type: text/plain;
  charset=ISO-8859-15;
  format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 24 May 2010 12:20:23.0411 (UTC) FILETIME=[7BEAD430:01CAFB3B]
Status: R
X-Status: N
X-KMail-EncryptionState: 
X-KMail-SignatureState: 
X-KMail-MDN-Sent: 

This is a test message. Please ignore this message.
This is a test message. Please ignore this message.
This is a test message. Please ignore this message.
This is a test message. Please ignore this message.


Corresponding Postfix log:
Code: Select all
May 24 14:22:17 server postfix/smtpd[27251]: connect from unknown[192.168.1.55]
May 24 14:22:17 server postfix/smtpd[27251]: BC6182CE067: client=unknown[192.168.1.55]
May 24 14:22:17 server postfix/cleanup[27254]: BC6182CE067: message-id=<4BFA6F05.3020108@mysurname.info>
May 24 14:22:17 server postfix/qmgr[8854]: BC6182CE067: from=<myname@mysurname.info>, size=784, nrcpt=1 (queue active)
May 24 14:22:17 server postfix/smtpd[27251]: disconnect from unknown[192.168.1.55]
May 24 14:22:19 server postfix/smtp[27255]: BC6182CE067: to=<otheremail@virgilio.it>, relay=out.alice.it[85.33.2.55]:25, delay=1.5, delays=0.07/0/1.2/0.15, dsn=2.6.0, status=sent (250 2.6.0  <4BFA6F05.3020108@mysurname.info> Queued mail for delivery)
May 24 14:22:19 server postfix/qmgr[8854]: BC6182CE067: removed


Sources seem pretty similar to me, and that's why I'm desperating.

@annew
Thanks for your answer. I'm not sure about what you are suggesting: all the messages are currently relayed through my ISP server [out.alice.it] because otherwise some providers wouldn't accept them. Here is my Postfix main.cf:
Code: Select all
# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.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

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = mysurname.info
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = intranet.home, server.intranet.home, localhost.intranet.home, localhost, mysurname.info
relayhost = out.alice.it
mynetworks = 127.0.0.0/8, 192.168.1.0/24
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/
mailbox_command =
inet_protocols = ipv4

Thanks again for any help
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
The only key difference I could find is that one of KMail's headers appears to be damaged.

Code: Select all
Content-Type: text/plain;
  charset=ISO-8859-15;
  =?iso-8859-15?q?format=3Dflowed


I would recommend checking what type of mail KMail is sending, and its encoding.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
kbios
Registered Member
Posts
8
Karma
0
OS
Thanks for your answer. Yes, that was an earlier attempt to work around the problem. Unfortunately resetting it didn't solve the problem :-( . Just a thought: I noticed that KMail sets Message-Id: <201005241415.54212.myname@mysurname.info>, while Thunderbird sets Message-ID: <4BFA6F05.3020108@mysurname.info>. Could it be related? If so, is there a way to tell KMail not to put myname there? Thanks
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
The Message-ID shouldn't be related as it is before any Recieved: header entries.

Can you please try setting your name in KMail > Settings > Configure KMail > Identities?

Also, make sure the IP addresses of your system are not on any Spamhaus ( or other such service ) listing.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
kbios
Registered Member
Posts
8
Karma
0
OS
Hi bcooksley, I've solved it!
Unfortunately setting my name didn't work. So I played a bit with telnet sending emails with custom headers (I started from working Thunderbird headers and substituded one by one with KMail ones). It turned out that the default Message-ID sent by KMail is not good for some antispam filters. So I changed the option "Use custom Message-ID suffix" in Settings to a random string and now it works!
Thanks for all the time you gave me. Karma +1
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Good to know it is solved. Can you file a bug report at bugs.kde.org so that KMail can be adjusted to create a string that spam filters do not block?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
kbios
Registered Member
Posts
8
Karma
0
OS


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], ourcraft