Sendmail Server : Mail Archiving using Synonym: Part-6

Sendmail Server : Mail Archiving using Synonym: Part-6

by -
0 1274

To archive every email that passes through my sendmail box, regardless of which mailbox it goes to, or if it is destined for a valid recipient. That is to say, I want every email that is sent to my sendmail server for acceptance to be archived into a separate mailbox called “[email protected]”.

#useradd report
#useradd report.in
#useradd report.out

set password accordingly.
#cd /usr/local/bin
Download the Synonym RPM

#wget http://www.dv8.ro/Synonym/Synonym/source/synonym-0.4-3.i386.rpm
#rpm -ivh synonym-0.4-3.i386.rpm
#vi /etc/synonym.conf

<Rules>
<Rule>
<Condition>
<Header>From</Header>
<Match>.*</Match>
</Condition>
<Action>
<ActionType>Copy</ActionType>
<Address>report</Address>
</Action>
</Rule>
</Rules>

#service synonym start
#service synonym restart
#chkconfig synonym on

#vi /etc/mail/sendmail.mc (In the last of this file)

define(`_FFR_MILTER’, `true’)
INPUT_MAIL_FILTER(`Synonym’, `S=local:/var/run/synonym/synonym.sock, T=C:10m;S:1s;R:1s;E:5m’)

#m4 sendmail.mc > sendmail.cf
#service sendmail restart
#service synonym restart


Incoming & Outgoing mail archive.

#vi /etc/synonym.conf

<Rules>
<Rule>
<Condition>
<Header>From</Header>
<Match>.*@linuxgateway.in</Match>
</Condition>
<Action>
<ActionType>Copy</ActionType>
<Address>report.out</Address>
</Action>
</Rule>
<Rule>
<Condition>
<Header>To</Header>
<Match>.*@linuxgateway.in</Match>
</Condition>
<Action>
<ActionType>Copy</ActionType>
<Address>report.in</Address>
</Action>
</Rule>
<Rule>
<Condition>
<Header>From</Header>
<Match>.*</Match>
</Condition>
<Action>
<ActionType>Copy</ActionType>
<Address>report</Address>
</Action>
</Rule>
   </Rules>

 

Note:   This will sort all incomming mails to [email protected], and all outgoing mails to           [email protected] and all incomming and ourgoing mails to [email protected]

Download PDF

CEO, KV IT-Solutions Pvt. Ltd. | [email protected] | 9810028374|
Linux Professional and an Industrial Trainer | 20 + years Experience in IT Industry

” We are born free, No Gate and Windows can snatch our freedom “

SIMILAR ARTICLES

0 1522

0 1163

0 1056

NO COMMENTS

Leave a Reply