Created
June 30, 2011 09:16
-
-
Save vidmantas/1055910 to your computer and use it in GitHub Desktop.
Reset frozen exim messages with ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# deliver with this or fetch results with `exiqgrep -zi` and deliver with `exim -M <message-id>` | |
require 'mail' | |
Dir.chdir("/var/spool/exim4/input") | |
frozen_email_ids = `exiqgrep -zi`.split | |
frozen_email_ids.each do |eid| | |
# fetch the body | |
email_string = "Date:" << File.read("#{eid}-D").split("Date:").last | |
email = Mail.parse_from_string(email_string) | |
email.deliver | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment