/***********************************************************************
* *
* This software is part of the BSD package *
*Copyright (c) 1978-2006 The Regents of the University of California an*
* *
* Redistribution and use in source and binary forms, with or *
* without modification, are permitted provided that the following *
* conditions are met: *
* *
* 1. Redistributions of source code must retain the above *
* copyright notice, this list of conditions and the *
* following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above *
* copyright notice, this list of conditions and the *
* materials provided with the distribution. *
* *
* 3. Neither the name of The Regents of the University of California*
* names of its contributors may be used to endorse or *
* promote products derived from this software without *
* specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS *
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED *
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON *
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, *
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY *
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
* POSSIBILITY OF SUCH DAMAGE. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the following disclaimer. *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in *
* distribution. *
* 3. Neither the name of the University nor the names of its *
* contributors may be used to endorse or promote products derived *
* from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" *
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF *
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, *
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT *
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF *
* SUCH DAMAGE. *
* *
* Kurt Shoens (UCB) *
* gsf *
* *
***********************************************************************/
#pragma prototyped
/*
* IMAP client
*
* Glenn Fowler
* AT&T Research
*/
#include "mailx.h"
#if _PACKAGE_ast
#include <css.h>
#include <tm.h>
/*
* send the message in fp to the SMTP server on host
* for recipients argv ...
* if original!=0 then it is the size of the message
* and the original sender is retrived from the
* message and preserved
*/
int
{
register char* s;
register char* t;
char* e;
int n;
int fd;
int r;
off_t z;
/*
* connect to the service
*/
{
return -1;
}
{
if (sp)
else
return -1;
}
/*
* verify
*/
do
{
goto bad_recv;
goto bad_prot;
} while (*e == '-');
/*
* identify
*/
goto bad_send;
do
{
goto bad_recv;
goto bad_prot;
} while (*(unsigned char*)e == SMTP_OK);
/*
* from
*/
if (original)
{
goto bad_mesg;
for (s += 5; isspace(*s); s++);
for (t = s; *t && !isspace(*t); t++);
if (!(n = t - s))
goto bad_mesg;
goto bad_send;
}
else
{
z = 0;
goto bad_send;
}
do
{
goto bad_recv;
goto bad_prot;
} while (*e == '-');
/*
* to
*/
while (s = *argv++)
{
goto bad_send;
do
{
goto bad_recv;
goto bad_prot;
} while (*e == '-');
}
/*
* body
*/
goto bad_send;
do
{
goto bad_recv;
goto bad_prot;
} while (*e == '-');
goto bad_send;
goto bad_send;
{
goto bad_send;
break;
}
goto bad_send;
do
{
goto bad_recv;
goto bad_prot;
} while (*e == '-');
/*
* quit
*/
goto bad_send;
do
{
goto bad_recv;
goto bad_prot;
} while (*e == '-');
r = 0;
goto done;
note(0, "smtp: bad message -- no From header");
goto bad;
e[n - 1] = 0;
goto bad;
goto bad;
bad:
r = -1;
done:
return r;
}
#else
int
{
note(0, "smtp: support not enabled");
return -1;
}
#endif