SMTP Relay local / remote deliveries to Relay Server

Good day,

I just want to ask and if its possible.

A specific user (1@d.com) to relay all outgoing to a relay server both local deliveries and remote deliveries including to itself (1@d.com) and to its domain (d.com).

Jay

Hello Jay,

Have you tried to addan advance routing rule simiilar with the following one:

I’ve not tested but it should work. Maybe it may need some tweaks but I hope you get the point of what I was trying to do.

BR,
Ioan

Thanks @indreias for the quick response.

I’ll try to modify my current test and incorporate yours. I’ll give a feedback with the result.

Jay

After doing multiple test from advance routing still does not relay externally.
It loops directly on its mailbox / domain and to other hosted domain.

This is the incoming header.

Return-Path: 1@d.com
Received: from [x.x.x.x] by d.com with HTTP;
Thu, 14 Apr 2022 16:10:20 +0400
From: 1@d.com
Date: Thu, 14 Apr 2022 16:10:20 +0400
X-Mailer: Axigen WebMail
To: 1@d.com 1@d.com
Reply-To: 1@d.com
Message-ID: 1649938220925222497@d.com
Subject: Test mail only
Importance: Normal
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="===axigen=8731961675143648973799780681259546896167=axigen==="

This is a MIME message. You may need a MIME compliant mail user agent.
–===axigen=8731961675143648973799780681259546896167=axigen===
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Test mail only

I will do more test, but I am not succeeding currently. I just want to disable local delivery.

Jay

@indreias

No progress but I found something useful with the logs.

  • I did not process or check the advance routing. It checks only the filters.
  • Then on processing it state to PROCESSED - LOCAL

2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Shepherd thread received signal for processing
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set recipient 2@e.com state to RECEIVED
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set mail state to PROCESSING
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Start processing mail
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set recipient 2@e.com state to PROCESSING
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Start filter AV:Tnef of type socket filter from server
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Processing started
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Shepherd thread finished processing signal
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Filter AXI-TNEF(127.0.0.1:8888):[PASS]: pass - no changes
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Finished filtering mail object 007E88 with filter: AV:Tnef of type socket filter from server
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set recipient 2@e.com data version to 1
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set recipient 2@e.com state to PROCESSING
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Start filter WASieveServer of type script filter from server
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Keep requested for 2@e.com
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Finished filtering mail object 007E88 with filter: WASieveServer of type script filter from server
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set recipient 2@e.com state to PROCESSING
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Start filter WASieveDomain of type script filter from domain <e.com>
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Keep requested for 2@e.com
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Finished filtering mail object 007E88 with filter: WASieveDomain of type script filter from domain <e.com>
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set recipient 2@e.com state to PROCESSING
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Start filter wmFilter of type script filter from domain object 2@e.com
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Keep requested for 2@e.com
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Finished filtering mail object 007E88 with filter: wmFilter of type script filter from domain object 2@e.com
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set recipient 2@e.com state to PROCESSING
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Start filter itip filter
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Finished filtering mail object 007E88 with filter: itip filter
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set recipient 2@e.com state to PROCESSING
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Start filter onProcessing event
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Finished filtering mail object 007E88 with filter: onProcessing event
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set recipient 2@e.com state to PROCESSING
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set recipient 2@e.com state to PROCESSED - LOCAL
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set mail state to PROCESSED
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Processing finished
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Shepherd thread received signal for delivery
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Shepherd thread finished delivery signal
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Start mail delivery
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set mail state to SENDING
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Start local delivery for 1 recipients in domain e.com (domain id: 00000002, mail version: 0001)
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Mail delivered to mailbox ‘INBOX’ of 2@e.com with id 3
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Mail delivered to 1 recipients in domain e.com (domain id: 00000002)
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set recipient 2@e.com state to SENT
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Delivery attempt completed for mail 007E88; schedule for cleanup
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set mail state to SENT
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Shepherd thread received signal for cleanup
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Start mail cleanup
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Mail removed from queue
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Set mail state to REMOVED
2022-04-15 14:31:58 +0400 08 Svr PROCESSING:00007E88: Shepherd thread finished cleanup signal

Return-Path: 1@d.com
Received: from [x.x.x.x] (x.x.x.x) by Svr (Axigen)
with ESMTP id 007E88; Fri, 15 Apr 2022 14:31:58 +0400
To: 2@e.com
From: “1@d.com1@d.com
Subject: Test
Message-ID: 5a437021-1a21-39de-24ae-daa52f20540e@d.com
Date: Fri, 15 Apr 2022 14:31:57 +0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0)
Gecko/20100101 Thunderbird/78.14.0
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="------------458E2500108DCC65A3DC58B6"
Content-Language: en-US

This is a multi-part message in MIME format.
--------------458E2500108DCC65A3DC58B6
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

Test

--------------458E2500108DCC65A3DC58B6
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

Any help or suggestion will do. Thanks

Hello Jay,

You have changed the action from what I have put in my example and your rule moved to onRelay event insted of staying onRecipient which explain why it is not triggered in your case.

Now, because I know that you like to relay the message with auth I’ll try to see what could be done.

BR,
Ioan

Hello Jay,

So, because you need to send via an authenticated SMTP relay than you have to split the rule in 2 parts:

1/ A rule that will set a relay rule for all messages sent by the special account (in our case 1@d.com)

2/ A rule that set credentials for the special relay session set for that account

From my simple tests all looks fine but in your particular setup it may not work without any further tweaks.

HTH,
Ioan

Thanks @indreias, Understood all the details provided.

I will do some test as well.

Appreciate always your inputs.

Regards,
Jay

@indreias

Thanks a lot. The concept works. Appreciate always.
Modified the way I wanted to use it and working as it should be.

Regards,
Jay

1 Like