Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tell application "System Events"
- set mailIsRunning to application process "Mail" exists
- end tell
- if mailIsRunning then
- display dialog "Please quit Mail and then run this program again." buttons {"OK"} default button "OK"
- else
- set loggingOption to button returned of (display dialog "Enable socket logging for checking or sending mail. Quit Mail to turn off logging." buttons {"Checking", "Sending", "Both"})
- tell application "Mail"
- set portList to {}
- if loggingOption is in {"Checking", "Both"} then
- repeat with eachAccount in every account
- set incommingPort to port of eachAccount as string
- if portList does not contain incommingPort then
- set end of portList to incommingPort
- end if
- end repeat
- end if
- if loggingOption is in {"Sending", "Both"} then
- repeat with eachAccount in every account
- set outgoingPort to port of smtp server of eachAccount as string
- if portList does not contain outgoingPort then
- set end of portList to outgoingPort
- end if
- end repeat
- end if
- set ports to log activity on to portList
- end tell
- end if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement