Git Product home page Git Product logo

mailnotify's Introduction

mailnotify's People

Contributors

baltruschat avatar fredericguilbault avatar telcy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mailnotify's Issues

KnowBug: Sharing with a group who have the same name then an user

Hi,
inside oc_share table in share_with there is no distinction between groups name and users name.

In front of that, mailnotify will behave like this :

if (it's a group name)
        list all users of the group, 
        then send them the notification. 
else if (it's a valid user UID)
        send him the notification.

So, alice and bob are inside the group foo,
then a user named foo register.

use case 1

if admin share and edit a file shared with the group foo, the users alice and bob will receve the notification.not user foo

use case 2

if admin share and edit a file shared with the user foo, the users alice and bob will receve the notification. not user foo.

In bolth case if foo user is member of the foo group he will receve notification.

Installation Issue

Installed the application. Renamed the folder to MailNotify. Enabled the successfully but when i update the contents i get following error in logs: Call to undefined method OC_Files::getFileInfo() at /var/www/owncloud/apps/mailnotify/lib/mailing.php#44 Thanks Regards Abdul Wajid

KnowBug: link to file inside email does not redirect to the correct file.

When user receve an email and click on the link. He or she will be redirected to his main page not to the file.

Cause: href looks like foobar/owncloud/apps/files/?dir=25 25 is a file_id but owncloud expect a path.

Differents users have a differents path for the same file_id. When the cronjob is launch, the right user path can't be found becose his filesystems is not mounted at the time.

Mailnotify doesn`t work with OC 5.0.7??

Hey there,
I have installed this app on a new OC-Installation with 5.0.7.
The App was succesfull enabled, and the shared Folder shows the image in the attachement picture below. But it seems, it doesnt work. After i upload a new file, it doesnt sends a email to me.
All other emails e.g "share a link per Email" works great.

unbenannt

Is it possible to get some help?

System:
Windows 2008 Server with IIS 7.0
PHP Version 5.4.16
a manual batchfile to run the cronjob.php exists

Thanks!!
hwk06

Localhost when calling crontab.php from CLI

I'm calling crontab.php from crontab or command line. Doing this results in missing server information in the sender and the subject of the notices sent by the script. Furthermore the links contain "localhost" and do not work on behalf of this.

To my mind there are two problems that lead to this situation.

  • Calling a php script via CLI the variable $_SERVER('SERVER_NAME') does generally not contain the server name.
  • Even if the server name would be set the called function OCP\Util::linkToAbsolute() which itself calls OC_Request:serverHost() will only use the localhost because of lines 28-30 in request.php.

As an unprofessional workaround for the first problem I added "putenv("SERVER_NAME=[NAME_OF_THE_SERVER]");" to crontab.php. Now the sender and subject of the email were correct even if the script is called via CLI.

To my mind there is no solution to the second problem except for changing OC:request.php which is not in the scope of this app or using a different strategy to create the link.

beebodo

Syntax error in 'mailing.php'

Hi,
because I havent programmes ever a project in PHP, I have only a tip to a potential error.
See 'mailing-php' vom branch '3.0.0 ' line 116+120

                                \OCP\Util::writeLog('mailnotify', "A problem occurs while sending the e-mail to $toUid at __LINE__", \OCP\Util::WARN);
                                return false;                        
                        }        
                }else{
                        \OCP\Util::writeLog('mailnotify', "email adress not found for $toUid at __LINE__", \OCP\Util::WARN);
                 }

new suggestion

                                \OCP\Util::writeLog('mailnotify', 'A problem occurs while sending the e-mail to $toUid at '.__LINE__.'', \OCP\Util::WARN);
                                return false;                        
                        }        
                }else{
                        \OCP\Util::writeLog('mailnotify', 'email adress not found for $toUid at '.__LINE__.'', \OCP\Util::WARN);
                 }

I think the writeLog content ist wrong quoted: Doeblequotes instead of single quoted and missing "." (dot) at "line"

Eugen

Bad links in notify e-mail for shared folders

System is a CentOS 6.5 VM,

owncloud was installed from the packages available at the isv:ownCloud:community repo
owncloud.noarch 6.0.4-8.1 @isv_ownCloud_community
owncloud-3rdparty.noarch 6.0.4-8.1 @isv_ownCloud_community

Linux owncloud.moberg 2.6.32-431.5.1.el6.x86_64 #1 SMP Wed Feb 12 00:41:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

MailNotify app reports as being 3.0.0-RC2 in the 'Apps' screen in Owncloud.

Reproduction:
Create two users: user1 & user2
user1 creates a folder and shares it with user2
user1 marks the folder for notification.
user2 uploads a file to the shared folder
user1 gets the notification e-mail, BUT the link inside it is completely useless.

For a folder named 'Ginos' shared by mhkohne to another user, this is the message mhkohne gets when the other user uploads something:

Hi, mhkohne,

    Following files have been modified.

  • Ginos
  • This e-mail is automatic, please, do not reply to it.

    From my quick perusal of the code, it looks like at least part of the problem is that the 'linkTo' isn't returning a sensible value. Since I have good reason to believe that works otherwise, I'm guessing that cronjob.php isn't quite getting the environment setup correctly before it calls do_notification_queue.

Disabling notification for partent folder not working ?

Hello and thank you very much for the ongoing development of this great app.
I tried out the latest release (3.0.0) this morning and was very happy to see that all bugs I experienced with the release before have gone.
Unfortunately it seems that it's no longer possible do disable notifications for parent folders. I wish to disable the notification for a folder and if new files will be uploaded to this folder no notification will be send out. With the release 3 RC2 this worked out for me.
Kind regards and thank you in advance,

Tyler

incoming contribution block.

Hi, im gonna put time on this plugin this week and the next, Do you guys still wish to maintain ownership on it ?

Plugin does not work

Hello!
I install Mailnotify 3.0.0-RC2
When I add new file to my shared folder, cron tries to send email message.
And I see in log:
{"app":"mail","message":"Invalid address: Mail_Notification@","level":3,"time":"2013-11-15T16:16:01+06:00"}
{"app":"PHP","message":"Invalid address: Mail_Notification@ at /usr/share/php/PHPMailer /class.phpmailer.php#664","level":4,"time":"2013-11-15T16:16:01+06:0"}
My E-mail field contain valid e-mail address.
OwnCloud version 5.0.13
PHPMailer I update from GoogleCode to 5.2.4, but the problem remains.(Older version, 5.2.1, gave out the same error on the line 498)
Reports of recovery of the password are sent normally.
What am I doing wrong?

Last update doesn't work

After installing the actual update (2013/07/25) of MailNotify 2.0.1 no notification is generated - at least in the standard scenario (Upload in shared top folder).

To solve this, I changed two things in mailing.php:

  • Removed two "!" (negations) in "!self::db_user_disabled_notify"
    (at function db_notify_group_members, lines 352 and 355 of mailing.php)
    (I recommended this also in my last issue)
  • Changed line 443 (function db_get_group_by_path) of mailing.php to
    return $splits[count($splits)-2];

With the changes documents above it now works fine no matter if documents are placed in a top folder or a subfolder of a share and no matter if the share is a full OC path or a subpath. ;-)

But it seems that it doesn't work if I call the script via the cronjob.php:
"sudo /usr/bin/php5 /var/www/owncloud/apps/mailnotify/lib/cronjob.php" ;-(

beebodo

Not working with ownCloud 5.0.9 (and prior?) - Solution

After activating MailNotify on 5.0.9 I could not change the status of a shared folder. The behaviour was like described below.

  • Shared folders are always taken as enabled, green envelope is always shown on shared folders
  • MailNotify is not able to enable oder disable shared folders and add entries to the settings database

To my mind this is an error in mailing.php.
In function "db_is_disabled_for_group" the check for the returned number of entries in the result set is not correct.

Actual: ... if($count >= 1){ ...
Should be: ... if($count == 0){ ...

After changing the code, the behaviour is as expected.

beebodo

Problems in MailNotify 2.0.1

Even after updating to 2.0.1. the notification email is not reliably sent the way I expect it to be sent.
To my mind there is some more work to be done in mainling.php to make it run:

public static function db_user_disabled_notify($uid, $gid){
[...]

// $query=OC_DB::prepare('SELECT * FROM *PREFIX*mn_usersettings WHERE uid = ? AND group LIKE ? AND value=2');
// The result seems always to be empty as I cannot find any place where '2' is stored in the table.
// Accordingly to this no email will be sent if function below is corrected.
$query=OC_DB::prepare('SELECT * FROM *PREFIX*mn_usersettings WHERE uid = ? AND group LIKE ? AND value=1');
[...]
}

public static function db_notify_group_members(){
[...]   
            foreach($users as $user){
                    //$uid = OCP\User::getUser();   

// if($sent_to_owner == false and !self::db_user_disabled_notify($user['uid_owner'], $folder)){
// if function above (db_user_disabled_notify) is corrected no negation is required
if($sent_to_owner == false and self::db_user_disabled_notify($user['uid_owner'], $folder)){
$mail = self::db_get_mail_by_user($user['uid_owner']);
self::email($mail,$count,$str_filenames,$folder,$user['uid_owner']);
$sent_to_owner = true;
}
$mail = self::db_get_mail_by_user($user['share_with']);
// if($mail != '' and !self::db_user_disabled_notify($user['share_with'], $folder)){
// if function above (db_user_disabled_notify) is corrected no negation is required
if($mail != '' and self::db_user_disabled_notify($user['share_with'], $folder)){
self::email($mail,$count,$str_filenames,$folder,$user['uid_owner']);
}
}
[...]
}

After doing these changes a user can reliably bookmark a shared folder and get informed about changes in this folder.

Unfortunately it doesn't work well on files in subfolders of shared folders.
For example:
If you have a folder structure like /Folder/Folder1/Folder2/Folder3 and Folder2 is shared with a user, the notification for Files in Folder3 doesn't work.
I think at this point a different strategy has to be implemented.

The good thing of the update:
Selecting and deselecting folders for notfification works as expected now. ;-)

beebodo

fail to install mailnotify

If i try to install it with the ownloud's installer it fail.

the log say:
{"app":"PHP","message":"copy(http://apps.owncloud.com/CONTENT/content-files/155982-mailnotify-master (2).zip): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found\r\n at /srv/data/web/vhosts/www.cesa.0464.ca/htdocs/oc/lib/installer.php#71","level":2,"time":1375388958}

its PROBABLY the space and () brackets in the file name from apps.owncloud.com. They d'ont seem to be not escaped by php.

rename the repo

the repo Owncloud-MailNotify shoud be renamed mailnotify
this broke the app.

mail notify apps not working in 5.0.9

i have installed owncloud 5.0.9 on debian wheezy. owncloud is working fine. sharing is also working perfectly fine. I have installed mail notify apps after downloading from GIThub. Apps is enabled and no error found. But when user is sharing the file, other user is not getting any mail. Even green mail icon is also not seen in tab of file.

Authentification failure

Hello,

I installed you app today and when I try to access to a folder owncloud says me : "authentification failure". If I disable you app owncloud work normally again.

I'm using Owncloud 6.0.3.

Some screenshots:
• Auth fail : https://dl.dropboxusercontent.com/u/55550180/Mailnotify/Atuh_fail.PNG
• Log: https://dl.dropboxusercontent.com/u/55550180/Mailnotify/Log.PNG

Could you do something please? It's really urgent :/

Thanks.

Cordially, Venopsis.

EDIT: I forgot to say I use the Mailnotify 3.0.0 RC2. I try with the previous version but nothing works. Always the same error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.