Operating System - HP-UX
1748268 Members
3703 Online
108760 Solutions
New Discussion юеВ

Re: Using /etc/aliases to auto print email

 
Rick Knisely
Occasional Advisor

Using /etc/aliases to auto print email

I am using the following entry in /etc/aliases to automatically print every email that is sent to a specific userID:

:\, "| lp -d "

I cannot get it to print. What am I missing? I have restated sendmail after making any changes to aliases.
Don't Sweat the Small Stuff!
10 REPLIES 10
Jeff Schussele
Honored Contributor

Re: Using /etc/aliases to auto print email

Hi Rick,

There must be NO space between the -d & the printer_name - EX:

lp -dprinter1

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: Using /etc/aliases to auto print email

Oh & it may not know *where* the lp command is - so try

"|/usr/bin/lp -d"

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Rick Knisely
Occasional Advisor

Re: Using /etc/aliases to auto print email

I have modified the line to now read:

:\"

I get the email correctly in mailbox, but it still "will not" print.

Thanks!
Don't Sweat the Small Stuff!
Jeff Schussele
Honored Contributor

Re: Using /etc/aliases to auto print email

Did you rebuild the aliases DB with the
newaliases
or
sendmail -bi
commands?
Has to be done for *every* change to the aliases files.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Rick Knisely
Occasional Advisor

Re: Using /etc/aliases to auto print email

Yes, I have run sendmail -bi following each modification to /etc/aliases. Line reads as follows:

# Local aliases
:\,"/usr/bin/lp -d"

I get the mail in mail box and can even manually print using print command in elm or mail. But it will not print from aliases?

Any other thoughts?

Thanks for you help
Don't Sweat the Small Stuff!
Rick Knisely
Occasional Advisor

Re: Using /etc/aliases to auto print email

Yes, I have run sendmail -bi following each modification to /etc/aliases. Line reads as follows:

# Local aliases
:\,"|/usr/bin/lp -d"

I get the mail in mail box and can even manually print using print command in elm or mail. But it will not print from aliases?

Any other thoughts?

Thanks for you help
Don't Sweat the Small Stuff!
Jeff Schussele
Honored Contributor

Re: Using /etc/aliases to auto print email

Hi (again) Rick,

Well....I think you need whitespace in the line around the colon - try

username : \username,"|/usr/bin/lp -dprinter1"

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Rick Knisely
Occasional Advisor

Re: Using /etc/aliases to auto print email

The whitespace was added, and sendmail -bi run. It is still not printing email.
Don't Sweat the Small Stuff!
Jeff Schussele
Honored Contributor

Re: Using /etc/aliases to auto print email

OK, well it's time to punt then.
Set up a .forward file in that user's home dir & make sure the user owns it.

Then in it put what would be on the right side of the aliases file for that user & make sure you remove the user from the aliases file.

Then try.

BTW - Is there anything in the lp logs about these print jobs? Do they even make it to the spooler?

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!