[Postfix espanol] PATCH: postqueue -r is broken as of snapshot 20020510

Wietse Venema wietse en porcupine.org
Jue Jun 13 23:14:09 CEST 2002


Postfix versions 20020510 and later discard mail with an "unexpected
record type 65" error message, when mail with MIME type information
is re-queued with the command "postsuper -r".

The MIME type information is taken either from the sendmail command
line, from the SMTP MAIL FROM:  command, or from a Content-Type:
message header.

The patch below moves a few queue file structure sanity checks from
the cleanup server to the pickup daemon, where they really belong.

I'll push out a snapshot 20020613 later today.

	Wietse

diff -cr /tmp/postfix-1.1.11-20020610/src/cleanup/cleanup_extracted.c src/cleanup/cleanup_extracted.c
*** /tmp/postfix-1.1.11-20020610/src/cleanup/cleanup_extracted.c	Mon May 27 14:16:07 2002
--- src/cleanup/cleanup_extracted.c	Thu Jun 13 16:36:30 2002
***************
*** 120,140 ****
  
  /* cleanup_extracted_process - process extracted segment */
  
! static void cleanup_extracted_process(CLEANUP_STATE *state, int type, char *buf, int unused_len)
  {
      char   *myname = "cleanup_extracted_process";
      VSTRING *clean_addr;
      ARGV   *rcpt;
      char  **cpp;
  
-     if (type == REC_TYPE_RRTO) {
- 	/* XXX Use extracted information instead. */
- 	return;
-     }
-     if (type == REC_TYPE_ERTO) {
- 	/* XXX Use extracted information instead. */
- 	return;
-     }
      if (type == REC_TYPE_RCPT) {
  	clean_addr = vstring_alloc(100);
  	cleanup_rewrite_internal(clean_addr, *buf ? buf : var_empty_addr);
--- 120,132 ----
  
  /* cleanup_extracted_process - process extracted segment */
  
! static void cleanup_extracted_process(CLEANUP_STATE *state, int type, char *buf, int len)
  {
      char   *myname = "cleanup_extracted_process";
      VSTRING *clean_addr;
      ARGV   *rcpt;
      char  **cpp;
  
      if (type == REC_TYPE_RCPT) {
  	clean_addr = vstring_alloc(100);
  	cleanup_rewrite_internal(clean_addr, *buf ? buf : var_empty_addr);
***************
*** 154,162 ****
  	return;
      }
      if (type != REC_TYPE_END) {
! 	msg_warn("%s: unexpected record type %d in extracted segment",
! 		 state->queue_id, type);
! 	state->errs |= CLEANUP_STAT_BAD;
  	return;
      }
  
--- 146,152 ----
  	return;
      }
      if (type != REC_TYPE_END) {
! 	cleanup_out(state, type, buf, len);
  	return;
      }
  
diff -cr /tmp/postfix-1.1.11-20020610/src/pickup/pickup.c src/pickup/pickup.c
*** /tmp/postfix-1.1.11-20020610/src/pickup/pickup.c	Tue May 28 12:48:54 2002
--- src/pickup/pickup.c	Thu Jun 13 16:58:09 2002
***************
*** 200,218 ****
  	    }
  #define STREQ(x,y) (strcmp(x,y) == 0)
  
! 	    if (info->st.st_uid == var_owner_uid
! 		|| (STREQ(attr_name, MAIL_ATTR_ENCODING)
! 		    && (STREQ(attr_value, MAIL_ATTR_ENC_7BIT)
! 			|| STREQ(attr_value, MAIL_ATTR_ENC_8BIT)
! 			|| STREQ(attr_value, MAIL_ATTR_ENC_NONE)))) {
  		rec_fprintf(cleanup, REC_TYPE_ATTR, "%s=%s",
  			    attr_name, attr_value);
! 		continue;
  	    }
- 	    msg_warn("uid=%ld: ignoring attribute record: %.200s=%.200s",
- 		     (long) info->st.st_uid, attr_name, attr_value);
  	    continue;
  	}
  	if (type == REC_TYPE_FILT && info->st.st_uid != var_owner_uid)
  	    continue;
  	else {
--- 200,225 ----
  	    }
  #define STREQ(x,y) (strcmp(x,y) == 0)
  
! 	    if (STREQ(attr_name, MAIL_ATTR_ENCODING)
! 		&& (STREQ(attr_value, MAIL_ATTR_ENC_7BIT)
! 		    || STREQ(attr_value, MAIL_ATTR_ENC_8BIT)
! 		    || STREQ(attr_value, MAIL_ATTR_ENC_NONE))) {
  		rec_fprintf(cleanup, REC_TYPE_ATTR, "%s=%s",
  			    attr_name, attr_value);
! 	    } else if (info->st.st_uid != var_owner_uid) {
! 		msg_warn("uid=%ld: ignoring attribute record: %.200s=%.200s",
! 			 (long) info->st.st_uid, attr_name, attr_value);
  	    }
  	    continue;
  	}
+ 	if (type == REC_TYPE_RRTO) 
+ 	    /* Use message header extracted information instead. */
+ 	    continue;
+ 	if (type == REC_TYPE_ERTO) 
+ 	    /* Use message header extracted information instead. */
+ 	    continue;
+ 	if (type == REC_TYPE_INSP && info->st.st_uid != var_owner_uid)
+ 	    continue;
  	if (type == REC_TYPE_FILT && info->st.st_uid != var_owner_uid)
  	    continue;
  	else {
-
Para ENVIAR mensajes a esta lista tienes que estar SUSCRITA a ella.
.
Envía la linea "unsubscribe postfix-espanol" en el cuerpo de un mensaje
a majordomo en WL0.org para quitarte de la lista.



Más información sobre la lista de distribución Postfix-es