On 2012-10-07 22:24, Marc Perkel wrote:
> The email is stored in maildir format.
Wich means each email is in a single plain text file suitable for
sending without any special translations.
> I need to take this format and translate it to send it on to the user.
What kind of translation do you mean? The only thing you need to
"translate" when sending a message from a Maildir is line endings and
periods at the beginning of lines. Usually SMTP/BSMTP senders take care
of that.
> So I'm thinking BSMTP into Exim?
Why BSMTP? Anything wrong with:
exim -i 'email@address' < maildirfile
?
> Wondering what is the best way to do that. Something that translated it
> into bsmtp format would be great.
I'm not sure what you mean here. BSMTP is not a mail format but a way to
batch SMTP commands. The actual mail is sent in the same format as in
SMTP, which is basically the same format as the mail stored in a Maildir.
> I'm sure thare must be something out
> there. I just haven't found it yet.
Completely untested script that is called as with fromaddress, toaddress
and mailfile as parameters an outputs BSMTP:
---8<---
#!/bin/sh
echo 'HELO host.example.net'
echo "MAIL FROM:<$1>"
echo "RCPT TO:<$2>"
echo DATA
sed -e 's/^\./../' < $3
exho .
---8<---
/Jonas
--
Jonas Eckerman
http://www.truls.org/