Thread

Posted on Fri Jun 29 17:45:04 2007 by certifieduser
mail scripts break if sent to unconfigured email address or domain name
my tech level - between novice and medium os - knoppix 5.0 script - perl module - mail-sender here is the issue the same script worked fine without no change while i wrote with knoppix 4.2 thru 4.4 in the past it just used to email all the email address the script worked fine if the email address was right example johndoe@abc.com script would only faily if the email address is wrong example johndoe.com but now after upgrading to knoppix 5.0 and installing cpan mail-sender using automatic method found on cpan web site i am experiencing some issues. it would be only email if - i think - it does a hand shake and find the mailbox on the remote destination host. the email script would stop working if it dont find the destination mail box - if the email address dont exist or the destination domain is not yet registered. so what happens is i have to baby sit in front of the screen to delete the bad email where it stops and restart the script - the script is not an issue so we try not to dig into it. is there any tweaks i need to do with send mail or any thing else to just push out the email irrespective of whether the desitnation mail box or domains exisits or not. here is exact error message when script stops Cannot send mail: Local user "username@domainname.com" unknown on host "localhost" regards.
Direct Responses: 5844 | Write a response
Posted on Tue Jul 31 11:44:40 2007 by jenda in response to 5572
Re: mail scripts break if sent to unconfigured email address or domain name

By default Mail::Sender stops trying to send the message as soon as the server reports any problem with any address, whether it's in To:, Cc: or BCc:, in this case your mail server started to report even problems it did not before. You either have to handle such errors, remove the invalid address and try to resend the message. Mail::Sender DOES give you enough info to do that within the script.

Or you can use the skip_bad_recipients option and then review $sender->{'skipped_recipients'} to get a list of addresses that failed. With that option set to true, Mail::Sender only fails the message and reports an error if ALL recipient addresses fail.

HTH, Jenda

Write a response