-
Download perdition source file. Compile and furnish with all the required dependencies.
-
Configure the perdition to work with MySQL by running perdition_mysql_makedb and run through the whole process by providing the information required.
-
Configure the perdition.conf (if you are compiling from the source, it is usually located under /usr/etc/perdition/perdition.conf) in /etc
-
Change these for values at # M|map_library FILENAME: header
- M /usr/lib/libperditiondb_mysql.so
- map_library /usr/lib/libperditiondb_mysql.so.0
-
Enable ‘username_from_database’
-
Save the config file and restart
-
Voilla. Your perdition is ready to serve you
How to Perdition IMAP/POP3 Proxy – MySQL
•July 7, 2008 • Leave a CommentHow to – Postfix MySQL
•June 21, 2008 • Leave a CommentConfiguration details:-
+ CentOS 5
+ MySQL 5
+ Postfix 2.5
1. Download the latest Postfix from http://www.postfix.org/download.html
2. Untar the file run make command. Do as the following:-
# make install
3. Now to configure Postfix to lookup for aliases in MySQL database
Search the following line and change value to:
4. Now create a new file named mysql-aliases.cf in default Postfix configuration directory. Usually in /etc/postfix
Add the followings:
# The user name and password to log into the mysql server.
user = <database username>
password = <database user password>
# The database name on the servers.
dbname = <database name>
# For Postfix 2.2 and later The SQL query template.
query = SELECT forw_addr FROM mxaliases WHERE alias=”%s”;
5. Restart your postfix
# postfix start
Optional : You can also configure your Postfix to lookup for local recipients using MySQL database. Below is the example for database lookup and configuration with DBMail
6. Create a new file named sql-recipients.cf in Postfix configuration directory
Add the following:
password = <password>
hosts = <dbhost>
dbname = <dbname>
query = SELECT alias FROM dbmail_aliases WHERE alias=’%s’
UNION SELECT userid FROM dbmail_users WHERE userid=’%s’;
7. Configure your main.cf to map to the sql-recipients.cf file:
Look for local_recipient_maps and add the following value:
8. Restart your postfix
# postfix start
Reference Site:
DBMail with Postfix : http://www.dbmail.org/dokuwiki/doku.php?id=setup_postfix
Postfix MySQL : http://www.postfix.org/MYSQL_README.html
How to – Disclaimer with alterMIME and Postfix
•June 20, 2008 • Leave a CommentThis is the first time i’ve use web blog to store all my notes. Not really much on myself but I do think this really helps me when I don’t have much time to think about googling the web. Let’s head straigh to our main point. How to setup alterMIME to work with Postfix.
What is alterMIME
“alterMIME is a small program which is used to alter your mime-encoded mailpacks as typically received by Inflex, Xamime and AMaViS“
[taken from http://www.pldaniels.com/altermime/]
My configuration :
+ CentOS 5.0
+ Postfix 2.5
+ altermime 0.3.8
1. Download alterMIME from http://www.pldaniels.com/altermime
2. Compile alterMIME
# make install
3. Add a filter user
4. Create filter directory for user filter
# chown filter:filter /var/spool/filter
# chmod 750 /var/spool/filter
Postfix
5. Change directory to where your Postfix configuration files located. Usually under /etc/postfix
# cp master.cf master.cf.ori
6. Modify you master.cf by adding these lines.
-o content_filter=dfilt:
dfilt unix - n n - - pipe
flags=Rq user=filter argv=/etc/postfix/disclaimer -f ${sender} — ${recipient}
Usually, the first line is already added to the default master.cf file. Look for that line and just add the second line below the entry or you can remark/remove the old entry and just add a new line according to the above configuration.
Should you require only the outbound emails are added with disclaimer, you can do the following:
-o content_filter=dfilt:
127.0.0.1:smtp inet n - n - - smtpd
-o content_filter=dfilt:
dfilt unix - n n - - pipe
flags=Rq user=filter argv=/etc/postfix/disclaimer -f ${sender} — ${recipient}
The 192.168.1.25:smtp entry is the IP Address for the outgoing SMTP Server
7. Create a disclaimer file in your default Postfix configuration folder
# vi /etc/postfix/disclaimer.html
Add your own text. Example for disclaimer.txt:
If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone.
Please contact the sender if you believe you have received this email in error.
Example for disclaimer.html:
This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of “[business name]“.
If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone.
Please contact the sender if you believe you have received this email in error.
<a href=”www.abc.com”>ABC Company</a>
8. Create a disclaimer script in your default Postfix configuration directory.
# vi disclaimer
Add these lines in your disclaimer script
# Localize these.
INSPECT_DIR=/var/spool/filter
SENDMAIL=/usr/sbin/sendmail
FOLDER_DISCLAIMER=/etc/postfix/
# Exit codes from <sysexits.h>
EX_TEMPFAIL=75
EX_UNAVAILABLE=69
# Clean up when done or when aborting.
trap “rm -f in.$$” 0 1 2 3 15
# Start processing.
cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }
TEXT_DISCLAIMER=`grep “[a|A-z|Z]” ${FOLDER_DISCLAIMER}/disclaimer.txt | grep -v “_” | tail -2 | head -1`
cat > in.$$ || { echo Cannot save mail to file; exit $EX_TEMPFAIL; }
nohup grep “${TEXT_DISCLAIMER}” in.$$ > /dev/null 2>&1
if [ ! "$" = 0 ]; then
/usr/local/bin/altermime –input=in.$$ –disclaimer=${FOLDER_DISCLAIMER}/disclaimer.txt –disclaimer-html=${FOLDER_DISCLAIMER/disclaimer.txt –xheader=”X-Copyrighted-Material: Please visit http://www.company.com/privacy.htm” || { echo Message content rejected; exit $EX_UNAVAILABLE; }
fi
$SENDMAIL “$@” < in.$$
exit $?
9. Set permission for the disclaimer script
# chmod 750 /etc/postfix/disclaimer
10. Now we need to restart Postfix
# postfix start
Reference Site:
Zimbra – alterMIME and Postfix : http://wiki.zimbra.com/index.php?title=Adding_a_disclaimer_(altermime)_or_footer
