Deleting messages after forwarding

Shredsec

Registered
Aug 7, 2013
0
0
0
cPanel Access Level
Website Owner
I have set up lots of email forwarding but can't work out how to automatically delete the emails received in the first account after they have been forwarded to the destination account.
 

ThinIce

Well-Known Member
Apr 27, 2006
352
9
168
Disillusioned in England
cPanel Access Level
Root Administrator
The easiest way to address this (provided you don't want to retain the copy of the message) is to delete the first mailbox entirely and retain this address solely as a forwarder.
 

lanquest-it

Member
Apr 9, 2008
10
0
51
Funny this. I have a client that's asking the very same question.

The problem is that their mailbox users use the account to send emails.

I have tested the Forwarders, Account Level Filtering and User Level Filtering options and in all cases the email still arrives in the first mail account inbox.

In the case of using the Account Level Filtering and User Level Filtering options.
Even if you set the second action to "Discard Message". The email still arrives in the first mailbox.

Is this a bug? How can this be achieved?
 

quietFinn

Well-Known Member
Feb 4, 2006
1,894
464
438
Finland
cPanel Access Level
Root Administrator
Funny this. I have a client that's asking the very same question.

The problem is that their mailbox users use the account to send emails.
They could use their cPanel username & password to send emails.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello :)

Rather than setting up a forwarder, you could utilize the "User Level Filtering" option for the first email address. Setup a rule to redirect the email sent to the first address, and then have the additional rule discard the message.

Thank you.
 

lanquest-it

Member
Apr 9, 2008
10
0
51
Hello :)

Rather than setting up a forwarder, you could utilize the "User Level Filtering" option for the first email address. Setup a rule to redirect the email sent to the first address, and then have the additional rule discard the message.

Thank you.
Hi Michael,

I've mentioned in my post. We tested that scenario using both the Account Level Filtering and User Level Filtering options setting the second action to "Discard Message".

If the mailbox exists, the email is still being sent to the 1st mailbox after being forwarded. Message".

I've even setup with just the action "Discard Message". The email still arrives in the mailbox.

Hence why I'm asking if this is a bug?..
Surely it's supposed to discard the email after the email is forwarded correct?

Or perhaps we're all missing a small extra config in Exim somewhere?

Forgot to add: Our server is running WHM 11.38.1 (build 15) | CPanel 11
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
I was unable to reproduce the behavior you have described when using the "User Level Filtering" option. It worked as expected and forwarded the email after discarding the message. Could you take a screenshot or let us know the exact actions configured for the filter? Also, could you confirm the forwarder itself is removed when enabling the filter?

Thank you.
 

lanquest-it

Member
Apr 9, 2008
10
0
51
I was unable to reproduce the behavior you have described when using the "User Level Filtering" option. It worked as expected and forwarded the email after discarding the message. Could you take a screenshot or let us know the exact actions configured for the filter? Also, could you confirm the forwarder itself is removed when enabling the filter?

Thank you.
Hi Michael

I'm quite surprised with your findings.

I've tested with just the "Discard Message" option enabled and saved. There's no forwarding setup, the email still lands in the 1st mailbox.

08-08-2013 17-06-24.jpg

Would you be so kind to reply with the relevant version and build information for the following so I can compare.

Exim, CPanel, WHM

Much appreciated
 
Last edited:

quietFinn

Well-Known Member
Feb 4, 2006
1,894
464
438
Finland
cPanel Access Level
Root Administrator
Hi quietFinn,

Unfortunately this opens up the whole CPanel to the mailbox holders.
This is not what the Cpanel account holders want.
Then create a dummy email account and use that only for authentication.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
I've tested with just the "Discard Message" option enabled and saved. There's no forwarding setup, the email still lands in the 1st mailbox.
Do you have any third-party applications installed that could alter the behavior of Exim? The /var/log/exim_mainlog file should output the filter action. Feel free to open a support ticket so we can take a closer look:

Submit A Ticket

You can post the ticket number here so we can update this thread with the outcome.

Thank you.
 

lanquest-it

Member
Apr 9, 2008
10
0
51
Do you have any third-party applications installed that could alter the behavior of Exim? The /var/log/exim_mainlog file should output the filter action. Feel free to open a support ticket so we can take a closer look:

Submit A Ticket

You can post the ticket number here so we can update this thread with the outcome.

Thank you.
Thank you Michael. Ticket created.
 

lanquest-it

Member
Apr 9, 2008
10
0
51
Hi Guys,

The solution was this.

If you look at the screenshot provided, you'll see the rule is based on if the email address "Equals" [email protected]

08-08-2013 17-06-24.jpg

Change it to "Contains".
Now the whole thing works as it should.

That's it. Hell knows why this doesn't work with the Equals rule if the sender uses just the email address, you would expect it to work right?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Thank you for sharing the solution. Yes, in my testing, using "equals" worked without issue. However, using "contains" should have no negative effects if it provides the desired behavior.

Thank you.