commands.c revision 2615df45a8027948a474abe5e817b34b0499c171
/* Copyright (c) 2009 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "array.h"
#include "str.h"
#include "istream.h"
#include "ostream.h"
#include "safe-mkstemp.h"
#include "mail-storage-service.h"
#include "index/raw/raw-storage.h"
#include "lda-settings.h"
#include "mail-deliver.h"
#include "main.h"
#include "client.h"
#include "commands.h"
#define ERRSTR_MAILBOX_TEMP_FAIL "451 4.2.0 <%s> Temporary internal error"
{
return 0;
}
{
unsigned int len;
return 0;
}
addr = "";
else {
argv++;
}
return 0;
}
/* just skip these */
} else {
"501 5.5.4 Unsupported options");
return 0;
}
}
return 0;
}
{
const struct mail_recipient *rcpts;
unsigned int i, count;
for (i = 0; i < count; i++) {
return TRUE;
}
return FALSE;
}
{
struct mail_recipient rcpt;
struct mail_storage_service_input input;
unsigned int len;
int ret;
return 0;
}
addr = "";
else {
argv++;
}
return 0;
}
return 0;
}
return 0;
}
if (ret < 0) {
"451 4.3.0 Temporary user lookup failure");
return 0;
}
if (ret == 0) {
"550 5.1.1 <%s> User doesn't exist", name);
return 0;
}
return 0;
}
{
return -1;
}
{
return 0;
}
{
return 0;
}
{
return 0;
}
static int
{
struct mail_deliver_context dctx;
struct mail_storage *storage;
void **sets;
const char *error;
enum mail_error mail_error;
int ret;
&error) < 0) {
return -1;
}
}
ret = 0;
/* This shouldn't happen */
i_error("BUG: Saving failed to unknown storage");
ret = -1;
} else {
if (mail_error == MAIL_ERROR_NOSPACE) {
"452 4.2.2" : "552 5.2.2",
} else {
}
ret = -1;
}
return ret;
}
{
const struct mail_recipient *rcpts;
unsigned int count;
int ret;
src_mail);
i_set_failure_prefix("lmtp: ");
if (ret == 0)
return TRUE;
/* failed. try the next one. */
}
return FALSE;
}
{
const struct mail_recipient *rcpts;
unsigned int i, count;
for (i = 0; i < count; i++) {
}
}
{
static const char *wanted_headers[] = {
"From", "To", "Message-ID", "Subject", "Return-Path",
};
struct raw_mailbox *raw_box;
struct mailbox_header_lookup_ctx *headers_ctx;
enum mail_error error;
} else {
}
i_error("Can't open delivery mail as raw: %s",
return -1;
}
i_error("Can't sync delivery mail: %s",
return -1;
}
0, headers_ctx);
return 0;
}
{
if (client_open_raw_mail(client) < 0)
return;
/* save the message to the first recipient's mailbox */
return;
else
/* use the first saved message to save it elsewhere too.
this might allow hard linking the files. */
mailbox_close(&box);
}
}
{
int fd;
/* continue writing to file */
return -1;
return 0;
}
/* move everything to a temporary file. FIXME: it really shouldn't
be in /tmp.. */
if (fd == -1)
return -1;
/* we just want the fd, unlink it */
/* shouldn't happen.. */
return -1;
}
return -1;
return 0;
}
static int
{
return 0;
} else {
}
}
{
#define DATA_DOT_NEXT_POS 3
#define DATA_END_SIZE 5
static const char *data_end = "\r\n.\r\n";
const unsigned char *data;
unsigned int rewind;
skip = 0;
/* found the ending. drop the "." line out. */
skip = i + 1;
i -= DATA_END_SIZE - DATA_DOT_NEXT_POS;
break;
}
/* saw a dot at the beginning of line. drop it. */
"Temporary internal failure");
return;
}
start = i;
} else {
}
}
/* we might not want to write the dot, so keep it in buffer
until we're sure what to do about it. */
}
"Temporary internal failure");
return;
}
if (i < size) {
}
}
{
if (client_input_read(client) < 0)
return;
}
{
return 0;
}
return 0;
}
return -1;
}