not working email forward when email relay ?
-
@girish
I'm having I think the same issue. I have server logs on the recieving side I can share as well. here are the detailsHere is my setup:
- me@SenderServer.com to send the test mail
- me@DestinationServer.com is the final destination address we are forwarding to and where server logs are recovered from
- me@MyCloudron.io is set to forward to me@DestinationServer.com
- MyCloudron.io which has ip 1.1.1.1 is the cloudron install
NOTE: 1.1.1.1 is fake. The real IP is a dynamically changing IP address from the ISP which is likely spam blocked. Prior to setting up the STMP relay server no outgoing emails would work as they would be blocked on the destination server due to ISP's all adding dynamic ip blocks to spam lists by default. After setting up the relay I was able to send as me@MyCloudron.io, and that still works, just forwarding does not work. I suspect, or wonder, if sogo and rainloop are properly using the cloudron configured smtp relay? - MyCloudron.io is setup to forward mail through a posteo.de server using a paid account. This works fine for sending and recieving using me@MyCloudron.io directly but me@MyCloudron.io forward to me@DestinationServer.com fails.
The forwarding was setup using sogo.
Error on MyCloudron.io
{ "ts": 1609960307783, "type": "bounce", "direction": "outbound", "uuid": "860650A1-438F-48AB-9CFE-79A20126D25A.1", "mailFrom": "<>", "rcptTo": [ "<me@SenderServer.com>" ], "details": { "message": "554 kundenserver.de (mxeue112) Nemesis ESMTP Service not available No SMTP service IP address is black listed. For explanation visit https://www.ionos.com/help/index.php?id=2425&ip=1.1.1.1&c=bl" } }
logs from DestinationServer.com that appear when the cloudron server attempts to forward to me@DestinationServer.com:
2021-01-06 19:11:47 no host name found for IP address 1.1.1.1 2021-01-06 19:11:47 H=(MyCloudron.io) [1.1.1.1] sender verify fail for <SRS0=0ad3=GK=SenderServer.com=me@DestinationServer.com>: Unrouteable address ==> /var/log/exim4/rejectlog <== 2021-01-06 19:11:47 H=(MyCloudron.io) [1.1.1.1] sender verify fail for <SRS0=0ad3=GK=SenderServer.com=me@DestinationServer.com>: Unrouteable address ==> /var/log/exim4/mainlog <== 2021-01-06 19:11:47 H=(MyCloudron.io) [1.1.1.1] X=TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256 CV=no F=<SRS0=0ad3=GK=SenderServer.com=me@DestinationServer.com> rejected RCPT <me@DestinationServer.com>: Sender verify failed ==> /var/log/exim4/rejectlog <== 2021-01-06 19:11:47 H=(MyCloudron.io) [1.1.1.1] X=TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256 CV=no F=<SRS0=0ad3=GK=SenderServer.com=me@DestinationServer.com> rejected RCPT <me@DestinationServer.com>: Sender verify failed ==> /var/log/exim4/mainlog <== 2021-01-06 19:12:22 TLS error on connection from (MyCloudron.io) [1.1.1.1] (recv): The TLSconnection was non-properly terminated.
-
@freetommy If I understand you correctly, what you are saying is that when email forwarding is enabled in rainloop, then the forwarding is done directly to the destination domain via port 25 instead of using Cloudron's email relay. Did I get that right?
-
@girish Sorry to hijack this topic, but this could be related to my issue as well. I was already talking to @nebulon on the chat but I couldn't get this to work even with the latest version of Cloudron (6.3.2).
What I'm trying to do (and please, tell me if there's another way to solve this): I'm hosting a website where different cities/locations get email addresses like location@example.com. Those that are new to the project don't get to use the address to send emails, they should only be on the receiving end, so they give me their address and I'll add a forwarding rule in Rainloop.
So a mail to location1@example.com should be delivered to non-cloudron-email@somehoster.com. I've added a filter in Rainloop and use Postmark as an email relay. The mails to location1@example.com (obviously) arrive with no problems, but the forwarding does not work due to a SMTP API Error on Postmark:
The 'From' address you supplied ("Name" mytest@email.com) is not a Sender Signature on your account. Please add and confirm this address in order to be able to use it in the 'From' field of your messages.
I can't add that address to the sender signatures, because this could be any email address out there. This also includes mailinglists, so every forward to a non-Cloudron address is being blocked.
So the important question is (and it's a rather urgent one, because I was hoping the last update fixed this): How can I forward mails to non-Cloudron addresses, any ideas?
-
@msbt Just tested this now via postmark and forwarding via sieve and mailing list works for me.
I can't add that address to the sender signatures, because this could be any email address out there. This also includes mailinglists, so every forward to a non-Cloudron address is being blocked.
You only have to add the sender signature for the domain for which postmark is relaying. For example, cloudron.space is my domain and I am relaying it via postmark. Like this:
My roundcube filter looks like this:
-
OK, @msbt helped me figure this one out. The issue comes when using forwarding feature with relays like postmark. Such relays do not allow Envelope From to be different than Header From . We found a workaround for the moment by using a sieve script but I will look into how this can be incorporated into the mail server itself.
The sieve script we used is something like below. This requires the editheader extension which is now enabled by default in 6.3.3.
require "editheader"; require "variables"; require "envelope"; # ... Any other rules # Obtain the user's full email address somehow # It can be obtained from the recipient address (without full name) # An alternative is to put the primary address into the script as a literal. if envelope :matches "to" "*" { set "user_email" "${1}"; } if envelope :matches "from" "*" { set "real_from" "${1}"; } # This part of the script MUST be the final rule, otherwise other rules are # affected since the message is modified. # Drop the original "From:" header deleteheader "from"; deleteheader "to"; # Add a new "From:" header addheader "From" "${user_email}"; addheader "Reply-To" "${real_from}"; addheader "To" "test@cloudron.io"; redirect "test@cloudron.io";
-
@girish thanks for that, I added one line to it, so the mails stay in the inbox in addition to the redirect, else they would not be saved:
require "editheader"; require "variables"; require "envelope"; require "fileinto"; # ... Any other rules fileinto "INBOX"; # Obtain the user's full email address somehow # It can be obtained from the recipient address (without full name) # An alternative is to put the primary address into the script as a literal. if envelope :matches "to" "*" { set "user_email" "${1}"; } if envelope :matches "from" "*" { set "real_from" "${1}"; } # This part of the script MUST be the final rule, otherwise other rules are # affected since the message is modified. # Drop the original "From:" header deleteheader "from"; deleteheader "to"; # Add a new "From:" header addheader "From" "${user_email}"; addheader "Reply-To" "${real_from}"; addheader "To" "test@cloudron.io"; redirect "test@cloudron.io";
where
test@cloudron.io
is the address that the emails should be forwarded to.To activate this you have to edit the file
/home/yellowtent/boxdata/mail/vmail/address_to_be_forwarded@example.com/sieve/rainloop.user.sieve
and paste it inside the filter block.