From zazen85 at gmail.com Sun Oct 7 03:34:04 2007 From: zazen85 at gmail.com (Andrea Sesshin) Date: Sun, 7 Oct 2007 12:34:04 +0200 Subject: [Roma.pm] confirm 10f9089b578ad3265747a07dd23848a441eb9567 In-Reply-To: References: Message-ID: <9002b4ca0710070334t9deb88bg3cd9751d8a5cf39d@mail.gmail.com> Hi dude! I have an orrible trouble with this poor cgi: is a client pop3 web based gateway.The function "connetti()" never been called and i don't know why!!The functions in the bottom of the script load,save,restore the state of the session by save the user,pass,host,id in a file.if you try to execute the script all stop when you click on the submit button. I hope there is a good soul who help me. There is the code: #!/usr/bin/perl -w use Mail::POP3Client; use CGI qw(:all); #use CGIBook::Error; #use HTML::Template; local $MAX_FILES = 1000; local $DATA_DIR = 'usr/lib/cgi-bin'; my $q = new CGI; my $this_script_name = 'popGem.cgi'; my $id = get_id($q); my $action = ( $q->param("action") ) || 'start'; if ( $action eq "start") { start($q,$id); } if ( $action eq "connetti" ) { connetti($q,$id); } sub start { my ($q ,$id) = @_; print $q-> header(), $q-> start_html(-title => "PopGem pop3 web based reader"), $q-> start_form(-action => $this_script_name ,-method => "post"), $q-> table( {-border => "1"}, $q->caption("PopGem pop3 web based reader!"), $q->Tr( $q-> th("Nome Utente:"), $q-> th( textfield(-name => "user_name",-size => "30") ) ), $q-> Tr( $q-> th("Password:"), $q-> th( password_field(-name => "password",-size => "30") ) ), $q-> Tr( $q-> th("Nome Server:"), $q-> th( textfield(-name => "domain_name",-size => "30") ) ), $q-> Tr( $q-> th({-rowspan => "2"}, $q-> submit(-value => "connetti") ) ), $q->hidden( -name => "id", -default => $id, -override => 1 ), $q->hidden( -name => "action", -default => "connetti", -override => 1 ) ), $q-> end_form(), $q-> end_html(); save_state($q); } sub connetti { my ($q,$id) = @_; my $user_name = param('user_name'); my $password = param('password'); my $domain_name = param('domani_name'); #per ogni messaggio che ? presente nella mailbox stampo una riga di una tabella #con le informazioni utili: mittente,oggetto,ecc... my $pop = new Mail::POP3Client ( USER => $user_name, PASSWORD => $password, HOST => $domain_name, AUTH_MODE => 'PASS' ); for ($i = 1; $i <= $pop->Count(); $i++) { foreach my $message ( $pop->Head($i) ){ my $date = ($message =~ /^Date:\s+/i); my $from = ($message =~ /^From:\s+/i); my $to = ($message =~ /^To:\s+/i); my $subject = ($message =~ /^Subject:\s+/i); print $q-> header(), $q-> start_html(-title => "Ecco i messaggi"), $q-> table( {-border => "1"}, $q->caption("Informazioni del messaggio $i:"), $q->Tr( $q-> th("Date:"), $q-> th("From:"), $q-> th("To:"), $q-> th("Subject:") ), $q->Tr( $q-> th("$date"), $q-> th("$from"), $q-> th("$to"), $q-> th("$subject") ) ), $q-> end_html(); $q-> save_state($q); } } } sub get_id { my $q = shift; my $id; my $unsafe_id = $q->param( "id" ) || ''; $unsafe_id =~ s/[^\dA-Fa-f]//g; if ( $unsafe_id =~ /^(.+)$/ ) { $id = $1; load_state( $q, $id ); } else { $id = unique_id( ); $q->param( -name => "id", -value => $id ); } return $id; } # Loads the current CGI object's default parameters from the saved state sub load_state { my( $q, $id ) = @_; my $saved = get_state( $id ) or return; foreach ( $saved->param ) { $q->param( $_ => $saved->param($_) ) unless defined $q- >param($_); } } # Reads a saved CGI object from disk and returns its params as a hash ref sub get_state { my $id = shift; my $session = session_filename( $id ); local *FILE; -e $session or return; open FILE, $session or die "Cannot open $session: $!"; my $q_saved = new CGI( \*FILE ) or error( $q, "Unable to restore saved state." ); close FILE; return $q_saved; } # Saves the current CGI object to disk sub save_state { my $q = shift; my $session = session_filename( $id ); local( *FILE, *DIR ); # Avoid DoS attacks by limiting the number of data files my $num_files = 0; opendir DIR, $DATA_DIR; $num_files++ while readdir DIR; closedir DIR; # Compare the file count against the max if ( $num_files > $MAX_FILES ) { error( $q, "We cannot save your request because the directory " . "is full. Please try again later" ); } # Save the current CGI object to disk open FILE, ">> $session" or return die "Cannot write to $session: $!"; $q->save( \*FILE ); close FILE; } # Separated from other code in case this changes in the future sub session_filename { my $id = shift; return "/$DATA_DIR/$id"; } sub unique_id { # Use Apache's mod_unique_id if available return $ENV{UNIQUE_ID} if exists $ENV{UNIQUE_ID}; require Digest::MD5; my $md5 = new Digest::MD5; my $remote = $ENV{REMOTE_ADDR} . $ENV{REMOTE_PORT}; # Note this is intended to be unique, and not unguessable # It should not be used for generating keys to sensitive data my $id = $md5->md5_base64( time, $$, $remote ); $id =~ tr|+/=|-_.|; # Make non-word chars URL-friendly return $id; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/roma/attachments/20071007/cf3da527/attachment.html From zazen85 at gmail.com Sun Oct 7 03:35:22 2007 From: zazen85 at gmail.com (Andrea Sesshin) Date: Sun, 7 Oct 2007 12:35:22 +0200 Subject: [Roma.pm] huge script!Help! Message-ID: <9002b4ca0710070335w6f84370euaab30d96f4721732@mail.gmail.com> Hi dude! I have an orrible trouble with this poor cgi: is a client pop3 web based gateway.The function "connetti()" never been called and i don't know why!!The functions in the bottom of the script load,save,restore the state of the session by save the user,pass,host,id in a file.if you try to execute the script all stop when you click on the submit button. I hope there is a good soul who help me. There is the code: #!/usr/bin/perl -w use Mail::POP3Client; use CGI qw(:all); #use CGIBook::Error; #use HTML::Template; local $MAX_FILES = 1000; local $DATA_DIR = 'usr/lib/cgi-bin'; my $q = new CGI; my $this_script_name = 'popGem.cgi'; my $id = get_id($q); my $action = ( $q->param("action") ) || 'start'; if ( $action eq "start") { start($q,$id); } if ( $action eq "connetti" ) { connetti($q,$id); } sub start { my ($q ,$id) = @_; print $q-> header(), $q-> start_html(-title => "PopGem pop3 web based reader"), $q-> start_form(-action => $this_script_name ,-method => "post"), $q-> table( {-border => "1"}, $q->caption("PopGem pop3 web based reader!"), $q->Tr( $q-> th("Nome Utente:"), $q-> th( textfield(-name => "user_name",-size => "30") ) ), $q-> Tr( $q-> th("Password:"), $q-> th( password_field(-name => "password",-size => "30") ) ), $q-> Tr( $q-> th("Nome Server:"), $q-> th( textfield(-name => "domain_name",-size => "30") ) ), $q-> Tr( $q-> th({-rowspan => "2"}, $q-> submit(-value => "connetti") ) ), $q->hidden( -name => "id", -default => $id, -override => 1 ), $q->hidden( -name => "action", -default => "connetti", -override => 1 ) ), $q-> end_form(), $q-> end_html(); save_state($q); } sub connetti { my ($q,$id) = @_; my $user_name = param('user_name'); my $password = param('password'); my $domain_name = param('domani_name'); #per ogni messaggio che ? presente nella mailbox stampo una riga di una tabella #con le informazioni utili: mittente,oggetto,ecc... my $pop = new Mail::POP3Client ( USER => $user_name, PASSWORD => $password, HOST => $domain_name, AUTH_MODE => 'PASS' ); for ($i = 1; $i <= $pop->Count(); $i++) { foreach my $message ( $pop->Head($i) ){ my $date = ($message =~ /^Date:\s+/i); my $from = ($message =~ /^From:\s+/i); my $to = ($message =~ /^To:\s+/i); my $subject = ($message =~ /^Subject:\s+/i); print $q-> header(), $q-> start_html(-title => "Ecco i messaggi"), $q-> table( {-border => "1"}, $q->caption("Informazioni del messaggio $i:"), $q->Tr( $q-> th("Date:"), $q-> th("From:"), $q-> th("To:"), $q-> th("Subject:") ), $q->Tr( $q-> th("$date"), $q-> th("$from"), $q-> th("$to"), $q-> th("$subject") ) ), $q-> end_html(); $q-> save_state($q); } } } sub get_id { my $q = shift; my $id; my $unsafe_id = $q->param( "id" ) || ''; $unsafe_id =~ s/[^\dA-Fa-f]//g; if ( $unsafe_id =~ /^(.+)$/ ) { $id = $1; load_state( $q, $id ); } else { $id = unique_id( ); $q->param( -name => "id", -value => $id ); } return $id; } # Loads the current CGI object's default parameters from the saved state sub load_state { my( $q, $id ) = @_; my $saved = get_state( $id ) or return; foreach ( $saved->param ) { $q->param( $_ => $saved->param($_) ) unless defined $q- >param($_); } } # Reads a saved CGI object from disk and returns its params as a hash ref sub get_state { my $id = shift; my $session = session_filename( $id ); local *FILE; -e $session or return; open FILE, $session or die "Cannot open $session: $!"; my $q_saved = new CGI( \*FILE ) or error( $q, "Unable to restore saved state." ); close FILE; return $q_saved; } # Saves the current CGI object to disk sub save_state { my $q = shift; my $session = session_filename( $id ); local( *FILE, *DIR ); # Avoid DoS attacks by limiting the number of data files my $num_files = 0; opendir DIR, $DATA_DIR; $num_files++ while readdir DIR; closedir DIR; # Compare the file count against the max if ( $num_files > $MAX_FILES ) { error( $q, "We cannot save your request because the directory " . "is full. Please try again later" ); } # Save the current CGI object to disk open FILE, ">> $session" or return die "Cannot write to $session: $!"; $q->save( \*FILE ); close FILE; } # Separated from other code in case this changes in the future sub session_filename { my $id = shift; return "/$DATA_DIR/$id"; } sub unique_id { # Use Apache's mod_unique_id if available return $ENV{UNIQUE_ID} if exists $ENV{UNIQUE_ID}; require Digest::MD5; my $md5 = new Digest::MD5; my $remote = $ENV{REMOTE_ADDR} . $ENV{REMOTE_PORT}; # Note this is intended to be unique, and not unguessable # It should not be used for generating keys to sensitive data my $id = $md5->md5_base64( time, $$, $remote ); $id =~ tr|+/=|-_.|; # Make non-word chars URL-friendly return $id; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/roma/attachments/20071007/a151ba01/attachment-0001.html From flavio at polettix.it Mon Oct 8 00:39:42 2007 From: flavio at polettix.it (Flavio Poletti) Date: Mon, 8 Oct 2007 09:39:42 +0200 (CEST) Subject: [Roma.pm] huge script!Help! In-Reply-To: <9002b4ca0710070335w6f84370euaab30d96f4721732@mail.gmail.com> References: <9002b4ca0710070335w6f84370euaab30d96f4721732@mail.gmail.com> Message-ID: <32898.213.203.159.164.1191829182.squirrel@upmail.polettix.it> Ciao, questa mailing list ? prevalentemente in italiano, quindi non c'? bisogno di passare all'inglese (anche se non c'? problema). Personalmente, non ho molta voglia di dare un'occhiata al tuo codice. Le ragioni sono molteplici: 1. ? enorme, e probabilmente il problema sta in un punto ben definito. Se dici che "connetti()" non viene mai chiamata, perch? non provare a levare buona parte del resto? Pi? ? piccolo il pezzo di codice su cui chiedi di dare un'occhiata, maggiore sar? la quantit? di gente che sar? disposta a darcela. 2. Il codice non ? indentato in maniera decente e si fa *molta* fatica a leggerlo. Potresti ribattere che si fa molta fatica anche a scriverlo... ma chi ? che deve faticare? :) Inoltre, esistono dei tool che fanno l'indentazione in maniera automatica, prova ad esempio a cercare perltidy. 3. Il tuo script non utilizza n? strict n? warnings, e le ragioni per cui dovrebbe farlo sono qui: http://www.polettix.it/cgi-bin/wiki.pl/Programming/Dammi_una_mano Magari non ? roba tua, quindi non ne hai colpa, ma fare debugging su qualcosa del genere ? un incubo che non auguro a nessuno, ossia non abbiamo colpa nemmeno noi. 4. Hai fatto cross-posting (http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/326b9d719cd6290d http://qaix.com/perl-web-programming/576-227-huge-cgi-help-pop3-client-read.shtml) e sarebbe stato utile indicarlo, visto che gi? altra gente ha dato un'occhiata al tuo script. Magari altri vorranno comunque darti indicazioni, prendi questi commenti come dei suggerimenti per farti dare pi? retta in futuro :) Ciao, Flavio. > Hi dude! I have an orrible trouble with this poor cgi: is a client > pop3 web based gateway.The function "connetti()" never been called and > i don't know why!!The functions in the bottom of the script > load,save,restore the state of the session by save the > user,pass,host,id in a file.if you try to execute the script all stop > when you click on the submit button. > I hope there is a good soul who help me. > > There is the code: > > #!/usr/bin/perl -w > > use Mail::POP3Client; > use CGI qw(:all); > #use CGIBook::Error; > #use HTML::Template; > > local $MAX_FILES = 1000; > local $DATA_DIR = 'usr/lib/cgi-bin'; > > my $q = new CGI; > my $this_script_name = 'popGem.cgi'; > my $id = get_id($q); > my $action = ( $q->param("action") ) || 'start'; > > if ( $action eq "start") { > > start($q,$id); > } > > if ( $action eq "connetti" ) { > > connetti($q,$id); > } > > sub start { > my ($q ,$id) = @_; > print > $q-> header(), > $q-> start_html(-title => "PopGem pop3 web based reader"), > $q-> start_form(-action => $this_script_name ,-method => > "post"), > $q-> table( > {-border => "1"}, > $q->caption("PopGem pop3 web based reader!"), > $q->Tr( > $q-> th("Nome Utente:"), > $q-> th( textfield(-name => "user_name",-size => > "30") ) > ), > $q-> Tr( > $q-> th("Password:"), > $q-> th( password_field(-name => "password",-size > => > "30") ) > ), > $q-> Tr( > $q-> th("Nome Server:"), > $q-> th( textfield(-name => "domain_name",-size => > "30") ) > ), > $q-> Tr( > $q-> th({-rowspan => "2"}, > $q-> submit(-value => "connetti") ) > ), > $q->hidden( > -name => "id", > -default => $id, > -override => 1 > ), > $q->hidden( > -name => "action", > -default => "connetti", > -override => 1 > ) > ), > $q-> end_form(), > $q-> end_html(); > save_state($q); > } > > sub connetti { > > my ($q,$id) = @_; > my $user_name = param('user_name'); > my $password = param('password'); > my $domain_name = param('domani_name'); > #per ogni messaggio che ? presente nella mailbox stampo una riga di > una tabella > #con le informazioni utili: mittente,oggetto,ecc... > > my $pop = new Mail::POP3Client ( USER => $user_name, > PASSWORD => $password, > HOST => $domain_name, > AUTH_MODE => 'PASS' ); > > for ($i = 1; $i <= $pop->Count(); $i++) { > > foreach my $message ( $pop->Head($i) ){ > > my $date = ($message =~ /^Date:\s+/i); > my $from = ($message =~ /^From:\s+/i); > my $to = ($message =~ /^To:\s+/i); > my $subject = ($message =~ /^Subject:\s+/i); > print $q-> header(), > $q-> start_html(-title => "Ecco i messaggi"), > $q-> table( > {-border => "1"}, > $q->caption("Informazioni del messaggio $i:"), > $q->Tr( > $q-> th("Date:"), > $q-> th("From:"), > $q-> th("To:"), > $q-> th("Subject:") > ), > $q->Tr( > $q-> th("$date"), > $q-> th("$from"), > $q-> th("$to"), > $q-> th("$subject") > ) > ), > $q-> end_html(); > $q-> save_state($q); > } > } > } > > sub get_id { > my $q = shift; > my $id; > > my $unsafe_id = $q->param( "id" ) || ''; > $unsafe_id =~ s/[^\dA-Fa-f]//g; > > if ( $unsafe_id =~ /^(.+)$/ ) { > $id = $1; > load_state( $q, $id ); > } > else { > $id = unique_id( ); > $q->param( -name => "id", -value => $id ); > } > > return $id; > } > > # Loads the current CGI object's default parameters from the saved > state > sub load_state { > my( $q, $id ) = @_; > my $saved = get_state( $id ) or return; > > foreach ( $saved->param ) { > $q->param( $_ => $saved->param($_) ) unless defined $q- >>param($_); > } > } > > # Reads a saved CGI object from disk and returns its params as a hash > ref > sub get_state { > my $id = shift; > my $session = session_filename( $id ); > local *FILE; > > -e $session or return; > open FILE, $session or die "Cannot open $session: $!"; > my $q_saved = new CGI( \*FILE ) or > error( $q, "Unable to restore saved state." ); > close FILE; > > return $q_saved; > } > > # Saves the current CGI object to disk > sub save_state { > my $q = shift; > my $session = session_filename( $id ); > local( *FILE, *DIR ); > > # Avoid DoS attacks by limiting the number of data files > my $num_files = 0; > opendir DIR, $DATA_DIR; > $num_files++ while readdir DIR; > closedir DIR; > > # Compare the file count against the max > if ( $num_files > $MAX_FILES ) { > error( $q, "We cannot save your request because the directory > " . > "is full. Please try again later" ); > } > > # Save the current CGI object to disk > open FILE, ">> $session" or return die "Cannot write to $session: > $!"; > $q->save( \*FILE ); > close FILE; > } > > # Separated from other code in case this changes in the future > sub session_filename { > my $id = shift; > return "/$DATA_DIR/$id"; > } > > sub unique_id { > # Use Apache's mod_unique_id if available > return $ENV{UNIQUE_ID} if exists $ENV{UNIQUE_ID}; > > require Digest::MD5; > > my $md5 = new Digest::MD5; > my $remote = $ENV{REMOTE_ADDR} . $ENV{REMOTE_PORT}; > # Note this is intended to be unique, and not unguessable > # It should not be used for generating keys to sensitive data > my $id = $md5->md5_base64( time, $$, $remote ); > $id =~ tr|+/=|-_.|; # Make non-word chars URL-friendly > return $id; > } > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma From zazen85 at gmail.com Mon Oct 8 08:36:14 2007 From: zazen85 at gmail.com (Andrea Sesshin) Date: Mon, 8 Oct 2007 17:36:14 +0200 Subject: [Roma.pm] huge script!Help! In-Reply-To: <32898.213.203.159.164.1191829182.squirrel@upmail.polettix.it> References: <9002b4ca0710070335w6f84370euaab30d96f4721732@mail.gmail.com> <32898.213.203.159.164.1191829182.squirrel@upmail.polettix.it> Message-ID: <9002b4ca0710080836q4f608b14u8533af9fd4b08ff1@mail.gmail.com> Il 08/10/07, Flavio Poletti ha scritto: > > Ciao, > > questa mailing list ? prevalentemente in italiano, quindi non c'? > bisogno di passare all'inglese (anche se non c'? problema). > > Personalmente, non ho molta voglia di dare un'occhiata al tuo codice. Le > ragioni sono molteplici: > > 1. ? enorme, e probabilmente il problema sta in un punto ben definito. Se > dici che "connetti()" non viene mai chiamata, perch? non provare a levare > buona parte del resto? Pi? ? piccolo il pezzo di codice su cui chiedi di > dare un'occhiata, maggiore sar? la quantit? di gente che sar? disposta a > darcela. > > 2. Il codice non ? indentato in maniera decente e si fa *molta* fatica a > leggerlo. Potresti ribattere che si fa molta fatica anche a scriverlo... > ma chi ? che deve faticare? :) Inoltre, esistono dei tool che fanno > l'indentazione in maniera automatica, prova ad esempio a cercare perltidy. > > 3. Il tuo script non utilizza n? strict n? warnings, e le ragioni per cui > dovrebbe farlo sono qui: > http://www.polettix.it/cgi-bin/wiki.pl/Programming/Dammi_una_mano > Magari non ? roba tua, quindi non ne hai colpa, ma fare debugging su > qualcosa del genere ? un incubo che non auguro a nessuno, ossia non > abbiamo colpa nemmeno noi. > > 4. Hai fatto cross-posting > ( > http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/326b9d719cd6290d > > http://qaix.com/perl-web-programming/576-227-huge-cgi-help-pop3-client-read.shtml > ) > e sarebbe stato utile indicarlo, visto che gi? altra gente ha dato > un'occhiata al tuo script. > > Magari altri vorranno comunque darti indicazioni, prendi questi commenti > come dei suggerimenti per farti dare pi? retta in futuro :) > > Ciao, > > Flavio. > > > _______________________________________________ > > Roma mailing list > > Roma at pm.org > > http://mail.pm.org/mailman/listinfo/roma > > > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma E' vero,ho fatto cross-posting, e me ne scuso,non ? una cosa da fare.Comunque il problema era un p? in tutte le cose che hai detto tu e anche di altre che mi hanno suggerito (nella miriade di newsgroup in cui ho postato).Ti ringrazio comunque per avermi risposto e prometto che seguir? a postare solo una volta e solo in condizioni decenti.Alla prossima!! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/roma/attachments/20071008/9d441dcf/attachment.html From flavio at polettix.it Mon Oct 8 10:48:05 2007 From: flavio at polettix.it (Flavio Poletti) Date: Mon, 8 Oct 2007 19:48:05 +0200 (CEST) Subject: [Roma.pm] huge script!Help! In-Reply-To: <9002b4ca0710080836q4f608b14u8533af9fd4b08ff1@mail.gmail.com> References: <9002b4ca0710070335w6f84370euaab30d96f4721732@mail.gmail.com> <32898.213.203.159.164.1191829182.squirrel@upmail.polettix.it> <9002b4ca0710080836q4f608b14u8533af9fd4b08ff1@mail.gmail.com> Message-ID: <32796.213.203.159.164.1191865685.squirrel@upmail.polettix.it> >> 4. Hai fatto cross-posting >> ... > E' vero,ho fatto cross-posting, e me ne scuso,non ? una cosa da fare. > ... A mio modesto modo di vedere non c'? niente di particolarmente sbagliato nel fare cross-posting, purch? sia detto chiaramente. A volte uno legge le domande solo dopo un po' di tempo, ed avere un quadro completo delle risposte che sono state date fa risparmiare tempo. Alla prossima, Flavio. From zazen85 at gmail.com Fri Oct 12 12:25:30 2007 From: zazen85 at gmail.com (Andrea Sesshin) Date: Fri, 12 Oct 2007 21:25:30 +0200 Subject: [Roma.pm] huge script!Help! In-Reply-To: <32796.213.203.159.164.1191865685.squirrel@upmail.polettix.it> References: <9002b4ca0710070335w6f84370euaab30d96f4721732@mail.gmail.com> <32898.213.203.159.164.1191829182.squirrel@upmail.polettix.it> <9002b4ca0710080836q4f608b14u8533af9fd4b08ff1@mail.gmail.com> <32796.213.203.159.164.1191865685.squirrel@upmail.polettix.it> Message-ID: <9002b4ca0710121225v21a47d2ft3bfc5414a6053de3@mail.gmail.com> Buonasera gente,devo estrarre da una mail(che presumibilmente contiene un allegato) il nome ed il content-type dell'allegato.Quello che so' ? che la mail ? un tipo di messaggio mime,ma poi come fare il parsing?Qualcuno mi sa indirizzare sulle 2 funzioni ad hoc per l'occasione?Purtroppo ho poco tempo,altrimenti leggerei Mime::Parser.Grazie alla buon anima che mi ascolter?! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/roma/attachments/20071012/0f563b0c/attachment.html From flavio at polettix.it Fri Oct 12 16:23:17 2007 From: flavio at polettix.it (Flavio Poletti) Date: Sat, 13 Oct 2007 01:23:17 +0200 (CEST) Subject: [Roma.pm] huge script!Help! In-Reply-To: <9002b4ca0710121225v21a47d2ft3bfc5414a6053de3@mail.gmail.com> References: <9002b4ca0710070335w6f84370euaab30d96f4721732@mail.gmail.com> <32898.213.203.159.164.1191829182.squirrel@upmail.polettix.it> <9002b4ca0710080836q4f608b14u8533af9fd4b08ff1@mail.gmail.com> <32796.213.203.159.164.1191865685.squirrel@upmail.polettix.it> <9002b4ca0710121225v21a47d2ft3bfc5414a6053de3@mail.gmail.com> Message-ID: <32813.213.203.159.164.1192231397.squirrel@upmail.polettix.it> 1. Usa dei subject significativi: non solo "huge script!Help!" di suo fa veramente schifo, in pi? in questo caso non c'entra assolutamente con l'argomento della richiesta. Non fare reply su quelli vecchi solo perch? sei a corto di fantasia. 2. Che vuol dire che hai poco tempo? La mailing list ha normalmente tempi medio-lunghi, sicuramente molto pi? lunghi di quelli necessari a leggersi la documentazione di un modulo. Se puoi aspettare una risposta, puoi tranquillamente leggerti la documentazione e fare qualche prova, e magari tornare con qualche domanda pi? specifica. Riguardo MIME::Parser, in passato l'ho usato ed ? un po' a basso livello, ma sostanzialmente usabile. Non mi sembra ci siano alternative, se non soluzioni fai-da-te che rischierebbero di essere fragili e consumare tempo. Ciao, Flavio. > Buonasera gente,devo estrarre da una mail(che presumibilmente contiene un > allegato) il nome ed il content-type dell'allegato.Quello che so' ? che la > mail ? un tipo di messaggio mime,ma poi come fare il parsing?Qualcuno mi > sa > indirizzare sulle 2 funzioni ad hoc per l'occasione?Purtroppo ho poco > tempo,altrimenti leggerei Mime::Parser.Grazie alla buon anima che mi > ascolter?! > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma From zazen85 at gmail.com Sat Oct 13 01:06:00 2007 From: zazen85 at gmail.com (Andrea Sesshin) Date: Sat, 13 Oct 2007 10:06:00 +0200 Subject: [Roma.pm] huge script!Help! In-Reply-To: <32813.213.203.159.164.1192231397.squirrel@upmail.polettix.it> References: <9002b4ca0710070335w6f84370euaab30d96f4721732@mail.gmail.com> <32898.213.203.159.164.1191829182.squirrel@upmail.polettix.it> <9002b4ca0710080836q4f608b14u8533af9fd4b08ff1@mail.gmail.com> <32796.213.203.159.164.1191865685.squirrel@upmail.polettix.it> <9002b4ca0710121225v21a47d2ft3bfc5414a6053de3@mail.gmail.com> <32813.213.203.159.164.1192231397.squirrel@upmail.polettix.it> Message-ID: <9002b4ca0710130106x351c9301r40657a3c74f82337@mail.gmail.com> Il 13/10/07, Flavio Poletti ha scritto: > > 1. Usa dei subject significativi: non solo "huge script!Help!" di suo fa > veramente schifo, in pi? in questo caso non c'entra assolutamente con > l'argomento della richiesta. Non fare reply su quelli vecchi solo perch? > sei a corto di fantasia. > > 2. Che vuol dire che hai poco tempo? La mailing list ha normalmente tempi > medio-lunghi, sicuramente molto pi? lunghi di quelli necessari a leggersi > la documentazione di un modulo. Se puoi aspettare una risposta, puoi > tranquillamente leggerti la documentazione e fare qualche prova, e magari > tornare con qualche domanda pi? specifica. > > Riguardo MIME::Parser, in passato l'ho usato ed ? un po' a basso livello, > ma sostanzialmente usabile. Non mi sembra ci siano alternative, se non > soluzioni fai-da-te che rischierebbero di essere fragili e consumare > tempo. > > Ciao, > > Flavio. Mi scuso per il subject,non me ne sono proprio accorto che era lo stesso di prima.La documentazione la sto leggendo,ma non ? che abbia a che fare con i MIME tutti i giorni,quindi diciamo che non riesco a saltarci fuori per questo.Quindi in attesa che scenda un Dio onnipotente che mi dia qualche pista su cui battere sono in alto mare. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/roma/attachments/20071013/63bc7103/attachment.html