Skip to content

Archive messages

Christian edited this page Jul 14, 2020 · 2 revisions

Starting with v0.1.0 it's possible to archive successfully sent messages.

This is a nice feature for debugging or to resent messages if required.

Enable message archive

mkdir ~/.msmtp-archive
chmod 0700 ~/.msmtp-archive
editor ~/.msmtpq.conf
# Sent mails archive directory.
# Relative to $HOME path!
ARCHIVE=.msmtp-archive

Resend a message

# Get message ID from logs or wherever and enqueue message again.
# Don't forget that original msmtp options are not available here!
msmtp-yaqi -t -i < ~/.msmtp-archive/MESSAGE-ID.eml

# Run queue as usual
msmtp-queue -r

Delete old messages

# Delete old messages in archive after 7 days...
find -P ~/.msmtp-archive -type f -name '*.eml' -mtime +7 -print -delete
Clone this wiki locally