How to disable delayed bounce back messages in exim

Posted by Farhad Malekpour in How To on July 27th, 2006 |  No Comments »

Problem: When a mail server accepts a message and later decides that it can’t deliver the message, it is required to send back a bounce email to the sender of the original message. These bounce emails are often misdirected.

For many MTAs there are solutions, so here is my solution for exim:

Solution: This solution uses filtering to discard bounced back emails. So your exim should have a central filter. Such filter can be configured in exim.conf configuration file like this:

system_filter = /etc/antivirus.exim

Where antivirus.exim is the filter file, Format of this file described in exim documentation:

http://www.exim.org/exim-html-4.62/doc/html/filter.html

Most CPanel boxes have this filter already set and working. Usually default filter file has these lines at the beginning

if not first_delivery
then
finish
endif

That means rest of the filter conditions will be ignored if that’s not the first delivery. To make sure you should put the bounce filter before those conditions or filter may not work properly.

Now the bounce conditions itself. Here is the code:

if $sender_address is “”
then
if ${lookup{${extract{2}{@}{$recipients}}}lsearch{/etc/localdomains}{yes}{no}} is “no”
then
fail text “Delayed bounce message ignored”
seen finish
endif
endif

This will discard any delayed bounce message. If you want to receive a copy of the discarded message (just to make sure it works) use this code:

if $sender_address is “”
then
if ${lookup{${extract{2}{@}{$recipients}}}lsearch{/etc/localdomains}{yes}{no}} is “no”
then
headers add “Old-Subject: $h_subject:”
headers remove “Subject”
headers add “Subject: [Delayed Bounce]$h_old-subject:”
headers remove “Old-Subject”
deliver “abuse@yourdomain.com
fail text “Delayed bounce message ignored”
seen finish
endif
endif

Make sure to replace the abuse@yourdomain.com with your email address.
Hope that helps someone.

Dayana MySQL Databases Check

Posted by Farhad Malekpour in Scripts on February 2nd, 2006 |  No Comments »

This script will check all tables within all MySQL databases of a server.

Code written in Perl and can be executed at a root access shell with a command like this:

perl dysqlcheck.pl

No installation will be needed Just download to a folder and execute. You might need to change some configuration parameters at the beginning of the script itself.

Read the rest of this entry »

Affiliate System

Posted by Farhad Malekpour in Programming on August 2nd, 2002 |  No Comments »

Aug 2002
Dayana Networks

A fully automated system for those who want to earn money by referring others to Dayana Networks. Flexible commission and direct payment using PayPal. Use cookie for tracking sales and referrals. Use mySQL for database and Perl for code.

Multipart Account Activation System

Posted by Farhad Malekpour in Programming on July 2nd, 2002 |  No Comments »

Jul 2002
Dayana Networks

As a part of my new e-commerce web site this web-based application control user payments in a secure SSL tunnel, then open account for hosting instantly. I use Perl/PHP for programming and mySQL for databases. All parts of this application have been written on RedHat Linux 7.3.

This process use multi way payments, basically it has these abilities:

  1. Accept Direct Credit Card payment in a SSL environment.
  2. Accept payments by PayPal.
  3. Tracking user activities by assigning a 16 digit unique order number.
  4. Accept 3 levels of accounts, Personal, Business and Reseller.
  5. Daily sales values for administration uses.
  6. Track refunds.
  7. Fraud Protection System on Credit Card payments.
  8. Customer Support Tracking System.
  9. Report any illegal access to administrator email and cell-phone (text messaging)
  10. Ability to open account on different Linux server.

Wireless Networks Solutions

Posted by Farhad Malekpour in Programming on June 2nd, 2002 |  No Comments »

Feb 2002 to Jun 2002
Parsian Networks

After using AVAYA, ORINOCO, Cisco and Lucent wireless solutions I prepared to start a new project for building some wireless devices, at the end of project these devices were ready to sell:

  • General Access Point (Prism + Linux Box) (save up to 90%)
  • AP + Bandwidth Manager
  • AP + Bridge
  • AP + Firewall
  • AP + BWM + Bridge + Firewall (save up to 95% on a $10,000 device!)

And of course we soled more than 10 boxes of them.

FSG Telephony Server - Phone to Phone for private use

Posted by Farhad Malekpour in Programming on February 2nd, 2002 |  No Comments »

Apr, 2001 to Feb 2002
Parsian Networks

In this big project I wrote a server/client that work thru TCP/IP between two or more points. At the first phase I initialize this system from Iran to UAE, each part have 160 phone lines for both calling and answering. Also a base server controls the phone lines from a high speed internet connection.  At this time my base server is located at Iran but I will change the location of the server to Canada or USA for better performance. In this server there is no limit on number of servers.
Also I design all of its hardware parts and now it can be soled to anyone interested to be a gateway for us. Each box can handle 8 phone line and a price of 6000 USD.
At this time this system required 8kb/s for each user but I’m in research to reach a lower bandwidth about 2.3kb/s for each user. The main idea is now complete but it takes 20 percent of an Intel Pentium III 600 CPU time for each user and it’s too high. I should resolve this problem and produce a new version of my server.

FSG Telephony Server - Phone to Phone in long distance - gateway

Posted by Farhad Malekpour in Programming on March 2nd, 2001 |  No Comments »

Mar, 2001
Parsian Networks

This server can worked under WinNT4.0 or Win2K and can answer the call, then take user pid and a password from caller, then it can gave him/her a free line for connecting. At this time (25/5/2001) it uses Go2Call service for its long distance. I use my own Language and Interpreter for this server.

FSG Telephony Server (VOIP) - Language and Interpreter

Posted by Farhad Malekpour in Programming on February 2nd, 2001 |  No Comments »

Feb, 2001
Parsian Networks

This language is designed be myself. Also an interpreter is designed. The main reason for this Object Oriented language is to controlling modems and does what ever I need to do with them generally in voice mode. With this language any one can design and developed many useful modem voice based applications like an Answering Machine. This is an Object Oriented language and its ready now for using by any one and of coerce first of all is me!

ICQ Bomb

Posted by Farhad Malekpour in Programming on November 15th, 2000 |  No Comments »

Nov, 2000
Parsian Networks

This tiny software can send a message to a couple of ICQ members. Generally this tool is useful for advertisement, but I think it’s not legal, so this program has never published and I wrote it only for testing.

Web based Accounting

Posted by Farhad Malekpour in Programming on November 2nd, 2000 |  No Comments »

Nov, 2000
Parsian Networks

This web based application can do all of our office needs in accounting for them. Has two part, first part is an http server that serve up to 1024 clients at a time and second part is an accounting software using Borland Database Engine.