Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No email notifications for printer classes #4733

Closed
michaelrsweet opened this issue Oct 23, 2015 · 4 comments
Closed

No email notifications for printer classes #4733

michaelrsweet opened this issue Oct 23, 2015 · 4 comments

Comments

@michaelrsweet
Copy link
Collaborator

Version: 2.1-current
CUPS.org User: twaugh.redhat

When using the "lp -m" option to get email notifications for jobs printed to classes, no notifications are sent.

The root cause is that the job subscription created as a result of the notify-recipient-uri IPP attribute sets the dest (in cupsdAddSubscription) to that of the class, whereas the event generated on job completion comes from the printer in the class.

RFC 3995 §5.3.3.5.2 seems to allow disregarding the printer involved in per-job subscriptions.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: twaugh.redhat

Attached: a git-format patch to ignore dest for job subscriptions.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

Instead of not setting the destination (which breaks IPP conformance), I've changed the cupsdAddEvent function to match either the destination or the job.

@michaelrsweet
Copy link
Collaborator Author

"0001-Don-t-store-dest-for-job-subscriptions-STR-4733.patch":

From a143c1f65265b2d33ef0b208be0d0173ef2ed129 Mon Sep 17 00:00:00 2001
From: Bryan Mason [email protected]
Date: Fri, 23 Oct 2015 15:28:11 +0100
Subject: [PATCH] Don't store dest for job subscriptions (STR #4733)

Signed-off-by: Tim Waugh [email protected]

scheduler/ipp.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/scheduler/ipp.c b/scheduler/ipp.c
index c0834c0..8538dac 100644
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
@@ -1927,6 +1927,7 @@ add_job_subscriptions(
ipp_attribute_t user_data; / notify-user-data /
int interval; /
notify-time-interval /
unsigned mask; /
notify-events */

  • cupsd_printer_t dest; / Job Destination */

/*
@@ -2080,8 +2081,14 @@ add_job_subscriptions(
if (mask == CUPSD_EVENT_NONE)
mask = CUPSD_EVENT_JOB_COMPLETED;

  • if ((sub = cupsdAddSubscription(mask, cupsdFindDest(job->dest), job,
  •                                recipient, 0)) != NULL)
    
  • if (mask & (CUPSD_EVENT_JOB_STATE_CHANGED |
  •            CUPSD_EVENT_JOB_CONFIG_CHANGED |
    
  •            CUPSD_EVENT_JOB_PROGRESS))
    
  •  dest = NULL;
    
  • else
  •  dest = cupsdFindDest(job->dest);
    
  • if ((sub = cupsdAddSubscription(mask, dest, job, recipient, 0)) != NULL)
    {
    sub->interval = interval;

2.4.3

@michaelrsweet
Copy link
Collaborator Author

"str4733.patch":

Index: scheduler/subscriptions.c

--- scheduler/subscriptions.c (revision 12973)
+++ scheduler/subscriptions.c (working copy)
@@ -105,9 +105,7 @@
* Check if this subscription requires this event...
*/

  • if ((sub->mask & event) != 0 &&
  •    (sub->dest == dest || !sub->dest) &&
    
  • (sub->job == job || !sub->job))
  • if ((sub->mask & event) != 0 && (sub->dest == dest || !sub->dest || sub->job == job))
    {
    /*
  • Need this event, so create a new event record...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant