Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Technical

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 2nd December 2012, 08:42
manarak manarak is offline
Senior Member
Join Date: Apr 2009
Posts: 263
Thanks: 32
Thanked 6 Times in 5 Posts
Default Postfix: handling undelivered/bouced emails with a script

I'm running ISPConfig3 on my server, and I'm looking into the possibility of automatically processing undelivered emails with a script, if possible PHP.

So I've been looking through the /var/vmail/ directories and the incoming mail is easy enough to detect, allright.

So I would like to run a PHP cron that looks through the mailbox and does "something".
Ideally, I would like to remove the bounced messages from the mailbox.

But I could not find any description of the mail server's (is it postfix?) behavior, and if removing a message was as simple as just deleting it from the /new directory?

Is there a description of postfix somewhere?
Reply With Quote
Sponsored Links
Old 14th December 2012, 20:19
Mark_NL Mark_NL is offline
Senior Member
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts

If you use Maildir structure you can simply delete a file and the mail is gone.

grep -HRe '(MAILER-DAEMON|550)' /var/vmail
should get you started with emails that couldn't be delivered.
Real men don't backup... Real men cry!

Reply With Quote
The Following User Says Thank You to Mark_NL For This Useful Post:
manarak (14th December 2012)
Old 14th December 2012, 20:52
manarak manarak is offline
Senior Member
Join Date: Apr 2009
Posts: 263
Thanks: 32
Thanked 6 Times in 5 Posts

thanks! just the info I was after
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mail recipient linux_red Installation/Configuration 6 9th March 2012 15:24
ERROR: Connection dropped by IMAP server. [Centos 5.4, courier imap,squirrel, etc] darevil HOWTO-Related Questions 7 9th June 2010 15:49
RoundCube Sends but will not receive. happz Installation/Configuration 33 17th April 2010 22:55
Sending emails with custom FROM email address merisor Installation/Configuration 4 8th February 2010 17:27
Mail System Error - Returned Mail tristanlee85 General 16 16th March 2008 10:40

All times are GMT +2. The time now is 06:32.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.