vit has asked for the wisdom of the Perl Monks concerning the following question:

I want to send No Reply messages from the server in my perl/CGI application.
This should work in such a way that the FROM address is something NoReply@... so that it cannot be spammed.

Is it possible to do it with Net::SMTP? ... or any other module.

Replies are listed 'Best First'.
Re: No Reply message
by kennethk (Abbot) on Mar 20, 2009 at 20:58 UTC

    You can send an e-mail with any address you so desire using Net::SMTP or any other e-mail module worth its salt. This is a configuration issue for your mail server.

    Side comment 1: You should keep in mind that any auto-mailing CGI script is potentially abusable by immoral people for spamming other people. Obscurity is not a solution here - a colleague of mine caused the security folks around here to get into a tizzy because he naively set up such a site and it got abused by spammers.

    Side comment 2: You have created four new threads in the last 28 hours asking how to send e-mails from your CGI script (No Reply message, MIME::Lite returns "SMTP Failed to connect to mail server: Bad file descriptor", Questions about sending e-mails, Sending emails in perl/cgi environment). Do you truly believe that each of these questions has been sufficiently distinct that they warrant separate discussion, particularly when creating a new thread creates an unnecessary break in thought for the monks trying to help you?

      /*
      Side comment 1: You should keep in mind that any auto-mailing CGI script is potentially abusable by immoral people for spamming other people. Obscurity is not a solution here - a colleague of mine caused the security folks around here to get into a tizzy because he naively set up such a site and it got abused by spammers.
      */
      If I use "from = NoReply@...." which is non-existing address, will it protect from spammers?

      /*
      You have created four new threads in the last 28 hours asking how to .... Do you truly believe that each of these questions has been sufficiently distinct that they warrant separate discussion
      */
      Yes, because if I new how to program it I would not ask. The forum helped me a lot and within these 28 hours I learned a lot from both forum and other sources. I guess this is what forums are for.

        The address that you send from does not impact the abuse concern I raised. Let's say the purpose of this page is to e-mail copies of a jpeg to people who want it. As an end-user, I would go to your page, enter my e-mail address, hit submit, and moments later the jpeg is in my inbox. Sounds great. Now what happens when Joe Hacker writes a bot (trivial) which inserts 1_000_000 different people's addresses into that field? You've just allowed your server to be the source of spam.

        I have no problem with asking questions. Please do. I'm clearly still answering them. But it's generally considered good form once you've established a dialogue on one issue to keep that within one thread. So, for example you might have asked MIME::Lite returns "SMTP Failed to connect to mail server: Bad file descriptor" in response to weismat's comment on Questions about sending e-mails. It means fewer people need to get up to speed, and it maintains a clear line of thought. In general, monks will check threads they've been involved with for at least 24 hours and generally longer, and many including myself have notification set up so I know when people respond to my nodes. It also keeps monks from repeating each other - for example, in writing this up, I found out that pileofrogs gave you the same security warnings in Re: Questions about sending e-mails. A little reading which may be of interest for you on this topic may be Re: php to perl and Re: Iterative Subroutine Approach Question. And if you think that your question is sufficiently off the original topic, you should include a reference to your previous thread like 5miller did in 752162.