Find the answer to your Linux question:
Results 1 to 3 of 3
Is there a utility that I can use to forward emails to a database? I want to gather emails sent to my server, and then stick them in a DB: ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2005
    Location
    South West England
    Posts
    91

    Email to (MySQL) Database?


    Is there a utility that I can use to forward emails to a database?
    I want to gather emails sent to my server, and then stick them in a DB:

    Example email:
    From: John Smith <jsmith@example.com>
    To: Rob Dean <robd@mydomain.com>
    Subject: Example
    This is a test.

    would write a DB entry in "email" table:
    from: jsmith@example.com
    rcpt: robd
    subject: Example
    body: This is a test.

    I have an MTA (Postfix). Is this all I need to gather incoming emails?

    Cheers
    Dan

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,392
    One could imagine to write a perl/python/C/<whatever> program, that acts as a smtp server and writes to a SQL DB.
    This would be a big project.

    Question is: Why would you want to have emails in a SQL DB at all?
    There are DBs, that are specialized in dealing with emails:
    POP3 servers, or better: IMAP servers.

    These are already available, stable and documented.
    For example here:
    Postfix Virtual Hosting With LDAP Backend And With Dovecot As IMAP/POP3 Server On Ubuntu Intrepid Ibex Server 8.10 | HowtoForge - Linux Howtos and Tutorials

  3. #3
    Just Joined!
    Join Date
    Aug 2005
    Location
    South West England
    Posts
    91
    I don't want to do that, I have set up my system to locally email people inside using SQL. Can't I link it to the outside?

    I can send messages out (using mail() ), but not in (which is what I would like to achieve here).

    Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •