$mbox_errcount = 0;
logs('Conectado como '.@$mconf['user']." a $mailbox", DEBUG);
if (imap_num_msg($mbox) and $hdr = imap_headerinfo($mbox, 1)) {
- logs(sprintf("Nuevo mail '%s' de %s", decode_header($hdr->subject), decode_header($hdr->subject)));
+ logs(sprintf("Nuevo mail '%s' de %s", decode_header($hdr->subject), decode_header($hdr->fromaddress)));
@list($padron, $ej, $ent, $codigo) = validar_cabecera($hdr);
if ($padron) {
logs('Cabecera válida', DEBUG);
function validar_cabecera($hdr) {
// Subject: padron nro_ej nro_entrega clave_alumno
$subject = decode_header($hdr->subject);
- if (preg_match('/^\s*(\d{5})\s+([1-4])\.([12])\s+(.*)$/', $subject, $m)) {
+ if (preg_match('/^\s*(\d{5})\s+(\d)\.(\d)\s+(.*)$/', $subject, $m)) {
return array_slice($m, 1, 5);
}
return false;