I need a script which will forward e-mails using a mysql database

Posted on 2004-10-16
Last Modified: 2011-09-20
I need a script (preferably PHP or Perl) which can check a POP3 box, get the e-mails and forward them depending on the TO to a address stored in a MySQL database which matches the TO.

If that doesnt exist then a way to do it using a mail server (dont care which one) will do.
Question by:nickstallman
  • 3
  • 2

Expert Comment

ID: 12331453
Can you explain the purpose of the whole excersise. Maybe there are easier ways to achieve your end result than all these.


Author Comment

ID: 12331468
Ok. Basically I have a list of usernames and e-mail addresses in a MySQL database and I have a wildcard forward to a pop3 address.

I need a script which can forward username@mydomain the e-mail address associated with the username.

Expert Comment

ID: 12331497
Ok.. Nick... I am assuming that you are using a thirdparty webspace provider's service. In that case you wouldnt be able to install any Mail management software on the server. The other option is to have a program that does this task. Try out this link... You might find some useful info there in.

Or you can take 2 php scripts - 1 that picks  out email ids and contents from the inbox and another that sends  mails from MYSQL DB and then combine them. This miight be a bit time consuming. Besides, in these choices the biggest problem we will have is that someone will have to manually trigger the page/program for it to work. So basically somebody will have to run the process at the end of the day so that all the mails are routed to their respective mail boxes.
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.


Author Comment

ID: 12331555
Thanks for that one. It'll be useful if I need to make the script myself.

I have a Windows dedi in my house so I can have a mail server running.

Running the program every few miniutes isnt a problem. A Cron job or a scheduled task will do it easily.

Author Comment

ID: 12331621
I have found my solution:

Its not a script like I wanted but it'll do the job.

Accepted Solution

modulo earned 0 total points
ID: 12577703
PAQed with points refunded (500)

Community Support Moderator

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Preface In the first article: A Better Website Login System ( I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to count occurrences of each item in an array.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now