I access my email via the CLI. I don't need HTML and the like to make an email look pretty for me, I simply want to get to the email, read it, reply if necessary and carry on with my life. As such, I use mutt for all my email needs. So much so, that I use it to get my gmail emails too...
With some help from andre, I was able to set up two email accounts in mutt so that each email is sent via its own SMTP server - configured via a account-hook. Swicthing between them is a case of pressing <esc><1> or <esc><2> - allowing for more accounts to be assigned to other numbers.
Here's the example with one account for the domain example.com and another for gmail.com:
# clear any existing accounts account-hook . 'unset imap_user; unset imap_pass; unset tunnel' # home account setup account-hook imap://email@example.com/ 'set imap_user=username imap_pass="XXX"' folder-hook imap://firstname.lastname@example.org/ 'set folder=imap://email@example.com/ spoolfile=imap://firstname.lastname@example.org/INBOX from="username <email@example.com>" smtp_url="smtp://127.0.0.1/" record="=Sent"' # gmail account setup account-hook imaps://imap.gmail.com:993/ 'set imap_user=gmailuser imap_pass=XXX' folder-hook imaps://imap.gmail.com:993/ 'set folder=imaps://imap.gmail.com:993/ spoolfile=imaps://imap.gmail.com:993/INBOX from="gmailuser <firstname.lastname@example.org>" smtp_url="smtp://email@example.com:587/" smtp_pass="XXX" record="=[Gmail]/Sent Mail"' # set default account on startup set folder=imap://firstname.lastname@example.org/ set spoolfile=imap://email@example.com/INBOX # set mutt style and colors source ~/mutterings/style # macros to change profile macro index <esc>1 'c?c<kill-line>imap://firstname.lastname@example.org/<enter>/INBOX<enter><enter>' macro index <esc>2 'c?c<kill-line>imaps://imap.gmail.com:993/<enter>/INBOX<enter><enter>'
I have my stylesheet in a seperate file to keep ~/.muttrc detailing only account configurations, but this is a personal choice.
The Common UNIX Printing System (CUPS) has long been the standard of printing and print drivers for Linux. Having a PDF printer can be extremely useful - so here's how to set one up in Debian.
First, you have to install the CUPS PDF print driver
$ aptitude install cups-pdf
Next, we need to actually configure the printer itself for use. In CUPS this can be easily done via a URL and a browser of your choice (even a text based browser). Simply head over to http://localhost:631/ and in the following screen select the "Administration" option
Then select to "Add Printer"
How you configure the printer name and details is up to you and your setup, but it is easiest to simply use "PDF" as the printer name
Next select the "Virtual PDF Printer" as the device
For the make and manufacturer of printer select Generic
Finally, for the model select the "Generic CUPS-PDF Printer(en)" option
At this point you will now have a PDF printer. Some customisation is possible in the file /etc/cups/cups-pdf.conf - for example, the default location for creating PDF files is in a PDF directory in the user's home directory as identified by this entry:
Clearly you can adjust this to suit your needs. To demonstrate the post processing options available, uncomment the PostProcessing option and alter to read as follows
Edit the file /usr/local/bin/cups-pdf-renamer to look as follows:
1 2 3 4 5 6 7
#!/bin/bash FILENAME=`basename $1` DIRNAME=`dirname $1` DATE=`date +”%Y-%m-%d_%H:%M:%S”` mv $1 $DIRNAME”/”$DATE”.pdf”
Make sure the file is executable
$ chmod +x /usr/local/bin/cups-pdf-renamer
Essentially this will rename the file to a date and time stamp. Clearly you can alter this to suit your needs. This example was taken from here