Overcoming Imapsync Limitations: Working with Sieve Filters

I marked you as solution, although it is not an actual solution.
This is a serious limitation for my case (and at least one customer’s case), when NS7 worked.
I really need to see how to make this work.

Also more info: I even tried using an intermediate account. No go.

  • We want mail for x@domain.com.
  • We want to keep mail on “master” mail server until imapsync picks it up.
  • In NS8 we create x and x-inbound.
    Theory is:
  • imapsync get mail for x@domain.com to mailbox x-inbound.
  • …but x-inbound, actually forwards to x so that x doesn’t receive mail from imapsync but from another user, so rules/anti-spam should run.
  • …no go, because ALSO x-inbound forwarding to x doesn’t work (although seemingly it is done by mail server not imapsync). Mail stays in x-inbound and never forwards to x.

Is this still a restriction of mail server? x-inbound “doesn’t even know” it gets email, so it doesn’t forward it?

Any idea that could work?
The problem is that I need rules to work and I need to keep imapsync, because NS8 mail server is hidden behind the actual one (even outbound mail is done with relay).

2 Likes

I guess it’s the same problem that was with the pop3connector in version 7.9: the mail is copied directly to the INBOX folder of the mailbox and doesn’t go through the mail server to be processed with the inbox rules (forwarding, spam filtering, etc.)

1 Like

There’s a Getmail fork that has already been packaged in the Alpine Testing repository. We could consider taking a look at it in the future! You can check it out here: Alpine Linux Packages - Getmail

Good, but if it works as it did on 7.9 we are back to square one.
Either this time you implement a configuration like changes as I had done in my time on 7.9 or we are still with the same problem.

(the (in)famous getmail 6?)

Not really. In 7.9 my rules I can assure you worked fine.

I would love you make it that we somehow try it.

Do I need to “officially” propose this in some platform or is it something already written down on some check/to-do list?
I can see this being an issue more when more SOHO move from NS7 to NS8. It is not so uncommon to use a front-end mail server.

Anybody? What should I do next?

@mrmarkuz and I are at the nethesis partner meeting and we shared about your issue nick. Getmail6 could be done and the only way I could see it workable could be to fetch the mail from pop/imap and send you back by smtp

@saitobenkei is this the modification you did ?

Speaking sieve rule it is true they are not applied when you fetch by imapsync because we do not use directly lmtp but did you gave a try with dovecot client like roundcubemail or SOGo to use sieve filter script.

Getmail back will be a long journey do not expect it back soon :slight_smile:

1 Like

Of course! That’s how I think getmailshould work by going through the smtp server the mail would follow all the path of a normal mail with the handling of filters and redirects and copies of mail to other users.

Then (if you use getmail in smtp mode) the ability to download mails also from folders other than inbox.
For example even the spam folder because some providers do not allow to disable spam filters and move mails to dedicated folders.

(I am at Nethesis Partner as well. Greetings!)

2 Likes

I really hope this jumps a few places up in the todo list as it deserves.

Right now I cannot use it for my own server plus I cannot install it to at least one client that I know uses rules and wants the front-end (out of premises)/back-end scheme.

It is not as uncommon as you think for SOHO.

If in the meantime anybody can think of any trick or whatever, let me know.

1 Like

don’t know if it can work… just food for thought:

3 Likes

Hi @NLS

As you’re not unfamiliar with Linux, and are running KVM, my stopgap (to allow you to proceed your plans as planned) idea would be to spin up a dedicated getmail VM or container, which feeds the mail via port 25 into NS8.

This would allow your sieve filters to work as planned, and your front-end / back-end to work too.

Your mileage may vary (But you will get there!)

:slight_smile:

My 2 cents
Andy

1 Like

Bypass rspamd was a target, no real plan to get it workable with imapsync but imapsieve filter yes I discovered lastly. However we could make it workable maybe

2 Likes

Not a bad idea @Andy_Wismer …I will look into it. Of course. this is a workaround and has some overhead.
I really hope NS8 itself in the end, implements a solution even if it’s a transparent internal workaround.

Hi @NLS

I did state stopgap, which is the same as a workaround…

I know the frustration / pain when you want to go ahead with a project and a small part breaks it…

:slight_smile:

And it also leaves you the option to occasionally turn of the VM and test if the latest fix for NS8 solves the issue.

Good luck!

My 2 cents
Andy

How about this?
patrickstigler/docker-fetchmail: alpine based fetchmail container
Any other container you could propose?

What I don’t know, is how it reacts to destination being offline (for example at boot, the container will start much faster within the host than NS8 VM).

Thanks for that suggestion, @NLS I didn’t think about looking for existing ones.
I would have spun my own as VM or Container…

:slight_smile:

May be an acceptable “race condition”, until the mail server is up properly.
Don’t forget, that SMTP entails several attempts (Eg if MX is used).
So the container would attempt for 5 days (more than enough time for your NS to boot!)
Also it would be a high coincidence if then a real mail comes in at those few seconds / minutes…

A few additional bonuses:
The container as such does not need to be accessible from the Internet, as it does not recieve mail, it “fetches” mail. It initializes the external Internet connection to the external SMTP server.
This alone highly simplifies “securing” this container.

My 2 cents
Andy

I still have things to clear out, for example the most important, if it is able to work with multiple accounts (both for source and destination).

We’ll see.
Of course NS8 internal solution would be nicer.

No one is argueing with this.

But sometimes the rest of the world can’t wait for a minute detail…

:slight_smile:

Depends how the system is set up, I don’t really see an issue here. As an example, Postfix, Exim, Qmail and Sendmail are all multitennant capable MTAs.
Getmail or Fetchmail pick up mails from one or several servers and forward them to where needed, they don’t really care about mail-domains. It all comes down to mail-routing, which shouldn’t be too hard here.

Outgoing could be done by NS8 using Smarthost.

If you’re only referring to several accounts on the same domain, even easier!
I was thinking about multitennancy, or several different domains on the same NS8 and all need external “fetching”…
Both are doable.

My 2 cents
Andy