I'm using "sendmail" command in perl to send email
If I send email using perl script and if I check /var/mail/root
I can see a recent copy of mail that I sent using script
Is ther any way so that I dont want copy of mail to appear in /var/mail/root ?

One more question
How to check buffer size while sending email using perl script?

Recommended Answers

All 4 Replies

You probably need to change your sendmail configuration (or whichever mail program you really use) to not automatically send a copy to root. But if this is not your machine, it may be that the administrator has purposely set this up this way, and you then will not be able to change it. I, mysel, am not exactly sure what needs to change in your mail program, but it is there that it needs to change, it has nothing to do with perl. Get/Borrow a book or Google for it.

As far as your second question, which buffer?

When I send email, say more than 300 emails ( Separate copy of emails) /var/mail/ size keep on increasing and after all mail sent it gradually size in /var/mail decreases . Problem arises when I send 800 + emails
so I want to know is there any sleep function available in perl so that till size drcreases I can stop sending email and start again later

Thank for your reply
Vinay

This is your /var/mail/mqueue directory. But 800 mails should not be a problem. How large is your /var partition? You may wish to create a /var/mail partition to add space, and protect the rest of your /var partition if the mails do make it overflow.

Are you just sending emails to yourself?

If you are sending emails, they will queue until they are sent. When you recieve emails, they spool in /var/spool/mail or any other location that sendmail or your MTA is configured to spool to.

If you are seeing space issues, you just simply need to add more drive space for /var or configure them onto another partition.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.