LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-16-2014, 09:06 AM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
how to get "lp -m" to send email as documented


Can someone help me configure so that the command lp -m {filename} will send email once the print job gets completed?

Once I have this working, I want to discover how to alter defaults to do this for all print jobs both command line and GUI generated.

The command lp is part of the CUPS suite. According to the man-page:
Code:
NAME
       lp - print files

...
DESCRIPTION
       lp  submits files for printing or alters a pending job. Use a filename of "-" to
       force printing from the standard input.

OPTIONS
...
       -m
            Sends an email when the job is completed.
...
When I use lp -m {filename}, I get the printed output, but I do not get email.

Thanks,
~~~ 0;-/ Dan
 
Old 09-16-2014, 10:35 AM   #2
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Follow-Up

I found a v_e_r_y b_r_i_e_f item buried (from my perspective) on the CUPS web site.
Code:
mailto.conf

    The /etc/cups/mailto.conf file contains several directives that defines the local mail server and email notification preferences for CUPS. Each directive is listed on a line by itself followed by its value. Comments are introduced using the number sign ("#") character at the beginning of a line.
Sure enough, I found man mailto.conf on my workstation.
Code:
mailto.conf(5)                         Apple Inc.                        mailto.conf(5)

NAME
       mailto.conf - configuration file for cups email notifier

DESCRIPTION
       The  mailto.conf file defines the local mail server and email notification pref‐
       erences for CUPS.

       Each line in the file can be a configuration directive, a blank line, or a  com‐
       ment. Comment lines start with the # character.

DIRECTIVES
       Sendmail sendmail command and options
            Specifies  the  sendmail  command  to use when sending email notifications.
            Only one Sendmail or SMTPServer line may  be  present  in  the  mailto.conf
            file. If multiple lines are present, only the last one is used.

       SMTPServer servername
            Specifies  a  SMTP server to send email notifications to. Only one Sendmail
            or SMTPServer line may be present in  the  mailto.conf  file.  If  multiple
            lines are present, only the last one is used.

       Cc cc-address@domain.com
            Specifies an additional recipient for all email notifications.

       From from-address@domain.com
            Specifies the sender of email notifications.

       Subject subject-prefix
            Specifies a prefix string for the subject line of an email notification.

...
Thus it seems:
  • If I want to use on-workstation mail, I need to add Sendmail to available services.
  • Otherwise, I can direct outbound email to any SMTP server where I'm permitted access.
Have I missed anything?
~~~ 0;-Dan

Last edited by SaintDanBert; 09-16-2014 at 11:20 AM.
 
Old 09-16-2014, 11:20 AM   #3
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
More Follow-Up

So I need some software to provide at least send-only email from my workstation before I can enable email notification of print job completion. It seems that I have the choices of sendmail, exim, and qmail.

As I look at installation and configuration of these, it seems that my workstation requires a fully qualified domain name. That would be something like:
Code:
someHost.someDomain
Since my workstation(s) is on a private network (192.168.nnn.nnn), I don't have a domain on my in-house LAN. If I need a "domain name", that tells me that I need to run some flavor of name server (DNS) on my LAN before I can enable CUPS email notifications.

Since private networks do not route, my private domain is just that -- private. Can I select any jibberish that makes sense to me when I name this private domain? Are there any conventions for such domain names?

Can someone confirm that I'm following the right bread crumbs here?

~~~ 0;-/ Dan

Last edited by SaintDanBert; 09-16-2014 at 11:23 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
seeking config "send email" when print job completed SaintDanBert Linux - Server 3 12-29-2013 11:41 AM
Bodhi 2.0.1 - "Run Everything" does not locate files as documented RHTopics Bodhi 2 08-21-2012 06:15 PM
evolution "breaks" send-to email addresses SaintDanBert Linux - Software 0 07-27-2010 04:56 PM
"Relay acces denied" when trying to send an email to the host (postfix) ellion0815 Linux - Server 10 03-14-2008 07:27 AM
How to have vsftpd ask for anon user to "send email for password"? dmurray8888 Linux - Software 0 04-27-2004 03:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration