Need help with Undeliverable Emails

  • Thread starter great places to stay.
  • Start date
G

great places to stay.

Hi,

I do hope there is a person out there that can help.

My problem is when my perl script sends out an email using perls /sendmail
to one of my users, that have added their email address to one of my forms
the email is bounced back if it is undeliverable.

The problem I have is my ISP can't work out how to get those bounced emails
to be sent back to my email address so I am aware that an email sent by
/sendmail in perl has not been delivered.

Any help would be greatly appreciated.

Cheers
Paul
 
D

David Efflandt

Hi,

I do hope there is a person out there that can help.

My problem is when my perl script sends out an email using perls /sendmail
to one of my users, that have added their email address to one of my forms
the email is bounced back if it is undeliverable.

The problem I have is my ISP can't work out how to get those bounced emails
to be sent back to my email address so I am aware that an email sent by
/sendmail in perl has not been delivered.

It is not clear from your post if using Mail::Sendmail and whether it is
configured to use a functioning relay? And/or are you using local
sendmail (can it successfully send/receive mail)? Regardless, does your
script use a valid From: address that can successfully receive mail?
 
J

James Willmore

Hi,

I do hope there is a person out there that can help.

My problem is when my perl script sends out an email using perls /sendmail
to one of my users, that have added their email address to one of my forms
the email is bounced back if it is undeliverable.

The problem I have is my ISP can't work out how to get those bounced emails
to be sent back to my email address so I am aware that an email sent by
/sendmail in perl has not been delivered.

Any help would be greatly appreciated.

Code ... that would be appriciated :)

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
A door is what a dog is perpetually on the wrong side of. --
Ogden Nash
 
G

Gunnar Hjalmarsson

great said:
My problem is when my perl script sends out an email using perls
/sendmail

Perl's sendmail? It sounds to me as if you are using a sendmail mail
transfer agent provided by your hosting provider. Even if the program
you are using is written in Perl, and you open a pipe to the sendmail
MTA from it, sendmail is not a Perl feature.
to one of my users, that have added their email address to one of
my forms the email is bounced back if it is undeliverable.

The problem I have is my ISP can't work out how to get those
bounced emails to be sent back to my email address so I am aware
that an email sent by /sendmail in perl has not been delivered.

I have experienced the same problem, and the solution in my case is to
use a Perl module that does not make use of sendmail. The CPAN module
Mail::Sender lets you conveniently control the return-path from your
Perl program. (I don't know about other mail sending modules.)
 
P

Paul B

Thats to all those who helped.

I have found the answer.

$mailprog = /usr/sbin/sendmail;

open $mailprog -t -t $recipient;
 
J

James Willmore

Thats to all those who helped.

I have found the answer.

$mailprog = /usr/sbin/sendmail;

open $mailprog -t -t $recipient;

You've also found something that could be unsafe :)

You should, IMHO, stick with a pure Perl solution - such as Net::SMTP.

Good luck!

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
"Love is a snowmobile racing across the tundra and then suddenly
it flips over, pinning you underneath. At night, the ice weasels
come." -- Matt Groening
 
W

whoknows

You've also found something that could be unsafe :)
You should, IMHO, stick with a pure Perl solution - such as Net::SMTP.

- It can be unsafe to run sendmail as daemon, not to use it as a client
to send mail out.
- Postfix has a binary named sendmail too and Postfix _is_ secure.
- Does Net::SMTP will queue your messages in case of mail server outage?
- Will it try multiple servers?

Basicaly if you don't mind (potentialy) loosing mail Net::SMTP is fine,
otherwise sendmail is the way to go.
 
J

James Willmore

- It can be unsafe to run sendmail as daemon, not to use it as a client
to send mail out.

The code used to do so *is* a potential security risk. There are many
references as to why. Start here in clpm, then move onto Google :)
- Postfix has a binary named sendmail too and Postfix _is_ secure.

I use Postfix as well for the same reason, but *never* use the client
without good reason. Maybe that's just me, but I prefer to know *exactly*
what's being sent out and to where. Again, the code referenced by the OP
does not insure that (no mention of taint checking or validation of the
variable used for the message - very dangerous). Just because the
*binary* is "secure" doesn't mean the human interface can't make it
"un-secure".
- Does Net::SMTP will queue your messages in case of mail server outage?

There is a 'SkipBad' setting, which will still send email to valid
addresses even if other addresses are seen as bad by the server. There is
also the 'Debug' setting which will allow you to see the conversation
between the script and the server - so you can see *why* the address is
seen as bad. And queuing a message ... that's the responsibility of the
server - the client should only be concerned with sending the email.
Either it's sent or not :)

On the chance your email(s) are not sent, the script should let you know
is some efficient fashion (like maintaining a log and ... checking the log
to see if all went well :) ). And, if it's a critical activity to send
out emails, you should be writing the emails out to file in case they get
lost in transit. Queuing the messages will do not good if they get lost
in the queue because of some fatal error to your system - or due to some
error on the part of the "human interface" (aka user error) :)
- Will it try multiple servers?

And why would you want to :) If you have that many issues with the
server, the problem isn't the script, it's the server you're sending to
:) Sending to multiple servers seems more like sending spam than legit
email. There should not be any reason to send to multiple SMTP servers.
Do you do this with your favorite email client? The same messages? If
so, again, the problem lies with your ISP, not your client :)
Basicaly if you don't mind (potentialy) loosing mail Net::SMTP is fine,
otherwise sendmail is the way to go.

There's nothing wrong with the Net::SMTP module. All your statements are
really based upon FUD. I guess you could argue the same way. I doubt it,
but I guess you could :)

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
Grandpa Charnock's Law: You never really learn to swear until
you learn to drive.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top