Re: Squirrelmail attachment error when combined with jmeter to send attachments multiple times

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

 



> Apologies for the lengthy mail. I am trying to explain the problem in detail.
> I need help badly to solve the below problem. Any suggestion is appreciated.
>
> We are recording the scenario of sending a mail with attachment through
> Squirrel mail Using Jmeter. Our intension is to send many mails using Jmeter
> and Squirrelmail.
>
> While recording,
>  I attached the file and sent. It got recorded successfully. But when I
> start running the script using jmeter, I am getting error because the file
> name is hard coded in script and its not able to find the same name again.
> The file name will be created on the fly in squirrelmail and will be stored
> for the section "attach file" . The sample attach file is below.
>
> a:1:{i:0;O:7:"Message":21:{s:13:"rfc822_header";s:0:"";s:19:"reply_rfc822_header";s:0:"";s:11:"mime_header";O:13:"MessageHeader":10:{s:5:"type0";s:11:"application";s:5:"type1";s:12:"octet-stream";s:10:"parameters";a:1:{s:4:"name";s:10:"jmeter.log";}s:2:"id";i:0;s:11:"description";s:0:"";s:8:"encoding";s:0:"";s:4:"size";i:0;s:3:"md5";s:0:"";s:11:"disposition";O:11:"Disposition":2:{s:4:"name";s:10:"attachment";s:10:"properties";a:1:{s:8:"filename";s:10:"jmeter.log";}}s:8:"language";s:0:"";}s:5:"flags";s:0:"";s:5:"type0";s:0:"";s:5:"type1";s:0:"";s:8:"entities";a:0:{}s:9:"entity_id";s:0:"";s:10:"parent_ent";N;s:6:"entity";N;s:6:"parent";s:0:"";s:12:"decoded_body";s:0:"";s:7:"is_seen";i:0;s:11:"is_answered";i:0;s:10:"is_deleted";i:0;s:10:"is_flagged";i:0;s:10:"is_mdnsent";i:0;s:9:"body_part";s:0:"";s:6:"offset";i:0;s:6:"length";i:0;s:14:"att_local_name";s:32:"1ajDgYkgMQoKBVkC2xkTbUF5yScvcHlA";}}
>
> What squirrelmail basically does is, it copies the attached file and store
> it in its configured attachment directory. The name of the file stored in
> attachment directory wont be same as file name. It stores the file name in
> 32 characters. For eg: 1ajDgYkgMQoKBVkC2xkTbUF5yScvcHlA, which is given
> above as part of the attach file.
>
> The files listed in attachment directory are
> ### ls -l
> rw-------   1 _www   staff  13970 Jan 22 04:47
> 0VIpOBdvcpYkGqCtd2Lvhs8B0o7HfW8A
> -rw-------   1 _www   staff   5853 Jan 22 04:12
> BoALKfX8ENj1bXBZYUIoxRMO06tOgAKz
> -rw-------   1 _www   staff  18860 Jan 22 05:24
> LC6BvjJzlfVJKojTcNIiVO3TX6LRQ0Lz
> -rw-------   1 _www   staff  10058 Jan 22 04:38
> LZ44HTqSqju1VSEpbTTc21VOSW0dnLs2
>
> So when I start running, basically the script will attach again the same
> file, but it will store in squirrelmail attach directory with on the fly
> created file name (some 32 characters file name), which is not known to the
> script, as it is created on the fly. And the script fails because it tries
> to open the file which is hard coded in the script. I get the below error:
>
>> Warning:
>> fopen(/Library/WebServer/Documents/squirrelmail/attach/1ajDgYkgMQoKBVkC2xkTbUF5yScvcHlA)
>> [function.fopen]: failed to open stream: No such file or directory in
>> /Library/WebServer/Documents/squirrelmail/class/deliver/Deliver.class.php
>> on line 307
>
> It wont find the above file because it will be deleted from attachment
> directory once its sent successfully.
>
> I presume I need to do some kind of correlation for attach file section. So
> that jmeter will pick the newly created file and attach it.
> I need help in correlating it so that, if I run the script multiple times,
> jmeter and squirrelmail should be able to send each time, the same file
> again and again. How can I do that?

I haven't used Jmeter, but IMHO, a load testing tool should be able to
accept the form data in a page request and know what to do with it
(without the need to know and hard-code the contents of that data).
The SM code is designed to work this way for a number of good reasons,
and sends the client enough information to be able to properly send
the mail via a simple form submit.  I'm surprised that an Apache tool
has to work at such a primitive level.  Are you sure there's not a
better way to use the tool to accomplish your needs?

> I tried modifying the attach file for that 32 characters and replaced with
> regular expression "(.+?)". But I am getting the below error:

For testing only, you could go into src/compose.php (assuming you are
using version 1.4.18SVN, which should be mostly the same as 1.4.17)
and find line 930:

$localfilename = GenerateRandomString(32, '', 7);

Change this so it sets the name to some static string.

$localfilename = 'attachment_file_for_testing_only';

I haven't tested this, so there could be some issue with this, but you
can take it from there.

> Notice: unserialize() [function.unserialize]:     Error at offset 866 of 876
> bytes in /Library/WebServer/Documents/squirrelmail/src/compose.php     on
> line 370

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

[Index of Archives]     [Video For Linux]     [Yosemite News]     [Yosemite Photos]     [gtk]     [KDE]     [Cyrus SASL]     [Gimp on Windows]     [Steve's Art]     [Webcams]

  Powered by Linux