Updated README-emailler.md to reflect change to config filename

This commit is contained in:
Bobbi Webber-Manners 2020-07-15 17:21:59 -04:00
parent caf217a29b
commit c30952d246
3 changed files with 68 additions and 6 deletions

View File

@ -29,7 +29,7 @@ A few design principles that I have tried to apply:
### Configuration File
The system configuration file is called `POP65.CFG`. It is a straightforward ProDOS text file, with one parameter per line. You may edit this file using any ProDOS text editor. When editing the file be careful not to add or delete any lines - this file has no grammar and the lines *must* appear in the expected order.
The system configuration file is called `EMAIL.CFG`. It is a straightforward ProDOS text file, with one parameter per line. You may edit this file using any ProDOS text editor. When editing the file be careful not to add or delete any lines - this file has no grammar and the lines *must* appear in the expected order.
All three of the mail programs `POP65.SYSTEM`, `EMAIL.SYSTEM` and `SMTP65.SYSTEM` share this configuration file.
@ -110,7 +110,7 @@ POP65 runs without any user interaction and performs the following tasks:
- Detect Uthernet-II
- Obtain IP address using DHCP
- Connect to POP3 server using parameters from first three lines of `POP65.CFG`. (`USER` and `PASS` commands)
- Connect to POP3 server using parameters from first three lines of `EMAIL.CFG`. (`USER` and `PASS` commands)
- Enquire how many email messages are waiting. (`STAT` command)
- Download each email in turn (`RETR` command) and store it in the `SPOOL` directory.
- If configured to delete messages on the POP3 server, messages are deleted after successful download (`DELE` command)
@ -296,13 +296,13 @@ SMTP65 runs without any user interaction and performs the following tasks:
- Detect Uthernet-II
- Obtain IP address using DHCP
- Connect to SMTP server using parameters from lines 5 and 6 of `POP65.CFG`. (`HELO` command)
- Connect to SMTP server using parameters from lines 5 and 6 of `EMAIL.CFG`. (`HELO` command)
- Iterate through each message in the `OUTBOX` mailbox (which is `/H1/DOCUMENTS/EMAIL/OUTBOX` with our sample configuration)
- Scan each message looking for the following headers:
- `To:`
- `From:`
- `cc:`
- Notify the SMTP server of our email address (from `POP65.CFG`). (`MAIL FROM:` command)
- Notify the SMTP server of our email address (from `EMAIL.CFG`). (`MAIL FROM:` command)
- Notify the SMTP server of each recipient listed in `To:` and `From:` headers (`RCPT TO:` command)
- Send the email body to the SMTP sender. (`DATA` command)
- If the message was successfully sent, copy it to the `SENT` mailbox.

View File

@ -4,11 +4,13 @@
/////////////////////////////////////////////////////////////////////////////
// TODO: Convert tabs to spaces in load_file()
// TODO: Add '\r' to final line in load_file(), if it doesn't have one
// TODO: The code doesn't check for error cases when calling gap buffer
// functions.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#include <peekpoke.h>
@ -547,8 +549,34 @@ void page_up(void) {
cursor_up();
}
/*
* Load EMAIL.SYSTEM to $2000 and jump to it
* (Code is in language card space so it can't possibly be trashed)
*/
#pragma code-name (push, "LC")
void load_email(void) {
static char *emailer = "EMAIL.SYSTEM";
FILE *fp = fopen(emailer, "rb");
char *p = 0x280;
uint16_t l;
if (!fp)
goto err;
l = fread((void*)0x2000, 1, 512, fp);
if (l == 0)
goto err;
strcpy(p + 1, emailer);
*p = strlen(emailer);
__asm__("jmp $2000"); // That's all folks!
err:
printf("Can't load EMAIL.SYSTEM");
fclose(fp);
}
#pragma code-name (pop)
int main() {
/*
* Main editor routine
*/
int edit() {
char c;
uint16_t pos;
uint8_t i;
@ -586,7 +614,8 @@ int main() {
draw_screen();
break;
case 0x11: // Ctrl-Q "QUIT"
exit(0);
load_email();
//exit(0);
break;
case 0x7f: // DEL "BACKSPACE"
delete_char();
@ -621,3 +650,8 @@ int main() {
}
}
int main() {
edit();
}

View File

@ -1525,6 +1525,30 @@ void create_blank_outgoing() {
error(ERR_NONFATAL, filename);
}
/*
* Load EDIT.SYSTEM to $2000 and jump to it
* (Code is in language card space so it can't possibly be trashed)
*/
#pragma code-name (push, "LC")
void load_editor(void) {
static char *editor = "EDIT.SYSTEM";
FILE *fp = fopen(editor, "rb");
char *p = 0x280;
uint16_t l;
if (!fp)
goto err;
l = fread((void*)0x2000, 1, 512, fp);
if (l == 0)
goto err;
strcpy(p + 1, editor);
*p = strlen(editor);
__asm__("jmp $2000"); // That's all folks!
err:
error(ERR_NONFATAL, "Can't load EDIT.SYSTEM");
fclose(fp);
}
#pragma code-name (pop)
/*
* Keyboard handler
*/
@ -1672,6 +1696,9 @@ void keyboard_hdlr(void) {
reverse = 0;
switch_mailbox(curr_mbox);
break;
case '!': // Secret debug command!!!
load_editor();
break;
case 'q':
case 'Q':
if (prompt_okay("Quit - ")) {
@ -1685,6 +1712,7 @@ void keyboard_hdlr(void) {
}
}
void main(void) {
uint8_t *pp;
pp = (uint8_t*)0xbf98;