top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Parsing a email attachment over SSL

0 votes
324 views

I get a daily email attachment to my Gmail account which I want to automatically download. I found the following Perl script which does just that:

http://stackoverflow.com/questions/2453548/how-can-i-download-imap-mail-attachments-over-ssl-and-save-them-locally-using-pe

The above script uses the following syntax to search the messages via IMAP:

my @messages = $imap->search(SUBJECT => $today);

In my case, I want to search on two criteria, subject and date. I tried various ways such as:

 my @messages = $imap->search(SUBJECT => $subject, ON => $today);    
 my @messages = $imap->search({SUBJECT => $subject, ON => $today});
 my @messages = $imap->search("SUBJECT => $subject, ON => $today");

but none of these worked. How can I search on multiple criteria using Mail::IMAPClient?

posted Jul 29, 2013 by Mandeep Sehgal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

The documentation for Mail::IMAPClient says that the search() method arguments are appended to an IMAP SEARCH command. I think if you look at the relevent section of the IMAP RFC (https://tools.ietf.org/html/rfc3501#section-6.4.4) you'll find some examples similar to what you're doing.

You probably also want to heed the note in the Mail::IMAPClient documentation about how to distinguish a legit search that returns zero hits versus a search that fails.

answer Jul 30, 2013 by Sheetal Chauhan
Similar Questions
0 votes

I have just come across this Webopedia ( www.webopedia.com/TERM/S/SSL.html ) entry:

"SSL: Short for Secure Sockets Layer, a protocol developed by Netscape or transmitting private documents via the Internet. SSL uses a cryptographic system that uses two keys to encrypt data ˆ’ a public key known to everyone and a private or secret key known only to the recipient of the message. Both Netscape Navigator and Internet Explorer support SSL, and many Web sites use the protocol to obtain confidential user information, such as credit card numbers. By convention, URLs that require an SSL connection start with https: instead of http"

SSL is generally advised for use with browsers and web sites that support it, but as confidential information can be harvested (according to the Webopedia entry anyway), could anybody advise me on using SSL with my bank and similar sites and whether any alternative (and safe) should be considered.

I generally use Tor as well when sending confidential information through emails or through webmail. As I understand it, my bank does not use OpenPGP and would not accept my public gnupg key for decrypting
encrypted transmissions. Short of changing my bank, can anybody give me further advice on which extra measures I can take to be reasonably certain I can prevent sensitive information from being harvested, and the safest way of sending information by email and through websites?

+1 vote

I am writing a simple tool that needs to read the serial number of a remote SSL certificate. I've poked around Google for a bit but can't find anything that fits the bill.

Is this possible in Python? If so, would someone point me in the general direction of how to do it?

0 votes

How to use multiple virtual hosts with a single SSL instance running on the standard https port.

+1 vote

What would be the best module available for parsing html?
My intention is to parse html that contains a table of 5 columns and any number of rows, and have a hash ref like $html->{1}->{col1}=data11, $html->{1}->{col2}=data12 ...$html->{2}->{col1}=data21, $html->{2}->{col2}=data22...etc
Would there be an existing module that can do this without too much effort on my part?

...