Using MailShare: How to Queue Files up for AIMS

I’ve been getting a lot of questions about how anyone can let Apple Internet Mail Server know where you want a file’s mail to go to.

Here’s how I do it in FireShare.

  1. Set up a file to mail. Besides writing your message, you have to give it headers. These used to be things that told the other end where messages go. Nowadays they aren’t really needed, but they’re required anyway. If you leave out any of these, some sites will reject your messages.

    • From: an e-mail address
    • To: an e-mail address or a description of the group
    • Subject: the subject of the message
    • Date: the date the message was created, sent, or whatever.
  2. You might also want to consider “Reply-To:”, if you want replies to go to a different place than the “From” address. Also, technically, the “To:” line is supposed to contain an e-mail address, not a group description, even for mailing lists. But most mailing lists put the group description in instead, and most mailers accept this. In fact, the only one I know that doesn’t is Compuserve, and I expect them to buckle under asap.

  3. At the end of your headers, you have to put two returns, not one. There has to be a blank line separating your headers from the body of the message, or it won’t be found.

  4. Add the correct resources. You need to tell AIMS where the mail is going, and where it’s from. These are the “RCPT TO” and “MAIL FROM” addresses. The “MAIL FROM” address is where your mail gets bounced if it can’t get where it’s going.

    • The “RCPT TO” (recipient to) address(es) go into a string resource list with id 8192.
    • The “MAIL FROM” address (there can be only one) go into an “STR ” resource with id 8192. It’s a Pascal string, so you have to precede it with the string’s length.
  5. Here’s how I do it in AppleScript. You’ll need the GTQ Scripting Additions in order to pull this one off.

    • set RCPT_TO to {"e-mail1@domain1","e-mail2@domain2","e-mail3@domain3"}
    • set MAIL_FROM to "e-mail4@domain4"
    • add string list RCPT_TO to MailFile id 8192 with replacing allowed
    • set From_Resource to {resource name:"Bounce", resource id:8192, attributes:0, resource type:"STR ", resource data:(ASCII character (length of MAIL_FROM)) & MAIL_FROM}
    • add resource From_Resource to MailFile id 8192 with replacing allowed
  6. Move the file into the Mail Server’s Incoming Folder I don’t actually create the file in the Mail Server’s folder, although you can, I suppose. The folder is “Your Hard Drive:System Folder:Mail Folder:Incoming Mail:”. If you create it outside of that folder, you can move it in using Jon’s Commands:

    • set OutGoingMail to (path to system folder as string) & "Mail Folder:Incoming Mail:"
    • moveFile MailFile to OutGoingMail

Feel free to ask me questions about this process. I’m not particularly good at it, however, I just managed to get it to work by trial and error.

Scripting AIMS

AIMS is not particularly scriptable. The only AppleEvents it understands are “Open” and “Quit”. If you’re only using AIMS to send mail, and not to receive mail, you may find those useful: queue up some messages, start AIMS up, give it time to finish, and quit. Unfortunately, there is no “Are ye bleedin’ finished yet” AppleEvent in AIMS, so you’ll have to guess.