Skip to main content

Resending Default Address Mailbox Email

Comments

3 comments

  • vanessa
    Once the email is delivered to the inbox, you can't re-queue it. You would need to either 1) copy the mail files to the remote mail server, if stores email in a maildir format, or 2) manually re-forward the email
    0
  • RequieM
    Hey Vanessa, Thanks for the response. I did a little digging whilst I was waiting and found an Exim re-queue Perl script here: https://github.com/Exim/exim/wiki/Redeliver. I combined this with a little shell script rather than modifying the Perl script to iterate through all files in the cur/ mail folder: #!/bin/bash FILES=/home/acccoutname/mail/cur/* for f in $FILES do echo "Processing $f email..." perl redeliver.pl "$f" done
    And the corresponding redeliver.pl Perl script: my $file = shift || die "need file\n"; my $gto = shift; # global to. if present, override other per-email decision my $msg = ''; my $to = ''; my $from = ''; open(I, "<$file") || die "Can't open $file\n"; while () { if (/^From /) { if ($msg) { if ($to && $from) { do_mail($from, $to, $msg); } else { print STDERR "have a message but no recips\n"; } } else { print STDERR "saw From w/ no message\n"; } $msg = ''; $from = ''; $to = ''; } elsif (/^Return-path:\s*<(.*)>$/) { $from = $1; } elsif (/^Envelope-to:\s*(\S+)\s*$/) { $to = $1; } elsif (/^Delivery-date:\s*/) { ; # just ignore } else { $msg .= $_; } } close(I); if ($msg && $to && $from) { do_mail($from, $to, $msg); } sub do_mail { my $f = shift; my $t = shift; my $m = shift; $t = $gto if ($gto); print "$f -> $t\n"; #print "MAIL FROM:<$f>\nRCPT TO:<$t>\nDATA\n$m\n.\n"; open(P, "|/usr/lib/sendmail -f $f $t") || warn "can't open sendmail: $!\n"; print P $m, "\n.\n"; close(P); }
    Both of these files are in the zip file attached. Nothing fancy but I hope this is of some use to anyone with the same problem .
    0
  • cPanelMichael
    Hello :) I am happy to see you were able to find a solution. Thank you for updating us with the outcome.
    0

Please sign in to leave a comment.