aboutsummaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
...
* Ken Estes's doc bug.Eric S. Raymond1998-11-201-4/+6
* Minor fixes from Guenther Leber.Eric S. Raymond1998-11-171-3/+4
* Postmaster option fix.Eric S. Raymond1998-11-173-0/+6
* Gerald Britton's support for mixed Kerberos and Hesiod.Eric S. Raymond1998-11-178-37/+125
* Detect and warn about cucipop.Eric S. Raymond1998-11-171-1/+27
* Ready to ship.Eric S. Raymond1998-11-071-1/+1
* Ready to release.Eric S. Raymond1998-11-071-1/+1
* Added LMTP support.Eric S. Raymond1998-11-071-0/+4
* Added LMTP support.Eric S. Raymond1998-11-0715-78/+292
* More features.Eric S. Raymond1998-11-051-1/+3
* Enable - as config file argument.Eric S. Raymond1998-11-052-5/+14
* Dave Bodenstab's fix.Eric S. Raymond1998-11-051-4/+15
* NeXT portability.Eric S. Raymond1998-11-051-0/+6
* Fix typo.Eric S. Raymond1998-11-051-1/+1
* Context for bouncemail is encapsulated.Eric S. Raymond1998-11-053-83/+91
* Move some code.Eric S. Raymond1998-11-033-57/+69
* Typo fix.Eric S. Raymond1998-11-031-6/+6pre { line-height: 125%; } td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * smtp.c -- code for speaking SMTP to a listener port
 *
 * Concept due to Harry Hochheiser.  Implementation by ESR.  Cleanup and
 * strict RFC821 compliance by Cameron MacPherson.
 *
 * Copyright 1997 Eric S. Raymond
 * For license terms, see the file COPYING in this directory.
 */

#include <stdio.h>
#include <config.h>
#include<
* Nailed.Eric S. Raymond1998-10-291-3/+5
* Add FCC line.Eric S. Raymond1998-10-291-0/+1
* Fix properties editing.Eric S. Raymond1998-10-294-2/+13
* Core dump fix.Eric S. Raymond1998-10-291-1/+1
* Ready to release.Eric S. Raymond1998-10-282-2/+2
* Expand some jargon.Eric S. Raymond1998-10-281-6/+6
* Added bsmtp option.Eric S. Raymond1998-10-2810-21/+119
* *** empty log message ***Eric S. Raymond1998-10-281-4/+4
* *** empty log message ***Eric S. Raymond1998-10-281-0/+5
* Fix one rewwrite bug.Eric S. Raymond1998-10-271-1/+3
* Ready to ship.Eric S. Raymond1998-10-272-2/+3
* Fixed bug in %T expansion.Eric S. Raymond1998-10-271-1/+1
* Jonathan T. Agnew's massive code cleanup.Eric S. Raymond1998-10-2622-187/+246
* Fix handling of properties option.Eric S. Raymond1998-10-261-3/+1
* Fix handling of properties option.Eric S. Raymond1998-10-261-2/+2
* More instrumentation.Eric S. Raymond1998-10-261-0/+7
class="mi">0; while ((SockRead(sock, smtp_response, sizeof(smtp_response)-1)) != -1) { int n = strlen(smtp_response); if (smtp_response[strlen(smtp_response)-1] == '\n') smtp_response[strlen(smtp_response)-1] = '\0'; if (smtp_response[strlen(smtp_response)-1] == '\r') smtp_response[strlen(smtp_response)-1] = '\r'; if (n < 4) return SM_ERROR; smtp_response[n] = '\0'; if (outlevel == O_VERBOSE) error(0, 0, "SMTP< %s", smtp_response); for (hp = extensions; hp->name; hp++) if (!strncasecmp(hp->name, smtp_response+4, strlen(hp->name))) *opt |= hp->value; if ((smtp_response[0] == '1' || smtp_response[0] == '2' || smtp_response[0] == '3') && smtp_response[3] == ' ') return SM_OK; else if (smtp_response[3] != '-') return SM_ERROR; } return SM_UNRECOVERABLE; } int SMTP_from(int sock, char *from, char *opts) /* send a "MAIL FROM:" message to the SMTP listener */ { int ok; char buf[MSGBUFSIZE]; sprintf(buf, "MAIL FROM:<%s>", from); if (opts) strcat(buf, opts); SockPrintf(sock,"%s\r\n", buf); if (outlevel == O_VERBOSE) error(0, 0, "SMTP> %s", buf); ok = SMTP_ok(sock); return ok; } int SMTP_rcpt(int sock, char *to) /* send a "RCPT TO:" message to the SMTP listener */ { int ok; SockPrintf(sock,"RCPT TO:<%s>\r\n", to); if (outlevel == O_VERBOSE) error(0, 0, "SMTP> RCPT TO:<%s>", to); ok = SMTP_ok(sock); return ok; } int SMTP_data(int sock) /* send a "DATA" message to the SMTP listener */ { int ok; SockPrintf(sock,"DATA\r\n"); if (outlevel == O_VERBOSE) error(0, 0, "SMTP> DATA"); ok = SMTP_ok(sock); return ok; } int SMTP_rset(int sock) /* send a "RSET" message to the SMTP listener */ { int ok; SockPrintf(sock,"RSET\r\n"); if (outlevel == O_VERBOSE) error(0, 0, "SMTP> RSET"); ok = SMTP_ok(sock); return ok; } int SMTP_quit(int sock) /* send a "QUIT" message to the SMTP listener */ { int ok; SockPrintf(sock,"QUIT\r\n"); if (outlevel == O_VERBOSE) error(0, 0, "SMTP> QUIT"); ok = SMTP_ok(sock); return ok; } int SMTP_eom(int sock) /* send a message data terminator to the SMTP listener */ { int ok; SockPrintf(sock,".\r\n"); if (outlevel == O_VERBOSE) error(0, 0, "SMTP>. (EOM)"); ok = SMTP_ok(sock); return ok; } int SMTP_ok(int sock) /* returns status of SMTP connection */ { while ((SockRead(sock, smtp_response, sizeof(smtp_response)-1)) != -1) { int n = strlen(smtp_response); if (smtp_response[strlen(smtp_response)-1] == '\n') smtp_response[strlen(smtp_response)-1] = '\0'; if (smtp_response[strlen(smtp_response)-1] == '\r') smtp_response[strlen(smtp_response)-1] = '\r'; if (n < 4) return SM_ERROR; smtp_response[n] = '\0'; if (outlevel == O_VERBOSE) error(0, 0, "SMTP< %s", smtp_response); if ((smtp_response[0] == '1' || smtp_response[0] == '2' || smtp_response[0] == '3') && smtp_response[3] == ' ') return SM_OK; else if (smtp_response[3] != '-') return SM_ERROR; } return SM_UNRECOVERABLE; } /* smtp.c ends here */