Can AppleScript/Mail recover from non-existent email address?

I have an AppleScript which automatically sends HTML emails after a delay of a few days from receipt of an incoming email produced by a web form. It works well except for one issue:
The address it sends to are picked up from the web form so I have been testing failure modes for various badly formed email addresses. Most fail gracefully with NDNs except if the domain does not exist. In this case Mail opens a dialog window with "Cannot send message using server etc". This is not good for an unattended Mac automatically processing thousands of emails a day. Mail appears not to inform AppleScript of this glitch.
Any thoughts about a solution would be appreciated.
I only have Tiger and Leopard but this script will eventually run on a recent Mac.

This is a style thing, but I try to write my code so it is easy to debug.
if (do shell script "x='" & w & "';
z=${x##*@};
t=`dig +short ${z%>*} MX`;
echo ${#t}") > 0 then display dialog "send"
It is hard to debug what is being passed to Unix.
I'd write this something like
[[ I have not tested this ! ]]
[ I have not taken in Hiroto's comments ]:
-- I write the code so as to debug it.  I would not assume the statement above would work the first time.
-- I let the log statements in the final code.  They do not do anything outside of the script editor.
set toUnix to  "x='" & w & "';
z=${x##*@};
t=`dig +short ${z%>*} MX`;
echo ${#t}"
log "toUnix = " & toUnix
set result to do shell toUnix
log "result = " & result
-- I do not understand this statement. Shoudn't we be testing for the length of result? Or not equal to null?
if result > 0 then
  display dialog "send"

Similar Messages

  • Can I retrieve messages from a blackberry email address in Mail for OS X?

    I'm wondering if I can configure Mac OS X Mail to retrieve messages from a blackberry email address.
    Thanks.

    lte me know if my question doesn't make sense.

  • How to reactive my iphone 5s iCloud account however it's signed on to a non existent email address which i can't log on to verify password.

    I need help. My brother added a non exsistent email to his Iphone 5s. I want to delete that icloud email but I can't because it has to be verfied. Can someone help me?

    If you want to use another Apple I.D, you can go to SETTINGS - STORE. Click on the Apple I.D; select Sign out and Sign in with a valid Apple I.D.
    If you want to change the password of an existing Apple I.D. you need to sign in to the account first which apparently you can't as the "password" is incorrect. Here is what you can do to change the password.
    Go to https://appleid.apple.com
    Login with the Apple I.D. and you will see these 2 option.
    Select your authentication method.
    Email authentication: To access your information, we will send an email to the address(es) on file for you.
    Answer security questions: To access your information, you will answer the security question(s) provided when you originally created your Apple ID.
    Proceed with the one that's easy for you.

  • Passwords for non-existent email addresses?

    Just changed computers and now can't transfer some apps that were bought on a different Apple ID and can't remember the password. Can't get the password resent as they want to send it to an email address that no longer exists? How can I get the password? How can I get those apps onto my computer?

    It all depends on your setup.
    If you use only local mail domains, just make sure you do not have a catchall address (luser_relay) and messages to unknown users will not be accepted by Postfix in the first place.
    If you use virtual mail domain, you will need to change your setup as Apple's default setup will always accept mail for unknown users and then bounce it back to sender. See here for a how to: Making Virtual Mail Users in OS X 10.4/10.5 Server
    HTH,
    Alex

  • Auto forward emails sent to non-exist emails address to specific email

    Hi!
    i have exchange 2010 i need to make an auto forward or redirect when email sent to my organization with a wrong email address
    for example
    [email protected] send an email to [email protected] and user X doesn't exist on my domain , i need this message to be redirect automatic to alternate email [email protected]
    thanks
    Mohamed Azoz

    Hi
    Maybe you can look at the edge server for doing this if you have one:
    http://www.norman.com/uk/business/support/support_articles/not_valid_email_addresses_validated_by_edge_transport_role_in_exchange_2007_2010
    Hope this helps. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • HT202667 I am ditching my non-Apple email address and want to stop using it. My husband's ID is his icloud email, why can't mine be?

    I don't want to run two email addresses and want to use my icloud email address for all correspondence. Itunes keeps sending me emails to my old address and it won't let me change my Apple ID to my icloud address. My husband's is using his without any issues. Is there a way round this?

    I'm afraid not. While people who started with iTools or MobileMe had their @mac.com/@me.com (and now @icloud.com) address as the ID from the start, and people who open a new Apple ID and iCloud account at the same time from the iCloud preference pane can choose to make the @icloud.com address the ID, if it's the case that your ID is a non-Apple email address you can change it to another non-Apple email address but you cannot change it to your @icloud.com address.
    You can of course set up forwarding from the ID address to the @icloud.com address so that you only have to look in one place. However you should be aware that if the setup means that you can only be contacted by Apple at the @icloud.com address, then if you have a problem such as a forgotten password or a corrupted account, Apple can only contact you at an address you cannot access so it's essential to have a 'rescue address'.

  • Sending from a different email address

    I need to be able to send from a different email address (not @me.com) from icloud.com mail but it wont allow me.  I teach at a university and need to be able to email from my school address and using the old mobileme interface I was able to do this.  Now I cannot email out from my school email address through icloud. Is there a way around this?  The school only allows you to email your class mail list from you school email address and now I cannot email my class from icloud.   Please help.  Unforunately, I have to use PC's at school so I am only working from the icloud.com mail.

    Welcome to the Apple Community.
    There shouldn't be any reason you can't use additional email accounts alongside your iCloud account, I do.
    Do you still have your alternate account set up on the iPhone, settings > Mail, Contacts, Calendars > Accounts.

  • Can i restrict apple mail client from downloading all emails...and allow it to pick a start date for gmail mail to sync? i am flooded with old emails, thousands on them ...eating hard drive space of my macbook pro and un necessary overhead

    can i restrict apple mail client from downloading all emails...and allow it to pick a start date for gmail mail to sync? i am flooded with old emails, thousands on them ...eating hard drive space of my macbook pro and un necessary overhead

    The genius bar technicians can check your MBP for possible hardware problems and specific software issues that you may have.  The diagnosis will be free.  Any extensive repairs will not be free.
    If you have minor software problems, you essentially will have to deal with them yourself.  Examine these two comprehensive documents for possible problem definition and solutions.  If you encounter problems that you are unable to cope with, start a new discussion and there will be persons willing to assist you in solving them.
    https://discussions.apple.com/docs/DOC-3521
    https://discussions.apple.com/docs/DOC-3353
    Ciao.

  • TS3276 How can I block mail from a specific email address?

    How can I block mail from a specific email address?

    Create a Rule
    Mail menu
    You can choose the Delete option from the drop down list or you can move the message to a specific folder.

  • Since icloud, my emails in my inbox have drastically reduced and important old ones i had left in my inbox have vanished! Can these be recovered from somewhere?

    since icloud, my emails in my inbox have drastically reduced and important old ones i had left in my inbox have vanished! Can these be recovered from somewhere?
    Can anyone help?

    Is this an iCloud email address, or some other?

  • How to create a Group from an existing email -

    I just want to create a Group from an existing email received.  Don't want to add people individually to Address Book, then drag them to the Group.  Would prefer to copy/paste the addresses into the Group.  I'm part of a team at work wth 25 people!  Do I really have to add their addresses individually?  Seems ridiculous.  Don't even need their names - just the emails, so when I type in "United," for example, I get all the folks in that Group which is named "United."
    Thanks.

    There was a "magical" set of Applescripts that would have done that, but it no longer works.
    There is no way in the OS to do that besides making the Applescript yourself using the current Script Editor.
    Another way to do what you want is to select all of the addresses (select one, then cmd-A). Then, drag the selection to somewhere in the Finder. That will create a text clipping. You can then drag that text clipping into the address field in Mail.
    The text clipping will be named with the first few email addresses. You can rename it in the Finder.
    Each one can be your own "distribution" list.

  • Inbox downloading non-existent emails endlessly

    A few days ago the red "unread mail" counter began rising and rising without downloading any messages. The loading spiral next to the "Inbox" indicates that it thinks it's downloading, and it does not stop. The number began at 300 (I keep a lot of unread mail in my inbox), but is now at approximately 800 and only stops when I close the program. This mail is not showing up in my inbox, and I am not a popular enough person to make so many messages an actual possibility.
    Along with the endless non-existent emails, the actual email that I should be getting is not showing up.
    I have tried Rebuilding my mailbox a couple of times and have deleted the "MessageUidsAlreadyDownloaded2," but these have not worked.
    Any suggestions are greatly appreciated.

    Hi Cathy, and a warm welcome to the forums!
    Not certain, but this can fix myriad Mail problems...
    Safe Boot from the HD, (holding Shift key down at bootup), it will try to repair your Disk Directory while the spinning radian is happening, so let it go, run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, then move these folder & file to the Desktop.
    Move this Folder to the Desktop...
    /Users/YourUserName/Library/Caches/Mail/
    Move this file to the Desktop...
    /Users/YourUserName/Library/Mail/Envelope Index
    Reboot.
    If that doesn't do it and you can afford to redo all your Rules, try these & reboot...
    /Users/YourUserName/Library/Mail/MessageRules.plist
    /Users/YourUserName/Library/Mail/MessageRules.plist.backup

  • I can't send with non-icloud email address

    I'm on OS X 10.9.1, and can't send emails using a non-icloud/mac email address, in Mail. I can recieve emails addressed to my non-mac email address.
    I've had this problem for several years, and there didn't seem to be a solution to start with. I was hoping the issue might have been fixed by now, but I still haven't been able to find a way to configure Mail so that it will work.
    This is very annoying, because the non-mac email address matches my website and my email signature, so it is irritating that I don't look professional when sending or replying to emails for my business. It also makes automatically organising emails into mail boxes (work and personal) impossible.
    In preferences > accounts > account info, I have both addresses separated by a comma. I can't see anywhere else I can put it.
    I'd be very grateful for any wisdom on this!

    If you migrated from MobileMe, try deleting the e-mail account in your mail preferences and adding it back again. You will only be required to enter your password and the ID, the setup should add the correct settings and hopefully this will resolve your problem.

  • Hi there I lost my password for my original iTunes account I can't recover it because the email address it is registered under is not longer valid How can I access my old account?

    Hi there.
    I did a factory restore and then restored it with iCloud back-up. I have been using lots of Apple products and i have used three different email adresses. Almost all apps restored perfectly but everytime i try to play a song in the Music app, i asks me for a Apple-ID i had no idea i have used.
    Hence:
    I lost my password for my original iTunes account
    I can't recover it because the email address it is registered under is not longer valid
    How can I access my old account?
    Can't find a place to change the email address to my new one without the password which I no longer remember.
    There is no way to just erase Apple-ID's on my device either.
    What to do? Should i ju give up and start from scratch and delete 2 years of stuf?
    Cheers!

    If you can remember the answers to the security questions when you set up that account - I think that you can reset the password without needing email authentication. You can try it here. Read it and see if it's possible. But if you can't remember the answers to the questions it will not work.
    http://support.apple.com/kb/ht1911

  • How can i set authrization to delete/change email address from broadcasting

    How can i set authorization to delete/change email address from information broadcasting. I would like to set an authorization because other bi users also have an authority to change my auto mail settings. How can i restrict this?

    Auth object for Broadcasting in 7.0 server
    RSRD_ADMIN - Broadcasting (7.x) Administration
    Check the authorizations for Broadcasting in the below SAP notes.
    Authorization check for broadcasting settings
    SAP Note Number: 1053944
    Please go through this thread for additional info.
    Authorizations for Broadcasting

Maybe you are looking for

  • Item property : Update allowed: No

    I have created a tabular form. Due to the fact that it is not possible to record the primary key manually, i have create a fake primary key on field 'ID'. The field 'StatusID' has now a unique constraint in the database. Also the foreign keys refer t

  • System.Data.SqlClient.SqlClientPermission Fail SSRS

    Hi, I created a custom dll to be used in reporting services. In this custom dll I have a method that will querying a database and return values that I will use as parameters for my report, something like, My report is expecting a division as paramete

  • How to create VLAN on Cisco PIX 6.3?

    Hi, how to create vlan on pix-6.3? i am bit confused. how do i assign a single internet face with multiple ip address(not secondary IP address) for each & every vlan? how to i connect to the switch, i mean if i put "switch port mode trunk" on the swi

  • MXi-3 card is not detecting

    hello, when i run mxi-3 optimization code, dialog box indicate that mxi ink is not proper. But, in PXI-MXI3 controller and pci-MXi controller, link led is glowing continousuly.total 3 led's are glowing continously named them as, power,link,Tx.plz pro

  • After Effects Minimized Render Crash?

    I am experiencing a very annoying issue pertaining to After Effects CS 5.5. I recently purchased the product (Production Premium CS5) and installed it on PC only to encounter a strange error. Whenever I do a preview render (pressing 0) and then minim