#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    7
    Rep Power
    0

    Programatically parse incoming emails?


    I need to learn how to parse incoming emails that are sent a particular address on my system. Can anyone point me in the right direction? I would probably be using Perl. Would this be handled via Sendmail, procmail, etc? I don't know anything about mail "stuff" but my techie is out of town for a bit and I figure now is a good time to start learning.
  2. #2
  3. Full Access
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jun 2000
    Location
    London, UK
    Posts
    2,019
    Rep Power
    16
    Install qmail and put a pipe to a program in the relevant dot-qmail file. This pipe should point to a Perl program, which will receive a copy of the mail on standard input for parsing.

    If you don't understand much of that, then go install qmail, and come back for further, more detailed, instructions
    Alex
    (http://www.alex-greg.com)
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    7
    Rep Power
    0
    Thanks for the reply.

    From what I read, it is not recommended to run Sendmail and qmail - so basically you are suggesting that I replace Sendmail with qmail? That sounds like a larger project than I should try to tackle myself, but I can get help with that. It's a pretty busy live application server and I don't want to risk messing something up.

    I was under the impression that I could do what I want to do using procmail along with sendmail, which seems a lot simpler. I'm curious as to why you recommend qmail? Can I NOT do what I want to do using procmail??

    Thanks!
    Last edited by limitup; April 6th, 2004 at 01:09 AM.
  6. #4
  7. Full Access
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jun 2000
    Location
    London, UK
    Posts
    2,019
    Rep Power
    16
    Thanks for the reply.

    From what I read, it is not recommended to run Sendmail and qmail - so basically you are suggesting that I replace Sendmail with qmail?
    Yes. I did it yesterday on a fairly busy production server handling a lot of outgoing mail and a handful of incoming mail boxes, and it took a few hours with no downtime at all. It's relatively straightforward; I can give you more in-depth advice and assistance if you need.
    That sounds like a larger project than I should try to tackle myself, but I can get help with that. It's a pretty busy live application server and I don't want to risk messing something up.
    This is always a risk. Providing you test everything immediately after the qmail upgrade, you will be OK, since you can just turn it off and bring sendmail back up until the problem is fixed. The way I handled yesterday's migration was to run qmail on an alternate port (say, 26) while it was in test mode, and manually deliver an email via telnet to port 26, and check that it arrived in the right mail box. This won't mess up any existing incoming mail, as that all comes in on port 25.
    I was under the impression that I could do what I want to do using procmail along with sendmail, which seems a lot simpler. I'm curious as to why you recommend qmail? Can I NOT do what I want to do using procmail??
    You probably can, but it is probably more hassle (though it might not sound like it!) to just replace the entire thing with qmail, which has this feature built in.

    Sendmail and procmail are two complex pieces of software which have to be integrated together (Sendmail is also buggy and extremely complicated). qmail is one simple piece of software. You make the choice
    Alex
    (http://www.alex-greg.com)
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    1
    Rep Power
    0

    You can also use a third party solution


    Just wanted to let you know that there is a service called mailparser.io which does exactly what you are looking for.

IMN logo majestic logo threadwatch logo seochat tools logo