fetchmail forwarding to gmail via procmail - what is happening? - email

I've set up fetchmail with the following configuration
poll my.exchange.server protocol IMAP
user "my_name"
password "my_pass"
smtpname "my_gmail_account#gmail.com"
ssl
keep
no rewrite
mda "/usr/bin/procmail -f %F -d %T"'
Everything seems to be working fine. No errors from fetchmail, and the procmail log contains the e-mails that I want to be forwarded to GMail (an example is pasted below). However, none of the mail ever shows up in my GMail inbox. I've checked the 'All Mail' section to ensure it wasn't being treated as spam. Any ideas what could be going wrong? I'm doing all this on OS X version 10.8.5
Example procmail log for an e-mail that I want to show up in my gmail inbox
From my_exchange_email#my.exchange.server Mon Sep 30 11:03:55 2013
MIME-Version: 1.0
Received: from my.exchange.server [123.45.678.910]
by my_host_name with IMAP (fetchmail-6.3.26)
for <my_gmail_account#gmail.com> (single-drop); Mon, 30 Sep 2013 11:03:55 -0400 (EDT)

I figured out what I was missing. My procmail was configured incorrectly for forwarding. I fixed this by making the following procmailrc file
:0:
! my_gmail_account#gmail.com
That was it!

Related

Mail delivery failed: returning message to sender (No such User here)

I have migrated my website and the email records to a new server (other provider). Everything was ok except that now when I want to send a message from my email (my email direction is the same), one of my clients can not receive my messages. I chatted with my client and his mails are ok, he is receiving mails without problems, as he said.
I reported the problem to my Hosting provider and they have changed the mail Exchanger from remote to local but it didn't finish with the problem. Someone knows what could be happening?
This is part of the message that appears:
"
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
peter#thisismyclientsdirection.com
No Such User Here
peter#thisismyclientsotherdirection.com
No Such User Here
Reporting-MTA: dns; cherry.theserversite.pro
Action: failed
Final-Recipient: rfc822;peter#thisismyclientsdirection.com
Status: 5.0.0
Action: failed
Final-Recipient: rfc822;peter#thisismyclientsotherdirection.com
Status: 5.0.0
Return-path: <comercial#mydomain.com>
Received: from [71.13.252.126] (port=58531 helo=[10.145.123.217])
by cherry.theserversite.pro with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
(Exim 4.93)
(envelope-from <comercial#mydomain.com>)
id 1UZ6w-00EaD5-0h; Mon, 19 Oct 2020 13:38:33 -0400
To: peter#thisismyclientsdirection.com, peter#thisismyclientsotherdirection.com
From: comercial#mydomain.com
Subject: =?UTF-8?Q?Reenv=c3=ado_-_cotizaciones_mantenimiento?=
MIME-Version: 1.0
Content-Type: multipart/mixed;
Content-Language: es-ES
X-Antivirus: Avast (VPS 201019-2, 19/10/2020), Outbound message
X-Antivirus-Status: Clean
X-Exim-DSN-Information: Due to administrative limits only headers are returned
"
Thanks,
I found the solution. The problem was that the other websites (the domains of my client) are inside my server and in the Email Routing section (it is in the Cpanel) of those websites, the domains were targeted as "Local server" or not targeted. Despite it, the email server for those domains don't were in my server then the system was confused. I just changed the target to "Remote servers" for both domains (the domains of my client) and the problem disappear.
I hope this explanation could be useful for other developer.
Anyway thank you,
TheJohnny

DKIM bad Signature. Expeted Body Hash is the same as the BH sended. Apache James

I made a lot of research about this topic. I have an Apache James 2.3.2.1 Mail Server. I'm configuring it as a production server. I got it running, and stable, but implementing jDKIM have been troublesome. I found these links to get it right.
http://www.nailedtothex.org/roller/kyle/entry/configuring-james-to-sign-dkim
https://github.com/smoradi/config/blob/master/noften/apache-james.txt
Until now, I verified the public and private keys repetitively. Mailets libraries. Java code and configuration for the Mailet.
But I'm stuck.
While testing with www.appmaildev.com/en/domainkeys/, I finally solve some errors over the themes named above. But now It's just toying with me.
In the DKIM Test result it says that the expected body hash must be
Expected Body Hash:
: frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN/XKdLCPjaYaY=
But in the Message Header says that the body hash is just that.
bh : frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN/XKdLCPjaYaY=
And It's just the same so this test should be OK.
Maybe I'm missing something over de DNS or in the Mailet configuration, I just dont know i have been trying to approach in different ways but this is were I get every time.
As a note, before getting this point, every time I send a mail over Outlook or Homail, it was getting to the Junk immediately, now is kind of random almost every 3 or 5 sends. While Gmail since the SPF got them always in the Inbox. And The server does not have an PTR record properly configured in the DNS.
This is the Mail from appmaildev.
I change my domain name over example.com
And change the IPs to xxx.xxx.xxx.xxx
this test in particular was made over telnet using ehlo
I marked the puzzling part of code with ** **.
================================================================
DKIM result: fail (bad signature)
Signed by: webmaster#example.com
**Expected Body Hash: frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN/XKdLCPjaYaY=**
PublicKey: selector._domainkey.example.com
IN TXT = "k=rsa; p=
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCtLBczKGEysTT6QuRgApyn6yvM
XOU9Sjkx6YMomuFujqPk2XgMuBbgafckRX+1F18h9G1rURmvc3EmPxegFxim6wrE
1RJGfddO+OHEjTBOsuXa7BK29P/bhCOehVeYG4o0L5DH8z3izfmvNuC3dC4N5G3R
8ZrNd7k/196TCZIaMwIDAQAB;"
---Original Message Header---
x-sender: webmaster#example.com
x-receiver: AAAA4AcCCxQA#appmaildev.com
Received: from james ([xxx.xxx.xxx.xxx]) by mail.appmaildev.com with Microsoft SMTPSVC(7.5.7600.16385);
Thu, 11 Feb 2016 22:05:19 -0500
DKIM-Signature: v=1; d=example.com; b=V9gPNU9Gjky7fFov5cYuTGN/gQEoBgaAkctwnME17pT/Uket4PDsVixMQbyiKvgQF3ADK8HTrKyd1L+9bBiesJAQaD1L1lH0ualjO/Ctf8jjzLyDUfB6cu4TEuAD+aVkIUVVbd0LNhcpxiOMsd5cADRBqZy60Mw9fQOaqyjh0QU=; s=selector; a=rsa-sha256; **bh=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN/XKdLCPjaYaY=;** h=from:to:received:received;
Message-ID: <1848510914.01455246317306.JavaMail.root#james>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-UserIsAuth: true
Received: from localhost.localdomain ([127.0.0.1])
by james (JAMES SMTP Server 2.3.2.1) with SMTP ID 101
for <AAAA4AcCCxQA#appmaildev.com>;
Fri, 12 Feb 2016 03:05:17 +0000 (UTC)
Date: Fri, 12 Feb 2016 03:05:17 +0000 (UTC)
From: webmaster#example.com
subject: prueba ehlo
ehlo.:
Bcc:
Return-Path: webmaster#example.com
X-OriginalArrivalTime: 12 Feb 2016 03:05:20.0069 (UTC) FILETIME=[34ED9F50:01D16542]
After more research and testing, I made it to work.
It seems that I had missing values in the DKIM-Signature.
This was my original tag in config.xml for Apache James in the DKIMSign mailet:
<signatureTemplate>v=1; s=selector; d=example.com;
h=from:to:received:received; a=rsa-sha256; bh=;
b=;</signatureTemplate>
I was missing the "c" and I made a change over the "h"
c=relaxed/relaxed;
h=Message-ID:Date:Subject:From:To:MIME-Version:Content-Type;
After the modification I got this:
<signatureTemplate>v=1; s=selector; d=example.com;
h=Message-ID:Date:Subject:From:To:MIME-Version:Content-Type;
a=rsa-sha256; bh=; b=;c=relaxed/relaxed;</signatureTemplate>
Another Detail, that I made several test about was the DNS Record. Mine was over Windows Server , so just for caution, I checked these details.
First , The escape char before the semicolon in the "k"
k=rsa\;
Second, That the "p" value, was the last value and that does not have a semicolon or escape char.
p=MIG...QAB
So that, after a host command I got something like
selector._domainkey.example.com descriptive text "k=rsa\;p=\010...QAB"
After those changes and checkings. It pass every test :)
Another link i found usefull for the configuration was this.
http://mail-archives.apache.org/mod_mbox/james-server-user/201410.mbox/%3C544FD474.2040906%40malcolms.com%3E

Email in cPanel cannot recieve, failure message notification

I have hosting through hostgator and cPanel. I have multiple domains. I want to set up emails for a domain. I do so in cPanel creating a user #the-domain-name.com, giving it a password, and email is created.
It has a webmail access at www.the-domain-name.com/webmail and the username and password work to get in. That is fine to log in that way (although I'd like to use Mac's Mail app to do so and set up to work, having difficulty there also).
The issue is that the email address can send out messages, but when I try to send a message to that email through another address, say my Gmail account, I get a "Delivery Status Notification (Failure)" email immediately after saying this:
Delivery to the following recipient failed permanently:
mynewuser#the-domain-name.com
Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the server for the recipient domain the-domain-name.com by the-domain-name.com. [104.255.196.241].
The error that the other server returned was:
550 No Such User Here"
----- Original message -----
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=from:content-type:subject:message-id:date:to:mime-version;
bh=xsx6bRmWZEpBj6Xda3lmBg1o8my3DpJB/KizTIxmSkw=;
b=pvoW+xjEh2t0uSOsdguDhlt0ifBBYoB69jVhQsDVFV9LzIzz/hxiK7e4CIq9cgiu3a
s3ovwDnF+612jQ2QpbjWzVAKauj2pJrgPLkX4Xd6UmLuCy/YKiVTXVCCl1wYDaIkF+b4
uKe/JDjDG27sbpGCGaQmouTqA2I8J4tqML89BYS5bvHaPBHlo5MhFsSwFW5Tg9uiqoPV
Ga0nqP2QaFYX4ieJeg7vjGR7t/Ifu91Xbt6Y8am0s8ktELkHKOIAm8n1KMzdpClAW1BR
P0ujIG0WbwVQm6TwkDHN/TnXFbdKHL4/bM5Io5CBNmEvBISOtAWZf4LSXE6EmOBh4m6K
j2VQ==
X-Received: by 10.107.135.65 with SMTP id j62mr17214703iod.47.1448046522949;
Fri, 20 Nov 2015 11:08:42 -0800 (PST)
Return-Path: <myGmailAccount#gmail.com>
Received: from ?IPv6:2601:282:200:680:95c:1c6f:f086:9f28? ([2601:282:200:680:95c:1c6f:f086:9f28])
by smtp.gmail.com with ESMTPSA id rj5sm325732igc.7.2015.11.20.11.08.41
for <newUser#the-domain-name.com>
(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
Fri, 20 Nov 2015 11:08:42 -0800 (PST)
From: My Name <myGmailAccount#gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_955B8E97-7DBF-44E5-931B-B41741DD943E"
Subject: test
Message-Id: <A6DE0523-0ABF-4A08-86B8-FD86342995BF#gmail.com>
Date: Fri, 20 Nov 2015 12:08:39 -0700
To: newUser#the-domain-name.com
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
X-Mailer: Apple Mail (2.2104)
I substituted all the real emails and domain name out with generic ones.
How can this be fixed to where I am able to both SEND and RECEIVE from the new cPanel email, and ultimately, how can I do so with Mac Mail??
Thanks
Handling, sending/receiving your emails with cPanel is very easy.
As the error you get says: 550 No Such User Here , double check your email account name.
Also, check the mail log file, which on a WHM/cPanel server I think is: /var/log/exim_maillog
Of course you can always contact your host for help. The last time I had problems with my cPanel email accounts, I contacted my host and it turned out that my custom exim config file was overwritten by cPanel Exim updates.

Postfix transport: deliver different domains via different relayhosts

Postfix version 2.11.0
What I'm trying to accomplish is to have mail destined for a particular domain to be relayed through SendGrid but all other outgoing mail to be sent from my local server directly. I have this configuration in /etc/postfix/transport:
example.com smtp:[smtp.sendgrid.net]:587
.example.com smtp:[smtp.sendgrid.net]:587
* :
My understanding from all the searches I've done and reading the Postfix docs is that this should work but if I send to any other domain, for example gmail.com it's still getting relayed through SendGrid.
An example from /var/log/mail.log:
Oct 26 16:15:46 myhost postfix/smtp[25783]: A75F0C04F9: to=<PRIVACY_MASKED#gmail.com>, relay=smtp.sendgrid.net[108.168.190.108]:587, delay=11, delays=11/0.02/0.22/0.03, dsn=2.0.0, status=sent (250 Ok: queued as iTwf5zmCQQSgz_I6sVpSSA)
Is there some other configuration I'm missing?
Ok, now I see the error of my ways. In sasl_passwd I had this:
smtp.sendgrid.net USERNAME:PASSWD
But in transport I had this:
example.com smtp:[smtp.sendgrid.com]:587
The difference is .net versus .com.
Changed it to .net and works!

Solution No Such User Here error

I am battling to find a definitive answer and solution to this problem, pulling my hair out stage.
I have several Wordpress sites that have forms within these. Essentially, the form is completed and an employee receives a notification with the details, pretty simple. The employees do not receive the notification emails at all, but when I use my personal email or Gmail it works perfectly!
I am seeing the No Such User Here error via my hosts webamail as per the below. I'm told that all emails are whitelisted and shouldnt be block, but they say they dont see the emails hitting their gateway.
I'd really appreciate some help here to move on with this thing, thanks in advance.
Error message:
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
rcook#csgroup.org.au
No Such User Here
------ This is a copy of the message, including all the headers. ------
Return-path: <gravityforms#ampedmediaworks.com>
Received: from amwrrc by gator41.hostgator.com with local (Exim 4.80)
(envelope-from <gravityforms#ampedmediaworks.com>)
id 1ThUzf-0007gH-00
for rcook#csgroup.org.au; Sat, 08 Dec 2012 18:43:42 -0600
Received: from 60.228.85.149 ([60.228.85.149])
(SquirrelMail authenticated user gravityforms#ampedmediaworks.com)
by gator41.hostgator.com with HTTP;
Sat, 8 Dec 2012 18:43:42 -0600
Message-ID: <ec0f41d26aad8a08452d013018cd32db.squirrel#gator41.hostgator.com>
Date: Sat, 8 Dec 2012 18:43:42 -0600
Subject: test
From: gravityforms#ampedmediaworks.com
To: rcook#csgroup.org.au
User-Agent: SquirrelMail/1.4.22
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal
test
It may have something to do with Your IP being on blacklist
http://www.mxtoolbox.com/SuperTool.aspx?action=blacklist%3a60.228.85.149