Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm doing some development work and need an app that will intercept any local SMTP attempts.

By intercept I mean that with zero configuration this application will receive mail on the local computer sent to any email address. So if I'm working on a PHP application and I use the mail() function I can send to any email address I want and this application will receive it like a typical mail client. foo@bar.com, baz@bar.com would all be received as mail by this application.

I know I've seen one but for the life of me I cannot remember what it was called.

share|improve this question
1  
What do you mean by "intercept"? Do you want to see the SMTP traffic, or do you want to redirect/block it? –  sleske Oct 15 '12 at 7:09
    
@sleske By intercept I mean that with zero configuration this application will receive mail on the local computer sent to any email address. So if I'm working on a PHP application and I use the mail() function I can send to any email address I want and this application will receive it like a typical mail client. foo@bar.com, baz@bar.com would all be received as mail by this application. –  Caley Woods Oct 15 '12 at 19:58
    
Thanks for the clarification. Please put clarifications into the question (you can edit it), rather than in a comment, so everyone will see it. Fo now, I have edited the question for you. –  sleske Oct 16 '12 at 7:44

2 Answers 2

WireShark will allow you to monitor all of the network traffic, and you can filter it by the required port to see only the SMTP traffic (emails).

share|improve this answer
    
The application I've seen is an email application that runs a local SMTP server and intercepts all emails sent from the computer while the application is active. It looks similar to outlook express. –  Caley Woods Oct 15 '12 at 19:59

In order for your application (any application, for that matter) to send mail, the application will need access to a mail server. That mail server can either be running locally, or on a different system (such as your ISP's mail server).

The PHP implementation, as far as I can tell, can either directly invoke a local mail transfer agent (MTA), such as sendmail, or contact a (local or remote) mail server via SMTP.

So the easiest option would probably be to install a local mail server (for how to do this, see e.g. Set up local SMTP and POP3 for testing mail send and receive loop ). Then configure the local mail server to never send out any mail, but just queue everything it gets. Finally, configure PHP to use this mail server.

The relevant PHP config settings for email sending are SMTP, sendmail_path etc..

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.