Need to Take Sent Mail Backup in Linux Sever

Everyday my code will send 100's* of mails from linux server to outlook using*sendmail command .
I need to take a backup of those mails which are exactly sent from my linux server.
This is needed for backup purpose.
backuplocation is my local home dir.Is it possible to do this.
I dont have root access to view the mail logs .
So please give some solution to resolve this issue.

One way would be to add a bcc (blind carbon copy) to yourself on each message your application sends. This way you get a copy of the sent message immediately.

I have used bcc command along with my mail -s command and mail was successfully sent.
after that i have checked in these location /var/spool/mail and var/log/ for finding my bcc copy mail.but i didn't found any mail.
I dont have root access to view the mail logs .
So please give some solution to resolve this issue.

Where did you bcc it to? Might something else have downloaded it first?

If you don't have root access, you're not really going to be able to reconfigure anything.

So you wrote a number of shell scripts that send emails? Have you thought about writing a wrapper script for sending emails and have that script archive each email in a directory on disk?

You can then change all of your scripts to use your new wrapper script. The best part is that when the requirements change again you will then only need to change one script. :slight_smile: