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

I built a Perl script for a survey form to email information. The script sits on a Solaris 7 server and I need to put in an anonymous email "From" address if the user doesnt enter an address. Currently I have a name called mysevername@myhostname.com in as the anonymous email name. I need to find out what the server email default name is and then put that in my script as the anonymous email name?

Here is the part that I need to add the name into:
$defaultemailname = 'myservername@myhostname.com' #Should I just use +any generic name or how can I find out the server default email addre +ss??

Replies are listed 'Best First'.
Re: Sending anonymous email address
by liz (Monsignor) on Oct 03, 2003 at 13:11 UTC
    I guess the questions are:

    • what is the email address that you want the email to return to when it cannot be delivered?
    • what is the email address that you want the email to be sent to if somebody replies?

    Once you decide on these issues, you can fill in email-names in the From: and possibly in Reply-To: headers (if reply email should go somewhere else then bounced email).

    Liz

      I basically just want it to show the server default email address so if someone accidently hits reply back to an anonymous email message it will go back to the server or not send an error message. I assumed the server would have some sort of default email address?
        Whether the server has a "default email address" depends entirely on its configuration.

        E.g. if the server does not have an SMTP server running, the server will not accept any mail being sent to it, period.

        If you want to do the "good" thing (in my opinion), you need to configure an email address (not necessarily on that server) to which bounced and/or replied email will be returned. And particularly, have a real person monitor the "replied" mails (possibly with a filter to filter out bounces to Reply-To). As responsible people, you (or your employer / client) should know if someone e.g. does not wish to receive any more emails from your service and act on it.

        Liz

        Hi AM,
        OK, sorry I was a bit tetchy there (trying to quit the evil weed). If you're using apache as your web server, look up its httpd.conf file and look for the ServerAdmin directive. You'll see something similar to:
        # ServerAdmin: Your address, where problems with the server should be # e-mailed. ServerAdmin foo@bar.com
        HTH

        update: Though of course liz's response above is far more sane... :)

Re: Sending anonymous email address
by barrd (Canon) on Oct 03, 2003 at 13:07 UTC
    ... I need to find out what the server email default name is ...
    Errr, what's a server email default name? Or put another way what do you think a server email default name should be?

    Until you add some more detail I don't think anyone here is going to able to help you.