Incoming/Outgoing email copy

crazyaboutlinux

Well-Known Member
Nov 3, 2007
939
1
66
Hoping someone can help me for this


I need all incoming and outgoing mail forwarding to any other gmail account

How to do outgoing fw. ?

we are using

cPanel 11.24.4-S34960
WHM 11.24.2 - X 3.9
CENTOS 5.3 i686 standard
 

hzJayJ

Well-Known Member
Nov 14, 2008
76
1
58
It is not possible to forward outgoing mails from cpanel.

You can use the option forward options under your cpanel>>mail>>Forwarders to froward the incoming mails.
 

Lyttek

Well-Known Member
Jan 2, 2004
775
5
168
Not entirely accurate...

From within cPanel, no. But it's fairly simple to do...

A) your email program's outgoing mail server must use your cPanel server. If you use your ISP mail server to send mail, you can't do any processing on it.

B) configure your server to copy all email to the third account. There are several ways to do this, but the easiest to maintain is by installing MailScanner.

I highly recommend using the mailscanner stuff that configserver.com provides.

In any case, if you go this route, it's as simple as using the mailscanner 'archive' features to capture the email and forward it thusly:

in the 'archive.rules' file:

FromOrTo: *origin-domain.com [email protected]

This grabs email that is addressed From or To any address of origin-domain.com and sends it to [email protected]
 

Lyttek

Well-Known Member
Jan 2, 2004
775
5
168
If you set this up and use webmail, it will also capture those outgoing messages.
 

meeven

Well-Known Member
May 8, 2007
132
2
168
B) configure your server to copy all email to the third account. There are several ways to do this, but the easiest to maintain is by installing MailScanner.

I highly recommend using the mailscanner stuff that configserver.com provides.

In any case, if you go this route, it's as simple as using the mailscanner 'archive' features to capture the email and forward it thusly:

in the 'archive.rules' file:

FromOrTo: *origin-domain.com [email protected]

This grabs email that is addressed From or To any address of origin-domain.com and sends it to [email protected]
Brilliant! Thanks.

I have been using configserver's Mailscanner for two plus years without ever realizing it had this capability.
 
Last edited:

crazyaboutlinux

Well-Known Member
Nov 3, 2007
939
1
66
Hi,

I read a post from http://forums.cpanel.net/f43/want-save-all-outgoing-email-read-later-108285.html

And I tested it and it is working , maybe you could have a read and test it out :)
i have seen that thread

but i think that script is made only for domain.com

in my server there are 400 account created & more than 1000 email accounts

what about other domains & email accounts

in my server there are more than 150 domains are hosted e.g mydomain.com , mydomain.org , testdomain.com , testing.com

In mydomain.com there 5 email accounts
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

all email which are sent from those ids must be copy to [email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

all email which are sent from those ids must be copy to [email protected]
 

screege

Well-Known Member
Aug 11, 2004
197
2
168
Where do I find this archive.rules file? I have mailscanner updated and cannot find it anywhere

Regards
 

Lyttek

Well-Known Member
Jan 2, 2004
775
5
168
on my system (centos, but should be true elsewhere I think):

/usr/mailscanner/etc/rules/archive.rules

Having said that, you can set where rules are stored by modifying the mailscanner configuration file. I HIGHLY recommend getting the MailScanner Front End from ConfigServer.com
 

screege

Well-Known Member
Aug 11, 2004
197
2
168
I only have this archives:

[root@server1 rules]# ls
bounce.rules filename.rules.rules max.message.size.rules spam.action.rules spamhigh.action.rules spam.scanning.rules spam.whitelist.rules virus.scanning.rules
EXAMPLES filetype.rules.rules README spam.blacklist.rules spamhigh.score.rules spam.score.rules virus.delivery.rules

I have the most recent version of mailscanner and they can be viewed on the GUI in WHM thats why I asked. Then which file must be modified?

Regards
 

Lyttek

Well-Known Member
Jan 2, 2004
775
5
168
archive.rules will be the filename...

Is it enabled in the config? Have you verified the path for the archive.rules file in the config? It's possible to set a different path for each rule file.

It follows the same internal structure as the other files, such that:

Code:
FromOrTo: *domain.com [email protected]
FromOrTo: default no
Will send any email in/out of domain.com to [email protected]
 

screege

Well-Known Member
Aug 11, 2004
197
2
168
Yes I do not have that file under:

/usr/mailscanner/etc/rules

or anywhere on my server, as I stated I am using the latest version of configserver mailscanner with the front end attached to cpanel =o(

Maybe this file is depreciated in later versions
 

goodmove

Well-Known Member
May 12, 2003
643
4
168
archive.rules will be the filename...

Is it enabled in the config? Have you verified the path for the archive.rules file in the config? It's possible to set a different path for each rule file.

It follows the same internal structure as the other files, such that:

Code:
FromOrTo: *domain.com [email protected]
FromOrTo: default no
Will send any email in/out of domain.com to [email protected]
This is all good, but is there a way to archive the outbound mail to the 'Sent' IMAP folder of a Cpanel account instead of the Inbox? Can you do it like this in Mailscanner?

To: *domain.com [email protected]
From: *domain.com [email protected]/.Sent