Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
OS X Businesses Operating Systems Software Utilities (Apple) Apple

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

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?"
This discussion has been archived. No new comments can be posted.

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

Comments Filter:
  • by theWrkncacnter ( 562232 ) * on Wednesday November 12, 2003 @06:48PM (#7458467)
    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.
    • This feature is not present in jaguar.
      Software updates are tied to OS updates as far as the free digital lifestyle iApps are concerned.

      As long as security updates are available to all OS's I don't think thats a problem.
      • Software updates are tied to OS updates as far as the free digital lifestyle iApps are concerned.

        Not true. Just a few weeks ago there was a standalone iCal update released.
      • by __aafkqj3628 ( 596165 ) on Thursday November 13, 2003 @12:16AM (#7461224)
        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
    • It was not possible from within the Jaguar GUI. (I submitted a bug report about it to Apple, and am glad to see that they fixed it.)

      The easiest way to remove servers is to edit the Mail preferences file. Open ~/Library/Preferences/com.apple.mail.plist (either in Property List Editor--if you have the developer tools installed--or any text editor) and find the entry "Delivery Accounts". Delete any you don't want.
    • No, it's not the same in Jag. And I think it's a great story because I have been trying to find the answer to this question for quite some time as well.
    • In Jaguar, select "Manage SMTP Servers" from the Mail scripts menu.
  • by Colitis ( 8283 ) <jj...walker@@@outlook...co...nz> on Wednesday November 12, 2003 @06:49PM (#7458476)
    Try: /Applications/AppleScript/Example\ Scripts/Mail\ Scripts/Manage\ SMTP\ Servers.scpt

    Seemed to work for me OK.
  • Howto: (Score:4, Informative)

    by moofbong ( 188566 ) * <bdimchef-slashdot&wieldim,com> on Wednesday November 12, 2003 @06:52PM (#7458503) Homepage
    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 <dict> tags. Just remove the whole <dict> ... </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. ;)
  • Use Sendmail (Score:1, Offtopic)

    by coolmacdude ( 640605 )
    Why not use sendmail (or Postfix in Panther)? That way you never have to manage your SMTP servers and can just use one all the time.
    • Don't some ISPs break this? I am referring to the ones that decide that their users would only send Spam if they were allowed to bypass the ISP's SMTP server?
      • Re:Use Sendmail (Score:3, Informative)

        by shamino0 ( 551710 )
        Don't some ISPs break this?

        Many ISP's (including Earthlink, which I use) block access to port 25 - meaning you can't send directly to a remote mail server. As a part of this, they tell you that all outbound mail must go through thair provided mail server.

        This is an anti-spam procedure that works well. If all of their customers must send mail through a single server, that server can filter and block those customers that have abused their mail privileges. In other words, these blocks are (for the most

        • I've used postfix enabler successfully on my 10.3 machine. I've sent emails with 5mb attachments to friends and they've gotten them fine.

          I have Pacific Bell slash SBC as an ADSL provider.

          postfix enabler is available at
          http://www.roadstead.com/weblog/Tutorials/imag es/P ostfixEnabler1.0.zip
        • But this doesn't rule out running your own internal mail server. You just have to configure it to relay all outbound mail (that is, everything leaving your LAN) through your ISP's mail server instead of sending directly to the recipient's server. I know that sendmail can be configured to do this (I've done this on my Linux PC in order to allow me to use /usr/ucb/mail.) I would assume that any other halfway decent mail server should be able to do the same thing.

          Unfortunately, AOL rejects mail from "private

    • by dynayellow ( 106690 ) on Wednesday November 12, 2003 @08:10PM (#7459379)
      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.
  • At least in Mac OS X 10.3 (Panther):
    • Mail -> Preferences -> Accounts -> [account name] -> Account Information
    • From the "Outgoing Mail Server (SMTP):" pull-down list, select "Edit Server List...".
    • Select the server(s) you wish to remove, then press the "Remove Server" button.

  • yes (Score:3, Informative)

    by jcbphi ( 235355 ) on Wednesday November 12, 2003 @06:54PM (#7458523) Homepage
    Open your favorite text editor (or the plist editor included with the OS X dev tools), and have a go at:

    ~/Library/Preferences/com.apple.mail.plist

    In this file, there is a key labeled "DeliveryAccounts". This is where all your SMTP account information is kept. You should be able to edit/delete any account from there.

    There is a means of doing this through AppleScript as well, but I don't remember how that works, so I'll have to leave that as an exercise for the reader.
    • Re:yes (Score:3, Informative)

      Actually, if you double-click on this (or any) .plist file -- or go there through the Terminal and type "open FILENAME" where FILENAME is the name of the .plist file -- it will open in Property List Editor, which is designed explicitly for this kind of management. It takes some playing around with this app to get comfortable in it (ALWAYS BACK UP!) but once you do, it's a powerful and convenient tool.
      • Actually, if you double-click on this (or any) .plist file ... it will open in Property List Editor

        I think the Property List Editor is part of the developer tools, and so isn't installed by default. But every distribution of OS X includes an installer for them, so this shouldn't be a big deal.

  • Yeah (Score:2, Informative)

    by Hanji ( 626246 )
    I've had this same problem, and it really pissed me off for a while.

    Fortunately, Panther seems to have fixed this - in account prefs, the SMTP server dropdown has added a "Edit Servers" Option. If you're still in Jaguar, however, I believe you can kill servers by editing ~/Library/Preferences/com.apple.mail.plist. I managed this once in Jaguar, but I'm too lazy to try to figure out which entries to trash now. I'm pretty sure it's in there somewhere, though.
    • 1. open com.apple.mail.plist and backup
      2. expand "root"
      3. expand "DeliveryAccounts"
      4. expand "0", "1", etc
      5. find the account you want to delete
      6. select the corresponding array number
      7. press the delete button
      8. save as com.apple.mail.plist

      just did it on my machine (running Jaguar), works a charm.
  • Wow (Score:2, Flamebait)

    by hawkbug ( 94280 )
    I find it amazing that I submit articles about stuff somebody might care about, and somebody else submits a question than could proably be easily answered on groups.google.com, and it gets posted. Wow. A simple search would have eliminated the need for this submission:

    Newsgroup post [google.com]
    • Re:Wow (Score:2, Informative)

      by standsolid ( 619377 )
      oh my god, I foudn the answer in 20 seconds on google... not even newsgroups
      http://email.about.com/cs/macosxmailtips/a/et01270 3.htm [about.com]
      since when is slashdot "I'm too lazy to use GOOGLE" tech support. goddammit.
  • by carpe_noctem ( 457178 ) on Wednesday November 12, 2003 @07:13PM (#7458723) Homepage Journal
    While we're on the subject of mail.app annoyances, does anybody know how to get mail to permanently accept SSL certificates in 10.3? I looked around macosxhints.com, but none of those suggestions seemed to work.

    Thanks.....
    • This [columbia.edu] link should hopefully help you. I have the same problem with the mail server at my office.
    • I can't remember exactly, but it's somthing like: (BTW, Please be careful -- back up files and tread lightly. if unsure about any of this, verify my advice with experts, online posts, etc.)
      1. you first use openssl to grab the certificate in base64 form like this:

        openssl s_client -showcerts -connect yoursmtpserver.com:465

      2. Copy the base 64 cert section (between and including the 'begin certificate' and 'end certificate') to a file (i.e.:yoursmtpserver.cer).
      3. Next copy /System/Library/Keychains/X509Anchors
  • In Panther Mail, there is an action (from the little gear pulldown menu) called manage SMTP servers. Triggers an Applescript to delete unused servers
  • by Domini ( 103836 ) on Thursday November 13, 2003 @05:18AM (#7462396) Journal
    Edit:
    ~/Library/Preferences/com.apple.mail.plist

    And take out the <dict> entries that matches the unused entries...
    <PRE>
    <key>DeliveryAccounts</key>
    <array>
    <dict>
    <key>AccountType</key>
    <string>SMTPAccount</string>
    <key>Hostname</key>
    <string>mail.tbs.co.za</string>
    &nbsp ; <key>ShouldUseAuthentication</key>
    &nbsp ; <string>NO</string>
    </dict>
    </array>
    </PRE>
  • Here is a direct (probably dirty) way to remove smtp servers from the list. Go to the Preferences directory in your home. Open com.apple.mail.plist in property list editor. The subtree under the DeliveryAccounts entry has the list of all the SMTP servers. Delete the ones you don't like.
  • by zpok ( 604055 ) on Thursday November 13, 2003 @10:44AM (#7463731) Homepage
    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,

  • On the subject of Mail.app...
    I use IMAP mail on my server with about 10 folders. These work OK, but I am also presented with a list of hidden system folders like .ssh, .bash_history.

    In thunderbird you can hide folders that start with a '.', or match public_html.

    How do you do this in Mail.app ?

    Will
    • It's not possiable w/ Mail.app as far as I know, but my solution to this was to change where UW IMAPd uses for imap mail. It works fine, my home folder doesn't get messy, and I don't get junk. I'm too lazy to look up the correct line, but there is an article on Stepwise [stepwise.com] about it; it's undewr the Pre-Mac OS X10.1 section. I just recommend you put it in ~/.mail instead of Library/Mailboxs as the article says
  • Evidently the chimps permitted this question. Is /. a support site?
  • Hi,

    In /Library/Scripts/ Apple has a folder full of Mail AppleScripts, one of which allows you to manage SMTP servers, "Manage SMTP Servers.scpt". It basically allows you to delete any SMTP server from the list that is not currently connected to a Mail Account.

    You can easily add them to the Menu Bar by going to the /Applications/AppleScript/ folder and draging the AppleScript menu onto the menu bar. This will give you a menu with all the folders in /Library/Scripts/ and ~/Library/Scripts/ in it, allowing

I tell them to turn to the study of mathematics, for it is only there that they might escape the lusts of the flesh. -- Thomas Mann, "The Magic Mountain"

Working...