LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to get "lp -m" to send email as documented (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-get-lp-m-to-send-email-as-documented-4175519038/)

SaintDanBert 09-16-2014 09:06 AM

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

SaintDanBert 09-16-2014 10:35 AM

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

SaintDanBert 09-16-2014 11:20 AM

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


All times are GMT -5. The time now is 03:14 AM.