ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 

  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: Inet-Admins
Inet-Admins mailing list archive (inet-admins@info.east.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [inet-admins] ETRN



In article <Pine.BSF.3.96.990121145100.13305A-100000@domino.dp.ua> you wrote:
> > Я попробовал - у меня получилось. Попыток отправить не делает,
> > по ETRN отдает. Если нужно, могу рассказать подробнее.
>  
> Я сам проверял. Действительно. При первой попытке доставить
> письмо, мейлер с F=e просто ложит это письмо в очередь. Но в следующий
> раз письмо отправляется по обычным правилам.

Извини за задержку с ответом - совсем не было времени спокойно
этим заняться.

Я написал патчик. Теперь это работает так:

[shogun:~]:1005$ mailq
Mail queue is empty
[shogun:~]:1006$ sendmail -bv igor@zynaps.ru
igor@zynaps.ru... deliverable: mailer etrn, host [vulcan.rtsnet.ru], user igor@zynaps.ru
[shogun:~]:1007$ date | mail igor@zynaps.ru
[shogun:~]:1008$ mailq
                Mail Queue (1 request)
--Q-ID-- --Size-- -----Q-Time----- ------------Sender/Recipient------------
UAA08468       29 Sat Jan 30 20:16 igor
                                   igor@zynaps.ru
[shogun:~]:1009$ sendmail -q
[shogun:~]:1010$ mailq
                Mail Queue (1 request)
--Q-ID-- --Size-- -----Q-Time----- ------------Sender/Recipient------------
UAA08468       29 Sat Jan 30 20:16 igor
                                   igor@zynaps.ru
[shogun:~]:1011$ sendmail -qRzynaps
[shogun:~]:1012$ mailq
Mail queue is empty
[shogun:~]:1013$ date | sendmail -f root igor@zynaps.ru 
[shogun:~]:1014$ mailq
                Mail Queue (1 request)
--Q-ID-- --Size-- -----Q-Time----- ------------Sender/Recipient------------
UAA08537       29 Sat Jan 30 20:18 root
                                   igor@zynaps.ru
[shogun:~]:1015$ sendmail -qSroot
[shogun:~]:1016$ mailq
                Mail Queue (1 request)
--Q-ID-- --Size-- -----Q-Time----- ------------Sender/Recipient------------
UAA08537       29 Sat Jan 30 20:18 root
                                   igor@zynaps.ru
[shogun:~]:1017$ telnet localhost smtp
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
[shogun:~]:1018$ root
Password:
[shogun:~]:1000# /usr/sbin/sendmail -q1m -bd
[shogun:~]:1001# exit
[shogun:~]:1019$ sleep 120 && mailq
                Mail Queue (1 request)
--Q-ID-- --Size-- -----Q-Time----- ------------Sender/Recipient------------
UAA08537       29 Sat Jan 30 20:18 root
                                   igor@zynaps.ru
[shogun:~]:1020$ telnet localhost smtp
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 shogun.me.ru ESMTP Sendmail 8.9.2/8.9.2/Zynaps; Sat, 30 Jan 1999 20:24:01 +0300 (MSK)
etrn zynaps.ru
250 Queuing for node zynaps.ru started
quit
221 shogun.me.ru closing connection
Connection closed by foreign host.
[shogun:~]:1021$ mailq
Mail queue is empty
[shogun:~]:1022$ date | mail igor@zynaps.ru
[shogun:~]:1023$ mailq
                Mail Queue (1 request)
--Q-ID-- --Size-- -----Q-Time----- ------------Sender/Recipient------------
UAA08614       29 Sat Jan 30 20:25 igor
                                   igor@zynaps.ru
[shogun:~]:1024$ sleep 120 && mailq
                Mail Queue (1 request)
--Q-ID-- --Size-- -----Q-Time----- ------------Sender/Recipient------------
UAA08614       29 Sat Jan 30 20:25 igor
                                   igor@zynaps.ru
[shogun:~]:1025$ sendmail -qRzynaps 
[shogun:~]:1026$ mailq
Mail queue is empty
[shogun:~]:1027$ 

Т.е. вроде так, как надо? Сообщения о том, что "could not send
message for past 3 hours" продолжают посылаться.

Управляется из конфига. Патчик для 8.9.2. 

Было бы классно, если кто-нибудь погонял это в своей конфигурации
и потом сообщил о результатах. Если все будет хорошо, я попытаюсь
убедить Эрика в нужности этого патча. Подписи собираются :)

-- 
Игорь Винокуров
Российская Торговая Система
diff -ruN sendmail-8.9.2.orig/cf/README sendmail-8.9.2/cf/README
--- sendmail-8.9.2.orig/cf/README	Tue Dec 29 20:53:55 1998
+++ sendmail-8.9.2/cf/README	Sat Jan 30 20:51:21 1999
@@ -1752,6 +1752,11 @@
 					character.
 confCON_EXPENSIVE	HoldExpensive	[False] Avoid connecting immediately
 					to mailers marked expensive?
+confCONBUR_EXPENSIVE	ExpensiveByRequest
+					[False] On mailers mentioned above,
+					initiate connection only if user has
+					explicitly required it by ETRN command
+					or by -qR and -qI parameters.
 confCHECKPOINT_INTERVAL	CheckpointInterval
 					[10] Checkpoint queue files every N
 					recipients.
diff -ruN sendmail-8.9.2.orig/cf/m4/cfhead.m4 sendmail-8.9.2/cf/m4/cfhead.m4
--- sendmail-8.9.2.orig/cf/m4/cfhead.m4	Tue Dec 29 20:42:08 1998
+++ sendmail-8.9.2/cf/m4/cfhead.m4	Sat Jan 30 19:19:14 1999
@@ -120,6 +120,7 @@
 define(`confMIN_FREE_BLOCKS', `100')
 define(`confBLANK_SUB', `.')
 define(`confCON_EXPENSIVE', `False')
+define(`confCONBUR_EXPENSIVE', `False')
 define(`confDELIVERY_MODE', `background')
 define(`confTEMP_FILE_MODE', `0600')
 define(`confMCI_CACHE_SIZE', `2')
diff -ruN sendmail-8.9.2.orig/cf/m4/proto.m4 sendmail-8.9.2/cf/m4/proto.m4
--- sendmail-8.9.2.orig/cf/m4/proto.m4	Tue Dec 29 20:42:07 1998
+++ sendmail-8.9.2/cf/m4/proto.m4	Sat Jan 30 19:06:03 1999
@@ -234,6 +234,9 @@
 # avoid connecting to "expensive" mailers on initial submission?
 _OPTION(HoldExpensive, `confCON_EXPENSIVE')
 
+# connect to "expensive" mailers by user request only?
+_OPTION(ExpensiveByRequest, `confCONBUR_EXPENSIVE')
+
 # checkpoint queue runs after every N successful deliveries
 _OPTION(CheckpointInterval, `confCHECKPOINT_INTERVAL', 10)
 
diff -ruN sendmail-8.9.2.orig/src/queue.c sendmail-8.9.2/src/queue.c
--- sendmail-8.9.2.orig/src/queue.c	Tue Dec 29 20:42:23 1998
+++ sendmail-8.9.2/src/queue.c	Sat Jan 30 20:12:06 1999
@@ -536,6 +536,9 @@
 	register ENVELOPE *e;
 	int njobs;
 	int sequenceno = 0;
+#if _FFR_EXPENSIVE_BY_REQ
+	bool NoConnectSave = NoConnect;
+#endif
 	time_t current_la_time;
 	extern ENVELOPE BlankEnvelope;
 	extern void clrdaemon __P((void));
@@ -644,6 +647,10 @@
 	clrdaemon();
 # endif /* DAEMON */
 
+#if _FFR_EXPENSIVE_BY_REQ
+	if (!ExpensiveByReq ||
+	    (QueueLimitId != NULL || QueueLimitRecipient != NULL))
+#endif
 	/* force it to run expensive jobs */
 	NoConnect = FALSE;
 
@@ -771,6 +778,11 @@
 			free(w->w_host);
 		free((char *) w);
 	}
+
+#if _FFR_EXPENSIVE_BY_REQ
+	/* restore previous behaviour */
+	NoConnect = NoConnectSave;
+#endif
 
 	/* exit without the usual cleanup */
 	e->e_id = NULL;
diff -ruN sendmail-8.9.2.orig/src/readcf.c sendmail-8.9.2/src/readcf.c
--- sendmail-8.9.2.orig/src/readcf.c	Tue Dec 29 20:42:22 1998
+++ sendmail-8.9.2/src/readcf.c	Sat Jan 30 19:17:42 1999
@@ -1527,6 +1527,10 @@
 #define O_CONTROLSOCKET	0xa9
 	{ "ControlSocketName",		O_CONTROLSOCKET,	FALSE	},
 #endif
+#if _FFR_EXPENSIVE_BY_REQ
+#define O_EXPENSIVEBYREQ 0xaa
+	{ "ExpensiveByRequest",		O_EXPENSIVEBYREQ,	FALSE	},
+#endif
 	{ NULL,				'\0',		FALSE	}
 };
 
@@ -2463,6 +2467,13 @@
 		if (ControlSocketName != NULL)
 			free(ControlSocketName);
 		ControlSocketName = newstr(val);
+		break;
+#endif
+
+#if _FFR_EXPENSIVE_BY_REQ
+	  case O_EXPENSIVEBYREQ:
+		/* connect to "expensive" mailers by user request only */
+		ExpensiveByReq = atobool(val);
 		break;
 #endif
 
diff -ruN sendmail-8.9.2.orig/src/sendmail.8 sendmail-8.9.2/src/sendmail.8
--- sendmail-8.9.2.orig/src/sendmail.8	Tue Dec 29 20:42:19 1998
+++ sendmail-8.9.2/src/sendmail.8	Sat Jan 30 20:44:05 1999
@@ -305,6 +305,10 @@
 On mailers that are considered ``expensive'' to connect to,
 don't initiate immediate connection.
 This requires queueing.
+.It Li ExpensiveByRequest
+On mailers mentioned above, initiate connection
+only if user has explicitly required it by ETRN command or
+by -qR and -qI parameters.
 .It Li CheckpointInterval= Ns Ar N
 Checkpoint the queue file after every
 .Ar N
diff -ruN sendmail-8.9.2.orig/src/sendmail.h sendmail-8.9.2/src/sendmail.h
--- sendmail-8.9.2.orig/src/sendmail.h	Tue Dec 29 20:42:19 1998
+++ sendmail-8.9.2/src/sendmail.h	Sat Jan 30 19:18:41 1999
@@ -1167,6 +1167,9 @@
 EXTERN bool	SuprErrs;	/* set if we are suppressing errors */
 EXTERN bool	HoldErrs;	/* only output errors to transcript */
 EXTERN bool	NoConnect;	/* don't connect to non-local mailers */
+#if _FFR_EXPENSIVE_BY_REQ
+EXTERN bool	ExpensiveByReq;	/* deliver "expensive" by force flush */
+#endif
 EXTERN bool	SuperSafe;	/* be extra careful, even if expensive */
 EXTERN bool	ForkQueueRuns;	/* fork for each job when running the queue */
 EXTERN bool	AutoRebuild;	/* auto-rebuild the alias database as needed */
diff -ruN sendmail-8.9.2.orig/src/version.c sendmail-8.9.2/src/version.c
--- sendmail-8.9.2.orig/src/version.c	Tue Dec 29 20:57:32 1998
+++ sendmail-8.9.2/src/version.c	Sat Jan 30 21:01:38 1999
@@ -14,4 +14,4 @@
 static char sccsid[] = "@(#)version.c	8.9.2.1 (Berkeley) 12/29/1998";
 #endif /* not lint */
 
-char	Version[] = "8.9.2";
+char	Version[] = "8.9.2+E";


 




Copyright © Lexa Software, 1996-2009.