<<< Date Index >>>     <<< Thread Index >>>

Re: save 2 copies of outgoing mail



Crni Gorac wrote:
> On 2/21/06, Nicolas Rachinsky <mutt-users-0@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> > * Crni Gorac <cgorac@xxxxxxxxx> [2006-02-20 19:08 +0100]:
> > > I want second copy of each of my outgoing message to be copies to
> > > "ham" folder
> >
> > Make $sendmail do it for you. A little script should be ablte to do
> > this.
> 
> Any concrete suggestion if $sendmail == msmtp?


This is a crude approximation, but it should do.

It assumes that your current sendmail="msmtp", that you have a ~/mail/
directory, and that ~/mail/ham is a mbox file (or does not exist.)

.muttrc:

        sendmail=~/bin/my-sendmail

~/bin/my-sendmail:

        #!/bin/sh
        mbox=~/mail/ham
        echo "From `whoami`@`hostname -f` `date`" >> $mbox
        tee -a $mbox | msmtp $*
        ret=$?
        echo >> $mbox
        exit $ret

Remember to: chmod 755 ~/bin/my-sendmail


Toby

-- 
Signed/encrypted mail welcome.  GPG/PGP Key-Id: 0x15C5C2EA