The goal is to use Thunderbird on my server as a filter for my mails. So Thunderbird should always run in background after boot, without me logging in. I have this script below, which I want to put into rc.local. The problem is now that I do not have a display specified and I can not specify one, as I am logged in over ssh without X-forwarding.me@desktop ~ $ echo $DISPLAYme@desktop ~ $But I don't need to specify a display, as I do not plan to interact with the GUI anyway. I suspect however, that I have to specify one. Trying to start Thunderbird:#!/bin/bashsu - me -c /usr/bin/thunderbird &How can I get this working?
Run Thunderbird on boot without logging in
boot;thunderbird
You have two requirements that conflict with each other, so the short answer is that you can not achieve your goal with thunderbird without logging in.Using an interactive GUI client as a background server process to filter mail is not the best solution.  Thunderbird does not run without a display.  However, if your server logs you into a desktop environment after boot up, you can set thunderbird to start automatically.  The instructions for this will depend on which desktop you prefer, gnome/kde/etc.  Even so, I would not recommend this approach.Procmail (which your linux distribution might have installed by default) is designed for the purpose of filtering email and does not need a display.  You can find a tutorial, simple and straight forward here; http://www.panix.com/~elflord/unix/procmail.htmlExamples are provided for setting up the filter, integrating with your MTA, and creating rules to forward, file, or discard messages.In a nutshell, your MTA should understand .forward files in your $HOME directory.  This file holds a command to call procmail.  You will also need a ~/.procmail directory to hold the rules and configuration files procmail will use to perform it's duties.  And finally a ~/.procmailrc file to define some preferences, defaults, location of your filtering recipes, and your default mail directory.In your home directory, preparation goes like this...mkdir ~/.procmail; echo |IFS=' ' && exec /usr/bin/procmail || exit 75 #your_user_name >> ~/.forwardThe above assumes your procmail executable is located in /usr/bin.~/.procmailrc (contents copied from the panix.com link above)VERBOSE=offMAILDIR=$HOME/mail # elm users might use $HOME/Mail insteadPMDIR=$HOME/.procmailDEFAULT=/var/spool/mail/elflordLOGFILE=$PMDIR/logINCLUDERC=$PMDIR/general.rc# INCLUDERC=$PMDIR/other.rc# add as many INCLUDERC's as you like# end of .procmailrcActual filters...To file mail into a folder named bill for messages from Bill.:0* ^From.*bill@example\.combillTo save/keep messages in your inbox for users in your same domain.:0* ^From.*example\.com$DEFAULTTo separate your mailing list messages from your inbox, file to a folder called my-lists.* ^From.*my.*subscribed.*list.*@my-listsTo forward the message matching the filter to another address.* ^Subject.*something-or-other! another@address.comTo combine multiple actions to the same filter, the syntax does not change much.  This will keep a copy in your inbox and file into another folder.:0* ^Cc.*joe@somewhere.org* ^Cc.*me{    :0 c    $DEFAULT    :0    SOME_FOLDER}Considering this does not answer your specific question, how to get this working, it does provide an alternative solution to your underlying requirement, to filter email.