Copy to imap folder

Use this forum if you want to suggest a new feature to hMailServer. Before posting, please search the forum to confirm that it has not already been suggested.
Post Reply
User avatar
Conzi
Normal user
Normal user
Posts: 150
Joined: 2006-02-24 14:44
Location: Varese, Italy

Copy to imap folder

Post by Conzi » 2020-01-15 12:33

Hi,
it would be useful for me (and for others tough) to have the rule "copy to IMAP folder" in addition to "move to IMAP folder"
I need to distribute the same email (digitally signed) to multple address... the rule forward breaks the digital sign; move to IMAP folder is ok, but
it can only be used once (for a single mail)

thanks

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: Copy to imap folder

Post by SorenR » 2020-01-15 14:59

Conzi wrote:
2020-01-15 12:33
Hi,
it would be useful for me (and for others tough) to have the rule "copy to IMAP folder" in addition to "move to IMAP folder"
I need to distribute the same email (digitally signed) to multple address... the rule forward breaks the digital sign; move to IMAP folder is ok, but
it can only be used once (for a single mail)

thanks
Not quite so simple... Allthough you can use "move to IMAP folder" in a global rule executed as "administrator", it is actually executed as an "account rule" with the rights of the receiving mail account. It simply cannot see the other accounts.

It will require some major rewriting of the Rules engine to do this.

An alternative solution is to enable public folders, create a folder, assign rights to this folder amongst the accounts in question and move the email to that folder.

Go to hMailServer Administrator -> Settings -> Protocols -> IMAP [Public folders]
Click on "Edit folders"
Right click on left pane and select "Create folder"
Type name and click on "Edit permissions"
Add accounts and set permissions.

Default folder name is "#Public" and default folder separator is "." so if you create "MailAShare" you will need to move to IMAP folder "#Public.MailAShare".
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

User avatar
Conzi
Normal user
Normal user
Posts: 150
Joined: 2006-02-24 14:44
Location: Varese, Italy

Re: Copy to imap folder

Post by Conzi » 2020-01-15 16:55

SorenR wrote:
2020-01-15 14:59
Conzi wrote:
2020-01-15 12:33


An alternative solution is to enable public folders, create a folder, assign rights to this folder amongst the accounts in question and move the email to that folder.

Go to hMailServer Administrator -> Settings -> Protocols -> IMAP [Public folders]
Click on "Edit folders"
Right click on left pane and select "Create folder"
Type name and click on "Edit permissions"
Add accounts and set permissions.

Default folder name is "#Public" and default folder separator is "." so if you create "MailAShare" you will need to move to IMAP folder "#Public.MailAShare".

I'm already doing this way... but I would have preferred to have one public folder per user

thanks for your time :-D

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

Re: Copy to imap folder

Post by mattg » 2020-01-15 23:22

I don't understand this bit...
Conzi wrote:
2020-01-15 16:55
but I would have preferred to have one public folder per user
Can you please explain that bit in more detail
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
Conzi
Normal user
Normal user
Posts: 150
Joined: 2006-02-24 14:44
Location: Varese, Italy

Re: Copy to imap folder

Post by Conzi » 2020-01-17 15:33

mattg wrote:
2020-01-15 23:22
I don't understand this bit...
Conzi wrote:
2020-01-15 16:55
but I would have preferred to have one public folder per user
Can you please explain that bit in more detail
with "move to imap folder" i can move the email to only one user (only one public folder, as every user has one)

but often I need to move same email to many user, sometime same email to one user, sometime to two user and so on, with rules.

I cant' user "forward" or distribution list, because breaks digital signature.
The email are downloaded via pop3 from another server, so... for every user I have to download the same emails (and duplicate the rules)
Using "copy to imap folder" repeated for the user I need (with rules) will be perfect (only one download via pop3 then copy to imap folder rules...)

User avatar
SorenR
Senior user
Senior user
Posts: 6308
Joined: 2006-08-21 15:38
Location: Denmark

Re: Copy to imap folder

Post by SorenR » 2020-01-17 17:53

Not sure how good your scripting skills are and I have no idea if this breaks digital sign but it is something I have played with as part of some code to deliver email with illegal attachments to "Postmaster" before hMailServer actually remove the attachment(s) and deliver to account... Just in case of false-positives 8)

Code: Select all

Function CloneMail(oMessage, strRecipient, strAddress, strHeader)
    '
    '   CloneMail(oMessage, "Wile E. Coyote", "wile.e.coyote@acme.inc", "X-hMailServer-Cloned")
    '
    Dim strFilename
    If oMessage.HeaderValue(strHeader) = "YES" Then Exit Function
    With CreateObject("hMailServer.Message")
        strFilename = .Filename
        With CreateObject("Scripting.FileSystemObject")
            .CopyFile oMessage.Filename, strFilename, True
        End With
        .RefreshContent
        .AddRecipient strRecipient, strAddress
        .HeaderValue(strHeader) = "YES"
        .Save
    End With
End Function
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

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

Re: Copy to imap folder

Post by mattg » 2020-01-18 02:52

Conzi wrote:
2020-01-17 15:33
mattg wrote:
2020-01-15 23:22
I don't understand this bit...
Conzi wrote:
2020-01-15 16:55
but I would have preferred to have one public folder per user
Can you please explain that bit in more detail
with "move to imap folder" i can move the email to only one user (only one public folder, as every user has one)
Can't multiple accounts access the same #public.folder
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Post Reply