How to find out to whom belongs attachment file from GMS file system.

  • 7016727
  • 04-Aug-2015
  • 11-Aug-2015

Environment

GroupWise Mobility Service 2.x

Situation

You find out some bigger files in attachment area or any Antivirus software detects a virus on GMS attachments and you want to identify a user to whom this attachment belongs to.

Resolution

GMS stores attachments in a form of /var/lib/datasync/mobility/attachments/<number>/<filestoreID>.
Here is an example how to get additional information  from GMS attachment file example from a lab server "dc2e11483aa411e5836f000c298f29b3".
 
1. From a GMS server, terminal window login to a mobility database:
 
psql -d mobility -U datasync_user
 
and provide a password if prompted. That is based upon what you specified for that account during GMS installation.
 
2. Once you are logged in, you can do a query for a file name as follows:
 
mobility=> select filestoreid,filename from attachments where filestoreid='dc2e11483aa411e5836f000c298f29b3';

filestoreid | filename
----------------------------------+------------
dc2e11483aa411e5836f000c298f29b3 | defect.jpg
(1 row)
 
So the file name is a picture file called "defect.jpg".
 
To identify users who have this file in their mails:
 
select userid from users where guid in (select userid from attachmentmaps where attachmentid in (select attachmentid from attachments where filestoreid='<the_filestoreid>'));
 
example:
mobility=> select userid from users where guid in (select userid from attachmentmaps where attachmentid in (select attachmentid from attachments where filestoreid='dc2e11483aa411e5836f000c298f29b3'));

userid
----------------
user2.po1.dom1