Slashdot Mirror


Deleting SMTP Servers from Mail.app in Mac OS X?

jesse12345 asks: "Here's probably an easy one for you Unix masters. I travel a fair amount and use Mail in OS X. I'm always using lots of outgoing mail servers. What I can't figure out is how to delete outdated ones. There seems to be no GUI for this within the Mail.app. Is there some way to do this in UNIX?"

7 of 69 comments (clear)

  1. Easy to do in Panther by theWrkncacnter · · Score: 5, Informative

    Its VERY easily done within the GUI of Mail.app in Panther. In the accounts section of preferences there's a "Outgoing mail server" drop down menu that has "Edit Server List" as one of the options that allows you to remove an SMTP server. I'm not sure if this is the same in Jag but I'd imagine so. Hardly seems like a story to me.

    --
    -1 (Troll) is antihammer
    1. Re:Easy to do in Panther by __aafkqj3628 · · Score: 4, Informative

      In that case, here is some "Apple Sample Code" -

      Manage SMTP Servers.scpt

      (*
      Manage SMTP Servers

      Copyright (C) 2002 Apple Computer, Inc.

      You may incorporate this Apple sample code into your program(s) without
      restriction. This Apple sample code has been provided "AS IS" and the
      responsibility for its operation is yours. You are not permitted to
      redistribute this Apple sample code as "Apple sample code" after having
      made changes. If you're going to redistribute the code, we require
      that you make it clear that the code was descended from Apple sample
      code, but that you've made changes.
      *)

      (*
      This script goes through each smtp server, checks to see whether they are
      being used by an account, then presents a list of 'orphaned' smtp servers,
      which you can choose to delete if you wish.
      *)

      tell application "Mail" to set everySMTPServer to every smtp server
      set nameOfEverySMTPServer to {}
      repeat with eachSMTPServer in everySMTPServer
      if (my isThisSMTPServerBeingUsed(eachSMTPServer)) then
      -- Don't add to the list of smtp servers to potentially delete
      -- if the server is actively being used by an account
      else
      set nameOfEverySMTPServer to nameOfEverySMTPServer & name of eachSMTPServer
      end if
      end repeat
      if ((count of nameOfEverySMTPServer) is equal to 0) then
      display dialog "All the SMTP servers you have defined are being used by active accounts."
      else
      set theServersToDelete to choose from list nameOfEverySMTPServer with prompt "Choose one or more SMTP servers to delete. None of these servers are currently being used by any of your email accounts." with multiple selections allowed
      if theServersToDelete is not equal to false then
      if ((count of theServersToDelete) is greater than 0) then
      repeat with eachServer in theServersToDelete
      repeat with eachSMTPServer in everySMTPServer
      try
      if (name of eachSMTPServer is equal to eachServer as string) then
      tell application "Mail" to delete eachSMTPServer
      end if
      end try
      end repeat
      end repeat
      display dialog "The selected servers have been deleted!"
      end if
      end if
      end if

      on isThisSMTPServerBeingUsed(theServer)
      -- Run through each account and see if any of them
      -- are using the given SMTP server
      set theResult to false
      tell application "Mail"
      set everyAccount to every account
      repeat with eachAccount in everyAccount
      set nameOfSMTPServer to name of smtp server of eachAccount
      try
      if (nameOfSMTPServer is equal to name of theServer) then
      set theResult to true
      end if
      end try
      end repeat
      end tell
      return theResult
      end isThisSMTPServerBeingUsed

  2. There's an AppleScript for it by Colitis · · Score: 4, Informative

    Try: /Applications/AppleScript/Example\ Scripts/Mail\ Scripts/Manage\ SMTP\ Servers.scpt

    Seemed to work for me OK.

  3. Howto: by moofbong · · Score: 4, Informative

    Edit the file "com.apple.mail.plist" in ~/Library/Preferences. There is a key in the XML called DeliveryAccounts (just search for it in your favorite text editor). Immediately beneath it, there is an array with tags. Just remove the whole ... </dict> section that corresponds to the SMTP server and you should be all set. Probably should close Mail before doing this. Maybe make a backup of your preference file too, just in case. ;)

    --

    ~moofbong

    If 'con' is the opposite of 'pro', what is the opposite of 'progress'?

  4. Re:Use Sendmail by dynayellow · · Score: 3, Funny

    No, no, no, this is Slashdot. You're supposed to first give him a passive-aggressive beratement for using an application with a GUI, then instead of answering his question, tell him to use the most obscure command-line app available (or possibly write one), without, of course, telling him where to get the app.

    Also, include references to one of the following: WINE, FINK, and for extra points, Ogg.

  5. Re:Use Sendmail by Curtman · · Score: 4, Funny

    I've sent emails with 5mb attachments to friends

    What an excellent way to lose friends. ;)

  6. Applescript: the GUI way!!! by zpok · · Score: 4, Informative

    Go to the folder "../Applications/AppleScript/Example Scripts/Mail Scripts/"

    There you'll find "Manage SMTP Servers.scpt".

    Double-click it and you'll get a nice little window with all SMTP servers you don't use and a button to delete them.

    Cheers,

    --
    I think, therefore I am...I think.