-/* $Cambridge: exim/src/src/moan.c,v 1.8 2007/02/06 11:11:40 ph10 Exp $ */
-
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 2007 */
+/* Copyright (c) University of Cambridge 1995 - 2009 */
/* See the file NOTICE for conditions of use and distribution. */
/* Functions for sending messages to sender or to mailmaster. */
*/
void
-moan_tell_someone(uschar *who, address_item *addr, uschar *subject,
- char *format, ...)
+moan_tell_someone(uschar *who, address_item *addr,
+ const uschar *subject, const char *format, ...)
{
FILE *f;
va_list ap;
*/
void
-moan_smtp_batch(uschar *cmd_buffer, char *format, ...)
+moan_smtp_batch(uschar *cmd_buffer, const char *format, ...)
{
va_list ap;
int yield = (receive_messagecount > 0)? 1 : 2;
length of the local part. */
localpart = recipient;
-domain = Ustrchr(recipient, '@');
+domain = Ustrrchr(recipient, '@');
if (domain == NULL) return NULL; /* should not occur, but avoid crash */
llen = domain++ - recipient;
if (match_address_list(recipient, TRUE, TRUE, &pattern, NULL, 0, UCHAR_MAX+1,
NULL) == OK)
{
- uschar temp[256];
- Ustrncpy(temp, localpart, llen);
- temp[llen] = 0;
- deliver_localpart = temp;
+ deliver_localpart = string_copyn(localpart, llen);
deliver_domain = domain;
yield = expand_string_copy(newaddress);
deliver_domain = deliver_localpart = NULL;