Redirecting all mail from Sendmail on PHP

Making websites, eh? Trying to write something for use on your testing server without bombarding your database victims with development spam? You need.. slurp mail! (ahem)

Here’s how to write your own sendmail client that’ll redirect all emails to the address of your choice. Create /usr/sbin/slurpmail and stick this in it!

formail -R cc X-original-cc \
-R to X-original-to \
-R bcc X-original-bcc \
-f -A"To: whoeveryouare@gmail.com" \
| /usr/sbin/sendmail -t -i

Chmod it to make it -rwxr-xr-x. Then in php.ini find the sendmail path line that reads /usr/sbin/sendmail -t -i and change it to slurpmail!

Rock and/or Roll! We are now getting all the mails that would have went to god knows who! yay! Mind and restart Apache now first!

Advertisements

2 thoughts on “Redirecting all mail from Sendmail on PHP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s