Mirroring issue

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
Pawkez
New user
New user
Posts: 13
Joined: 2017-10-26 10:40

Mirroring issue

Post by Pawkez » 2017-12-12 10:40

I have Mirror email indicated. Sometimes for some reasons it could be unreachable for the moment.
Hmailserver than sends "Message undeliverable: " to the sender.
I do not need this to happen cuz Users shouldn't be bothered by this and once they see unknown email for them (mirror email) the start to ask questions :)

So the question is how to switch it off (sending the alerts to Users).
HMS 5.6.7 B2415 on Win Server 2016 VM + clamd + SpamAssassin

User avatar
mattg
Moderator
Moderator
Posts: 21025
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Mirroring issue

Post by mattg » 2017-12-12 12:27

Catch the NDRs with a global rule

If from contains 'mailer-daemon'
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
katip
Senior user
Senior user
Posts: 775
Joined: 2006-12-22 07:58
Location: Istanbul

Re: Mirroring issue

Post by katip » 2017-12-12 14:31

Pawkez wrote:I have Mirror email indicated. Sometimes for some reasons it could be unreachable for the moment.
assuming that your mirror account is an external one, it's a better idea to have a local one, i.e. normally reachable as long as your server is up.
then you can POP it from your external account if you like to keep your mirror off site.
Katip
--
HMS 5.7.0 x64, MariaDB 10.4.10 x64, SA 3.4.2, ClamAV 0.101.2 + SaneS

Pawkez
New user
New user
Posts: 13
Joined: 2017-10-26 10:40

Re: Mirroring issue

Post by Pawkez » 2018-02-07 12:42

mattg wrote:Catch the NDRs with a global rule

If from contains 'mailer-daemon'
I think it is not a good idea. It will catch ALL "mailer-daemon" letters and not only from this bkp emailing,
katip wrote:assuming that your mirror account is an external one, it's a better idea to have a local one, i.e. normally reachable as long as your server is up.
then you can POP it from your external account if you like to keep your mirror off site.
It will make Data to be doubled locally (tripled in my case).

This Forward mirroring should work with external account (even if they are off for a while and shouldn't send anything to non Admin local accounts) as I think it is it's only meaning.
HMS 5.6.7 B2415 on Win Server 2016 VM + clamd + SpamAssassin

agatha
Normal user
Normal user
Posts: 49
Joined: 2015-10-30 11:13

Re: Mirroring issue

Post by agatha » 2018-02-08 14:35

There is no difference between "send to a local mirror and pop it from an external account" and "send directly to an external account" regarding the number of copies. When you pop from the mirror account, there will be no loop.

Let´s make it precisely:

1. You send or receive an e-mail. -> One mail on the server
2. A copy of this mail is delivered to the mirror account. -> Two mails on the server
3. You pop from an external account -> Still two mails on the server
4. You delete after pop -> One Mail on the server

There is no scenario, that mirroring doubles e-mails, when you pop (and delete of course) from an external account (as long as you don´t force it by a rule).

That is exactly the way I do this.

Pawkez
New user
New user
Posts: 13
Joined: 2017-10-26 10:40

Re: Mirroring issue

Post by Pawkez » 2018-02-08 15:38

agatha wrote: 1. You send or receive an e-mail. -> One mail on the server
Yes
agatha wrote: 2. A copy of this mail is delivered to the mirror account. -> Two mails on the server
No. HMS integrated Forwarding sends a copy to any email that you want to be all letters in and out to be copied (but only one email).
The point is that this is separate server.
HMS 5.6.7 B2415 on Win Server 2016 VM + clamd + SpamAssassin

User avatar
mattg
Moderator
Moderator
Posts: 21025
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Mirroring issue

Post by mattg » 2018-02-08 16:59

Pawkez wrote:The point is that this is separate server.
The counter point is that your insistence on this being a separate server is what causing this issue you face in the first place.

If you mirror to a local account, and then from the remote server POP3 (and Delete) from the mirror account, your issue won't happen. If pop3 drops out, it just gets picked up next time.
You get mail on a separate server, and no extra copies are kept locally.

Why the reluctance?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Pawkez
New user
New user
Posts: 13
Joined: 2017-10-26 10:40

Re: Mirroring issue

Post by Pawkez » 2018-02-08 18:11

mattg wrote: The counter point is that your insistence on this being a separate server is what causing this issue you face in the first place.
The issue is a bit different. HMS sends "daemon letters" to local accounts about unknown (for them) address unreachable and it is HMS built in Mirroring which is wrong imho.
mattg wrote: If you mirror to a local account, and then from the remote server POP3 (and Delete) from the mirror account, your issue won't happen. If pop3 drops out, it just gets picked up next time.
You get mail on a separate server, and no extra copies are kept locally.

Why the reluctance?
Yes. Of course I can send it to any local account. Than to make another server POP it and delete. But it will not be good for local SQL database activity and once I have to shadow copy MailData several times a day cuz HMS cannot make BackUps by itself (for big databases) and I have to do complementary back ups (due to work specific - nothing should be lost or user deleted) than it would add much empty space being wasted by this .

The only point abt this is the thing than instead of ONE copy being send by server on the fly without impact to the local data I have to make several actions which are space and performance demanding and much more attention dependant.
HMS 5.6.7 B2415 on Win Server 2016 VM + clamd + SpamAssassin

User avatar
mattg
Moderator
Moderator
Posts: 21025
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Mirroring issue

Post by mattg » 2018-02-08 23:59

Pawkez wrote:I have Mirror email indicated. Sometimes for some reasons it could be unreachable for the moment.
Going back to this

Normal retry attempts should be made.
This is not a failure from a single attempt to send mail, unless your normal retry attempts are set for one attempt only.

The RFCs state that a server should try for up to 3 days I believe.
So, for your issue to occur, where the NDR is sent to someone you don't want it to, then the mirror server has to be offline for quite a while.
Pawkez wrote:I do not need this to happen cuz Users shouldn't be bothered by this and once they see unknown email for them (mirror email) the start to ask questions
I do hope you realise that copying a message to a recipient without the sender's knowledge is illegal in many circumstances/countries/scenarios, and that you need to have checked local laws and know that you are allowed to copy mail under your local laws in your circumstances.
Pawkez wrote:The only point abt this is the thing than instead of ONE copy being send by server on the fly without impact to the local data I have to make several actions which are space and performance demanding and much more attention dependant.
And the only counterpoint is that this is a situation that you have created due to your setup, and that you have been offered a number of ways to mitigate this situation that you don't like.

Can hMailserver do exactly as you want ?
Pawkez wrote:So the question is how to switch it off (sending the alerts to Users).
There is no way to switch off NDRs from hMailserver
hMailserver is OpenSource and is on Github. Feel free to fork the source and make the changes that you want
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Pawkez
New user
New user
Posts: 13
Joined: 2017-10-26 10:40

Re: Mirroring issue

Post by Pawkez » 2018-02-09 10:39

mattg wrote: Normal retry attempts should be made.
This is not a failure from a single attempt to send mail, unless your normal retry attempts are set for one attempt only.

The RFCs state that a server should try for up to 3 days I believe.
So, for your issue to occur, where the NDR is sent to someone you don't want it to, then the mirror server has to be offline for quite a while.
Somehow this Mirorred email was being send only once. But in any case - it isn't right imho once it didn't reach destination and stopped attempts. It isn't a Mirroring than but simple Forwarding.
mattg wrote: I do hope you realise that copying a message to a recipient without the sender's knowledge is illegal in many circumstances/countries/scenarios, and that you need to have checked local laws and know that you are allowed to copy mail under your local laws in your circumstances.
Be sure. It is only one's company mailserver and this were made only for additional bkp purposes.
mattg wrote:And the only counterpoint is that this is a situation that you have created due to your setup, and that you have been offered a number of ways to mitigate this situation that you don't like.

Can hMailserver do exactly as you want ?
I am appreciated to all for variants. And I wrote why exactly I didn't like it. As it is really additional bkp and I can discard it for now.

It depends but hMailserver is great and works really smooth.
mattg wrote:There is no way to switch off NDRs from hMailserver
hMailserver is OpenSource and is on Github. Feel free to fork the source and make the changes that you want
I am not so clever to do it without break something :)
HMS 5.6.7 B2415 on Win Server 2016 VM + clamd + SpamAssassin

User avatar
jimimaseye
Moderator
Moderator
Posts: 8707
Joined: 2011-09-08 17:48

Re: Mirroring issue

Post by jimimaseye » 2018-02-09 15:09

Pawkez wrote:It isn't a Mirroring than but simple Forwarding.
By this statement you imply there could be an alternative method that doesnt involve forwarding of emails. Given that scope of the function was to offer an ability to acheive such results to both local or remote systems, how would you expect that to happen if it didnt involve forwarding? Such 'mirroring' (that doesnt involve smtp forwarding) would mean some sort of data/message copy to a system (to which you have adminisitration rights in order to set it up for receiving) to which, in turn, would limit what systems you can copy to (effectively your destination would be an externsion of your LAN). This gives the current method a lot more scope than relying on a data copy.

So, you may argue the symantics of the choice of definition or 'mirroring', and if you wish you can change it in your mind to "blanket email forwarding" to suit your idea, but as soon as you accept that it is an SMTP forwarding that is happening you also then have to accept everything SMTP protocol including volatile destination servers, retry limits and NDR handling. After all, you have accepted it as being a forwarding option on account you want it to replicate to an external system. Just as well the feature existed for you, eh. :-)
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

Post Reply