https://wiki.archlinux.org/api.php?action=feedcontributions&user=Silenti620&feedformat=atomArchWiki - User contributions [en]2024-03-29T16:00:09ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=OfflineIMAP&diff=282821OfflineIMAP2013-11-14T13:57:18Z<p>Silenti620: /* systemd Service */ Added auto restart since offlineimap crashes on networking issues</p>
<hr />
<div>[[Category:Email Client]]<br />
{{Article summary start|Related}}<br />
{{Article summary wiki|isync}}<br />
{{Article summary wiki|notmuch}}<br />
{{Article summary wiki|msmtp}}<br />
{{Article summary end}}<br />
[http://offlineimap.org/ OfflineIMAP] is a Python utility to sync mail from IMAP servers. It does not work with the POP3 protocol or mbox, and is usually paired with a MUA such as [[Mutt]].<br />
==Installing==<br />
Install {{pkg|offlineimap}} from the [[official repositories]]<br />
<br />
==Configuring==<br />
Offlineimap is distributed with two default configuration files, which are both located in {{ic|/usr/share/offlineimap/}}. {{ic|offlineimap.conf}} contains every setting and is thorougly documented. Alternatively, {{ic|offlineimap.conf.minimal}} is not commented and only contains a small number of settings (see: [[#Minimal|Minimal]]).<br />
<br />
Copy one of the default configuration files to {{ic|~/.offlineimaprc}}.<br />
<br />
{{note|Writing a comment after an option/value on the same line is invalid syntax, hence take care that comments are placed on their own separate line.}}<br />
<br />
===Minimal===<br />
The following file is a commented version of {{ic|offlineimap.conf.minimal}}.<br />
{{hc|~/.offlineimaprc|2=<br />
<nowiki><br />
[general]<br />
# List of accounts to be synced, separated by a comma.<br />
accounts = main<br />
<br />
[Account main]<br />
# Identifier for the local repository; e.g. the maildir to be synced via IMAP.<br />
localrepository = main-local<br />
# Identifier for the remote repository; i.e. the actual IMAP, usually non-local.<br />
remoterepository = main-remote<br />
# Status cache. Default is plain, which eventually becomes huge and slow.<br />
status_backend = sqlite<br />
<br />
[Repository main-local]<br />
# Currently, offlineimap only supports maildir and IMAP for local repositories.<br />
type = Maildir<br />
# Where should the mail be placed?<br />
localfolders = ~/Maildir<br />
<br />
[Repository main-remote]<br />
# Remote repos can be IMAP or Gmail, the latter being a preconfigured IMAP.<br />
type = IMAP<br />
remotehost = host.domain.tld<br />
remoteuser = username<br />
</nowiki><br />
}}<br />
<br />
==Usage==<br />
Before running offlineimap, create any parent directories that were allocated to local repositories:<br />
$ mkdir ~/Maildir<br />
<br />
Now, run the program:<br />
$ offlineimap<br />
<br />
Mail accounts will now be synced. If anything goes wrong, take a closer look at the error messages. OfflineIMAP is usually very verbose about problems; partly because the developers didn't bother with taking away tracebacks from the final product.<br />
<br />
==Miscellaneous==<br />
''Various settings and improvements''<br />
<br />
===Running offlineimap in the background===<br />
Most other mail transfer agents assume that the user will be using the tool as a [[daemon]] by making the program sync periodically by default. In offlineimap, there are a few settings that control backgrounded tasks.<br />
<br />
Confusingly, they are spread thin all-over the configuration file:<br />
{{hc|~/.offlineimaprc|2=<br />
<nowiki><br />
# In the general section<br />
[general]<br />
# Controls how many accounts may be synced simultaneously<br />
maxsyncaccounts = 1<br />
<br />
# In the account identifier<br />
[Account main]<br />
# Minutes between syncs<br />
autorefresh = 5<br />
# Number of quick-syncs between autorefreshes. Quick-syncs do not update if the<br />
# only changes were to IMAP flags<br />
quick = 10<br />
<br />
# In the remote repository identifier<br />
[Repository main-remote]<br />
# Instead of closing the connection once a sync is complete, offlineimap will<br />
# send empty data to the server to hold the connection open. A value of 60<br />
# attempts to hold the connection for a minute between syncs (both quick and<br />
# autorefresh).This setting has no effect if autorefresh and holdconnectionopen<br />
# are not both set.<br />
keepalive = 60<br />
# OfflineIMAP normally closes IMAP server connections between refreshes if<br />
# the global option autorefresh is specified. If you wish it to keep the<br />
# connection open, set this to true. This setting has no effect if autorefresh<br />
is not set.<br />
holdconnectionopen = yes<br />
</nowiki><br />
}}<br />
<br />
====systemd Service====<br />
# Configure background jobs as shown in [[#Running offlineimap in the background]].<br />
# Writing a systemd service runnable as an user.<br />
{{hc|/etc/systemd/system/offlineimap@.service|2=<br />
<nowiki><br />
[Unit]<br />
Description=Start offlineimap as a daemon<br />
Requires=network.target<br />
After=network.target<br />
<br />
[Service]<br />
User=%i<br />
ExecStart=/usr/bin/offlineimap<br />
Restart=always<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki><br />
}}<br />
<br />
====cron job====<br />
1. Configure background jobs as shown in [[#Running offlineimap in the background]].<br />
<br />
2. Use a log-friendly user interface:<br />
{{hc|~/.offlineimaprc|2=<br />
<nowiki><br />
[general]<br />
# This will suppress anything but errors<br />
ui = quiet<br />
</nowiki><br />
}}<br />
<br />
3. Write a wrapper script for [[daemon]]izing programs, or use the one shown below:<br />
{{hc|/usr/local/bin/start_daemon|2=<br />
<nowiki><br />
#!/bin/sh<br />
<br />
set -efu<br />
<br />
ionice_class=<br />
ionice_priority=<br />
nice=<br />
<br />
while getopts c:p:n: f; do<br />
case $f in<br />
c) ionice_class=$OPTARG;;<br />
p) ionice_priority=$OPTARG;;<br />
n) nice=$OPTARG;;<br />
*) exit 2;;<br />
esac<br />
done<br />
shift $((OPTIND - 1))<br />
<br />
cmd=$*<br />
io=<br />
<br />
if pgrep -u "$(id -u)" -xf -- "$cmd" >/dev/null 2>&1; then<br />
exit 0<br />
fi<br />
<br />
if type ionice >/dev/null 2>&1; then<br />
[ -n "$ionice_class" ] && { io=1; cmd="-c $ionice_class $cmd"; }<br />
[ -n "$ionice_priority" ] && { io=1; cmd="-n $ionice_priority $cmd"; }<br />
[ -n "$io" ] && cmd="ionice $cmd"<br />
fi<br />
<br />
if type nice >/dev/null 2>&1; then<br />
[ -n "$nice" ] && cmd="nice -n $nice $cmd"<br />
fi<br />
<br />
exec $cmd<br />
</nowiki><br />
}}<br />
<br />
4. Finally, add a crontab entry:<br />
$ crontab -e<br />
The line should specify the interpreter for correct {{Ic|pgrep -xf}} results:<br />
*/5 * * * * exec /usr/local/bin/start_daemon -n19 -c2 -p7 python2 /usr/bin/offlineimap<br />
<br />
<span id="Sporadic_Crashes">The wrapper script is needed because offlineimap has the tendency to sporadically crash, even more so when facing connection problems.</span><br />
<br />
===Automatic mutt mailbox generation===<br />
[[Mutt]] cannot be simply pointed to an IMAP or maildir directory and be expected to guess which subdirectories happen to be the mailboxes, yet offlineimap can generate a muttrc fragment containing the mailboxes that it syncs.<br />
{{hc|~/.offlineimaprc|2=<br />
<nowiki><br />
[mbnames]<br />
enabled = yes<br />
filename = ~/.mutt/mailboxes<br />
header = "mailboxes "<br />
peritem = "+%(accountname)s/%(foldername)s"<br />
sep = " "<br />
footer = "\n"<br />
</nowiki><br />
}}<br />
<br />
Then add the following lines to {{ic|~/.mutt/muttrc}}.<br />
<br />
{{hc|~/.mutt/muttrc|2=<br />
<nowiki><br />
# IMAP: offlineimap<br />
set folder = "~/Mail"<br />
source ~/.mutt/mailboxes<br />
set spoolfile = "+account/INBOX"<br />
set record = "+account/Sent\ Items"<br />
set postponed = "+account/Drafts"<br />
</nowiki><br />
}}<br />
<br />
{{ic|account}} is the name you have given to your IMAP account in {{ic|~/.offlineimaprc}}.<br />
<br />
===Gmail configuration===<br />
This remote repository is configured specifically for Gmail support, substituting folder names in uppercase for lowercase, among other small additions. Keep in mind that this configuration does not sync the ''All Mail'' folder, since it is usually unnecessary and skipping it prevents bandwidth costs:<br />
<br />
{{hc|~/.offlineimaprc|2=<br />
<nowiki><br />
[Repository gmail-remote]<br />
type = Gmail<br />
remoteuser = user@gmail.com<br />
remotepass = password<br />
nametrans = lambda foldername: re.sub ('^\[gmail\]', 'bak',<br />
re.sub ('sent_mail', 'sent',<br />
re.sub ('starred', 'flagged',<br />
re.sub (' ', '_', foldername.lower()))))<br />
folderfilter = lambda foldername: foldername not in '[Gmail]/All Mail'<br />
# Necessary as of OfflineIMAP 6.5.4<br />
sslcacertfile = /etc/ssl/certs/ca-certificates.crt<br />
</nowiki><br />
}}<br />
<br />
{{Note|If you have Gmail set to another language, the folder names may appear translated too, e.g. "verzonden_berichten" instead of "sent_mail".}}<br />
<br />
{{Note|After version 6.3.5, offlineimap also creates remote folders to match your local ones. Thus you may need a nametrans rule for your local repository too that reverses the effects of this nametrans rule.}}<br />
<br />
{{Note|As of 1 October 2012 gmail SSL certificate fingerprint is not always the same. This prevents from using {{ic|cert_fingerprint}} and makes the {{ic|sslcacertfile}} way a better solution for the SSL verification (see [[OfflineIMAP#SSL fingerprint does not match]]).}}<br />
<br />
===Not having to enter the password all the time===<br />
====.netrc====<br />
Add the following lines to your {{ic|~/.netrc}}:<br />
<br />
machine hostname.tld<br />
login [your username]<br />
password [your password]<br />
<br />
Don't forget to give the file appropriate rights like 600 or 700:<br />
chmod 600 ~/.netrc<br />
<br />
====Gnome Keyring====<br />
http://www.clasohm.com/blog/one-entry?entry_id=90957 gives an example of how to use gnome-keyring to store the password. <br />
<br />
In the example, functions from a python file are imported in order to get passwords from gnome-keyring.<br />
<br />
Alternatively, if youre using {{AUR|gnome-keyring-query}}, you can use this simpler python file:<br />
<br />
#!/usb/bin/python<br />
# executes gnome-keyring-query get passwd<br />
# and returns the output<br />
<br />
import locale<br />
from subprocess import Popen, PIPE<br />
<br />
encoding = locale.getdefaultlocale()[1]<br />
<br />
def get_password(p):<br />
(out, err) = Popen(["gnome-keyring-query", "get", p], stdout=PIPE).communicate()<br />
return out.decode(encoding).strip()<br />
<br />
====python2-keyring====<br />
There's a general solution that should work for any keyring. Install [http://pypi.python.org/pypi/keyring python2-keyring] from [[AUR]], then change your ~/.offlineimaprc to say something like:<br />
<br />
{{bc|1=<br />
[general]<br />
pythonfile = /home/user/offlineimap.py<br />
…<br />
[Repository RemoteEmail]<br />
remoteuser = username@host.net<br />
remotepasseval = keyring.get_password("offlineimap","username@host.net")<br />
…<br />
}}<br />
<br />
and somewhere in ~/offlineimap.py add {{ic|import keyring}}. Now all you have to do is set your password, like so:<br />
<br />
{{bc|$ python2 <br />
>>> import keyring<br />
>>> keyring.set_password("offlineimap","username@host.net", "MYPASSWORD")}}<br />
<br />
and it'll grab the password from your (kwallet/gnome-) keyring instead of having to keep it in plaintext or enter it each time.<br />
<br />
====Emacs EasyPG====<br />
See http://www.emacswiki.org/emacs/OfflineIMAP#toc2<br />
<br />
===Kerberos authentication===<br />
Install python2-kerberos from [https://aur.archlinux.org/packages.php?ID=50639 AUR] and do not specify remotepass in your .offlineimaprc. <br />
OfflineImap figure out the reset all if have a valid Kerberos TGT. <br />
If you have 'maxconnections', it will fail for some connection. Comment 'maxconnections' out will solve this problem.<br />
<br />
==Troubleshooting==<br />
<br />
===Overriding UI and autorefresh settings===<br />
For the sake of troubleshooting, it is sometimes convenient to launch offlineimap with a more verbose UI, no background syncs and perhaps even a debug level:<br />
$ offlineimap [ -o ] [ -d <debug_type> ] [ -u <ui> ]<br />
;-o<br />
:Disable autorefresh, keepalive, etc.<br />
<br />
;-d <debug_type><br />
:Where ''<debug_type>'' is one of {{Ic|imap}}, {{Ic|maildir}} or {{Ic|thread}}. Debugging imap and maildir are, by far, the most useful.<br />
<br />
;-u <ui><br />
:Where ''<ui>'' is one of {{Ic|CURSES.BLINKENLIGHTS}}, {{Ic|TTY.TTYUI}}, {{Ic|NONINTERACTIVE.BASIC}}, {{Ic|NONINTERACTIVE.QUIET}} or {{Ic|MACHINE.MACHINEUI}}. TTY.TTYUI is sufficient for debugging purposes.<br />
<br />
{{Note|More recent versions use the following for <ui>: {{Ic|blinkenlights}}, {{Ic|ttyui}}, {{Ic|basic}}, {{Ic|quiet}} or {{Ic|machineui}}.}}<br />
<br />
===netrc authentication===<br />
There are some bugs in the current {{Pkg|offlineimap}} which makes it impossible to read the authentication data from {{ic|~/.netrc}} if there are multiple Accounts per remote machine. ( see [http://comments.gmane.org/gmane.mail.imap.offlineimap.general/3024 Mail Archive ] ) But they are fixed in the GIT package {{AUR|offlineimap-git}} (note that is AUR package is flagged as out of date; see the current GitHub external link below).<br />
Using the package you can collect all passwords in {{ic|~/.netrc}}. And do not forget to set it's access rights:<br />
chmod 600 ~/.netrc<br />
An example netrc file would be<br />
{{hc|~/.netrc|<br />
machine mail.myhost.de<br />
login mr_smith<br />
password secret<br />
}}<br />
<br />
===Folder could not be created===<br />
In version 6.5.3, offlineimap gained the ability to create folders in the remote repository, as described [http://comments.gmane.org/gmane.mail.imap.offlineimap.general/4784 here].<br />
<br />
This can lead to errors of the following form when using {{Ic|nametrans}} on the remote repository:<br />
ERROR: Creating folder bar on repository foo-remote<br />
Folder 'bar'[foo-remote] could not be created. Server responded: ('NO', ['[ALREADYEXISTS] Duplicate folder name bar (Failure)'])<br />
<br />
The solution is to provide an inverse {{Ic|nametrans}} lambda for the local repository, e.g.<br />
{{hc|~/.offlineimaprc|2=<br />
<nowiki><br />
[Repository foo-local]<br />
nametrans = lambda foldername: foldername.replace('bar', 'BAR')<br />
<br />
[Repository foo-remote]<br />
nametrans = lambda foldername: foldername.replace('BAR', 'bar')<br />
</nowiki><br />
}}<br />
<br />
* For working out the correct inverse mapping. the output of {{Ic|offlineimap --info}} should help.<br />
* After updating the mapping, it may be necessary to remove all of the folders under {{Ic|$HOME/.offlineimap/}} for the affected accounts.<br />
<br />
===SSL fingerprint does not match===<br />
ERROR: Server SSL fingerprint 'keykeykey' for hostname 'example.com' does not match configured fingerprint. Please verify and set 'cert_fingerprint' accordingly if not set yet.<br />
<br />
To solve this, add to {{ic|~/.offlineimaprc}} (in the same section as {{ic|1=ssl = yes}}) one of the following:<br />
* either add {{ic|cert_fingerprint}}, with the certificate fingerprint of the remote server. This checks whether the remote server certificate matches the given fingerprint.<br />
cert_fingerprint = keykeykey<br />
* or add {{ic|sslcacertfile}} with the path to the system CA certificates file. Needs {{Pkg|ca-certificates}} installed. This validates the remote ssl certificate chain against the Certification Authorities in that file.<br />
sslcacertfile = /etc/ssl/certs/ca-certificates.crt<br />
<br />
==External links==<br />
* [http://lists.alioth.debian.org/mailman/listinfo/offlineimap-project Official OfflineIMAP mailing list]<br />
* [http://roland.entierement.nu/blog/2010/09/08/gnus-dovecot-offlineimap-search-a-howto.html Gnus, Dovecot, OfflineIMAP, search: a HOWTO]<br />
** This setup worked for me, only difference being I had to add {{ic|1=mail_location = maildir:~/Maildir}} to {{ic|/etc/dovecot/dovecot.conf}}. Also, I used the [[OfflineIMAP#Gmail_configuration|Gmail configuration above]]. --[[User:Unhammer|Unhammer]] 09:24, 22 October 2010 (EDT)<br />
* [http://pbrisbin.com/posts/mutt_gmail_offlineimap/ Mutt + Gmail + Offlineimap]<br />
** An outline of brisbin's simple gmail/mutt setup using cron to keep offlineimap syncing.<br />
* [https://github.com/OfflineIMAP/offlineimap Current OfflineIMAP maintainer's fork on GitHub]<br />
** Note that a strict build of this on current Arch will fail due to python references unless they are replaced with python2</div>Silenti620https://wiki.archlinux.org/index.php?title=Steam&diff=248918Steam2013-03-02T17:30:12Z<p>Silenti620: /* Space Pirates and Zombies */</p>
<hr />
<div>[[Category:Gaming]]<br />
[[Category:Wine]]<br />
[[ja:Steam]]<br />
[[zh-CN:Steam]]<br />
{{Article summary start}}<br />
{{Article summary text|[http://store.steampowered.com/about/ Steam] is a content delivery system made by Valve Software. It is best known as the platform needed to play Source Engine games (e.g. Half-Life 2, Counter-Strike). Today it offers many games from many other developers.}}<br />
<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Wine}}<br />
{{Article summary end}}<br />
<br />
See the [[Wikipedia:Steam (software)|Steam Wikipedia page]] and the page in the [http://appdb.winehq.org/objectManager.php?sClass=version&iId=19444 Wine Application Database] for more info.<br />
<br />
== Native Steam on Linux ==<br />
<br />
{{Note|Arch Linux is not [https://support.steampowered.com/kb_article.php?ref&#61;1504-QHXN-8366 officially supported].}}<br />
<br />
{{Note|If you have a pure 64-bit installation, you will need to enable the [[multilib]] repository in pacman. This is because the Steam client is a 32-bit application. It may also make sense to install multilib-devel to provide some important multilib libraries. You also most likely need to install the 32-bit version of your graphics driver to run Steam.}}<br />
<br />
Install {{Pkg|steam}} from the [[multilib]] repository.<br />
<br />
Steam makes heavy usage of the Arial font. A decent Arial font to use is {{Pkg|ttf-liberation}} or the official Microsoft Arial fonts: {{aur|ttf-microsoft-arial}} or {{aur|ttf-ms-fonts}} packages from the [[AUR]]. Asian languages require {{Pkg|wqy-zenhei}} to display properly.<br />
<br />
Steam is '''not supported''' on this distribution. As such some fixes are needed on the users part to get things functioning properly. Several games have dependencies which may be missing from your system. If a game fails to launch (often without error messages) then make sure all of the libraries listed below that game are installed. Please install {{Pkg|libtxc_dxtn}} and {{Pkg|lib32-libtxc_dxtn}} as almost all games require it.<br />
<br />
===General troubleshooting===<br />
{{Note|In addition to being documented here, any bug/fix/error should be, if not already, reported on Valve's bug tracker on their [https://github.com/ValveSoftware/steam-for-linux GitHub page].}}<br />
<br />
{{Note|Connection problems may occur when using DD-WRT with peer-to-peer traffic filtering.}}<br />
<br />
====GUI problems with KDE====<br />
: Valve GitHub [https://github.com/ValveSoftware/steam-for-linux/issues/594 issue 594]<br />
<br />
If you are using KDE and you have problems with the GUI (such as lag or random crashes) modify the compositing type to OpenGL/Raster. In KDE system settings, go to "Desktop Effects" in the "Workspace Appearance and Behaviour" section. Open the "Advanced" tab. Change "Compositing type" from XRender to OpenGL.<br />
<br />
====The close button only minimizes the window====<br />
: Valve GitHub [https://github.com/ValveSoftware/steam-for-linux/issues/1025 issue 1025]<br />
<br />
If you have your tray icon working you have the option of making the close button close to tray instead of minimize. To do this, set the environment variable {{ic|STEAM_FRAME_FORCE_CLOSE}} to {{ic|1}}. You can do this by launching Steam using the following command.<br />
$ STEAM_FRAME_FORCE_CLOSE=1 steam<br />
<br />
====Flash not working on 64-bit systems====<br />
: Steam Support [https://support.steampowered.com/kb_article.php?ref=1493-GHZB-7612 article]<br />
<br />
First ensure {{pkg|lib32-flashplugin}} is installed. It should be working at this point, if not create a local Steam flash plugin folder<br />
mkdir ~/.steam/bin32/plugins/<br />
and set a symbolic link to the global lib32 flash plugin file in your upper new folder<br />
ln -s /usr/lib32/mozilla/plugins/libflashplayer.so ~/.steam/bin32/plugins/<br />
<br />
====Text is corrupt or missing====<br />
The Steam Support [https://support.steampowered.com/kb_article.php?ref=1974-YFKL-4947 instructions] for Windows seem to work on Linux also: Simply download [https://support.steampowered.com/downloads/1974-YFKL-4947/SteamFonts.zip SteamFonts.zip] and install them (copying to ~/.fonts/ works at least).<br />
<br />
====Error on some games: S3TC support is missing====<br />
Install the following dependencies:<br />
* {{pkg|libtxc_dxtn}}<br />
* {{pkg|lib32-libtxc_dxtn}}<br />
<br />
====Black screen on (Valve?) games (but audio works)====<br />
Check the Steam stdout/stderr for Error lines, some quick dependencies for reference:<br />
* {{pkg|libgles}}<br />
* {{pkg|lib32-libgles}}<br />
* {{pkg|lib32-intel-dri}} (not confirmed as absolutely necessary)<br />
<br />
run steam from console via primusrun steam<br />
<br />
====SetLocale('en_US.UTF-8') fails at game startup====<br />
Edit /etc/locale.gen in your favourite editor and uncomment the line {{ic|en_US.UTF-8 UTF-8}}. Then run {{ic|locale-gen}} as root.<br />
<br />
=== Game-specific depencencies and troubleshooting ===<br />
{{Note|Steam installs library dependencies of a game to a library directory, but some are missing at the moment. Report bugs involving missing libraries on Valve's bug tracker on their [https://github.com/ValveSoftware/steam-for-linux GIT page] before adding workarounds here, and then provide a link to the bug so it can be removed as the issues are fixed. Libraries like {{pkg|glu}} and {{pkg|libtxc_dxtn}} are exceptions to this, as they are just part of the implementation of the open drivers.}}<br />
<br />
====Amnesia: The Dark Descent====<br />
=====Dependencies=====<br />
* {{pkg|lib32-freealut}}<br />
* {{pkg|lib32-glu}}<br />
* {{pkg|lib32-libxmu}}<br />
* {{pkg|lib32-sdl_ttf}}<br />
<br />
=====Troubleshooting=====<br />
======Segfault======<br />
If you are using open source drivers you will need {{pkg|lib32-libtxc_dxtn}} . See [http://www.frictionalgames.com/forum/thread-10924.html official forum] for details<br />
<br />
====And Yet It Moves====<br />
=====Dependencies=====<br />
* {{aur|lib32-libtheora}}<br />
* {{aur|lib32-libjpeg6}}<br />
* {{aur|lib32-libtiff4}}<br />
* {{pkg|lib32-libpng12}}<br />
<br />
=====Compatibility=====<br />
Game refuses to launch and following message can be observed on console<br />
readlink: extra operand ‘Yet’<br />
Try 'readlink --help' for more information.<br />
To fix this, open {{ic|~/.steam/root/SteamApps/common/And Yet It Moves/AndYetItMovesSteam.sh}} in text editor and replace line<br />
ayim_dir="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"<br />
with<br />
ayim_dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"<br />
<br />
====Bastion====<br />
=====Dependencies=====<br />
* {{pkg|lib32-libtxc_dxtn}}<br />
<br />
====Counter-Strike: Source====<br />
=====Troubleshooting=====<br />
======Game crashes upon joining======<br />
If the game is constantly crashing when trying to join a game and in {{ic|~/.steam/root/SteamApps/your@account/Counter Strike Source/hl2.sh}} you have {{ic|1=__GL_THREADED_OPTIMIZATIONS=1}}, try changing it to {{ic|0}}.<br />
<br />
====Crusader Kings II====<br />
Game is installed into {{ic|$HOME/Steam/SteamApps/common/Crusader Kings II}}.<br />
<br />
Game can be started directly, without need of running Steam on background, using command {{ic|$HOME/Steam/SteamApps/common/Crusader Kings II/ck2}}.<br />
<br />
Saves are stored in {{ic|$HOME/Steam/SteamApps/common/Crusader Kings II/save games/}}.<br />
<br />
=====Troubleshooting=====<br />
======No audio======<br />
<br />
The default audio driver used by Crusader Kings 2 is for [[PulseAudio]], so an override is necessary:<br />
<br />
{{hc|~/.pam_environment|2=SDL_AUDIODRIVER=alsa}}<br />
<br />
====Dwarfs F2P====<br />
=====Dependencies=====<br />
* {{pkg|lib32-libgdiplus}}<br />
<br />
=====Troubleshooting=====<br />
======Game does not start======<br />
There was a bug that stopped Steam from fetching all the needed files. It should be resolved, if you still bump into this problem, try verifying integrity of game cache from game properties, local files tab.<br />
<br />
====FTL: Faster than Light====<br />
=====Dependencies=====<br />
Libraries are downloaded and and placed in the game's data directory for both architectures. As long as you run FTL by the launcher script (or via the shortcut in Steam) you should not need to download any further libraries.<br />
<br />
=====Compatibility=====<br />
After installation, FTL may fail to run due to a 'Text file busy' error (characterised in Steam by your portrait border going green then blue again). The easiest way to mend this is to just reboot your system. Upon logging back in FTL should run.<br />
<br />
The Steam overlay in FTL does not function as it is not a 3D accelerated game. Because of this the desktop notifications will be visible. If playing in fullscreen, therefore, these notifications in some systems may steal focus and revert you back to windowed mode with no way of going back to fullscreen without relaunching. The binaries for FTL on Steam have no DRM and it is possible to run the game ''without'' Steam running, so in some cases that may be optimum - just ensure that you launch FTL via the launcher script in {{ic|~/.steam/root/SteamApps/common/FTL Faster than Light/data/}} rather than the FTL binary in the $arch directory.<br />
<br />
=====Problems with open-source video driver=====<br />
FTL may fail to run if you are using an opensource driver for your video card. There are two solutions: install a proprietary video driver or delete (rename if you are unsure) the library "libstdc++.so.6" inside {{ic|~/.steam/root/SteamApps/common/FTL\ Faster\ Than\ Light/data/amd64/lib}} This is if you are using a 64bit system, I suppose that in case you are using a 32bit system you have to remove (rename) the same library located into {{ic|~/.steam/root/SteamApps/common/FTL\ Faster\ Than\ Light/data/x86/lib}}.<br />
<br />
====Harvest: Massive Encounter====<br />
=====Dependencies=====<br />
* {{pkg|lib32-gtk2}}<br />
* {{pkg|lib32-libvorbis}}<br />
* {{aur|lib32-nvidia-cg-toolkit}}<br />
* {{aur|lib32-libjpeg6}}<br />
<br />
=====Compatibility=====<br />
Game refuses to launch and throws you to library installer loop. Just edit {{ic| ~/.steam/root/SteamApps/common/Harvest Massive Encounter/run_harvest}} and remove everything but<br />
#!/bin/bash<br />
INSTDIR="`dirname "$0"`" ; cd "${INSTDIR}" ; INSTDIR="`pwd`"<br />
export LD_LIBRARY_PATH=${INSTDIR}/bin:~/.steam/bin<br />
exec ./Harvest<br />
<br />
====Killing Floor====<br />
=====Troubleshooting=====<br />
======Screen resolution======<br />
Killing Floor runs pretty much from scratch, although you might have to change in-game resolution screen as the default one is '''800x600''' and a '''4:3''' screen format.<br />
If you try to modify screen resolution in-game, it might crash your desktop enviroment.<br />
To fix this, please set the desired resolution screen size by modifing your {{ic|~/.killingfloor/System/KillingFloor.ini}} with your prefered editor.<br />
{{hc|# nano ~/.killingfloor/System/KillingFloor.ini|<nowiki><br />
...<br />
<br />
[WinDrv.WindowsClient]<br />
WindowedViewportX=????<br />
WindowedViewportY=????<br />
FullscreenViewportX=????<br />
FullscreenViewportY=????<br />
MenuViewportX=???<br />
MenuViewportY=???<br />
<br />
...<br />
<br />
[SDLDrv.SDLClient]<br />
WindowedViewportX=????<br />
WindowedViewportY=????<br />
FullscreenViewportX=????<br />
FullscreenViewportY=????<br />
MenuViewportX=????<br />
MenuViewportY=????<br />
<br />
...<br />
</nowiki>}}<br />
{{Note|Replace all the '''????''' with the corresponding numbers according the desired resolution. If you have an 1366x768 screen and want to use it at it's fullest, change all the Viewport fields to something like '''ViewportX&#61;1366''' and '''ViewportY&#61;768''' in the corresponding areas.}}<br />
{{Note| The dots in the middle indicate that there are more fields in that .ini file. But for screen resolution troubleshooting, you do not need to modify anything else.}}<br />
<br />
Save the file and restart the game, it should work now.<br />
<br />
======Windowed Mode======<br />
Uncheck fullscreen in the options menu, and use {{Keypress|Ctrl+g}} to stop mouse capturing (that was non-obvious to discover..). This way you can easily minimize it and do other other things..and let your WM handle things.<br />
<br />
====Multiwinia====<br />
=====Dependencies=====<br />
* {{pkg|lib32-openal}}<br />
<br />
Game will not launch without {{pkg|lib32-openal}}.<br />
<br />
====Penumbra: Overture====<br />
=====Dependencies=====<br />
(Taken from {{aur|penumbra-collection}} and {{aur|penumbra-overture-ep1-demo}})<br />
* {{pkg|lib32-glu}}<br />
* {{pkg|lib32-libxft}}<br />
* {{pkg|lib32-libvorbis}}<br />
* {{pkg|lib32-openal}}<br />
* {{pkg|lib32-sdl_ttf}}<br />
* {{pkg|lib32-sdl_image}}<br />
<br />
=====Troubleshooting=====<br />
======Windowed Mode======<br />
There is no in-game option to change to the windowed mode, you will have to edit {{ic|~/.frictionalgames/Penumbra/Overture/settings.cfg}} to activate it.<br />
Find {{ic|FullScreen&#61;"true"}} and change it to {{ic|FullScreen&#61;"false"}}, after this the game should start in windowed mode.<br />
<br />
====Psychonauts====<br />
=====Dependencies=====<br />
* {{pkg|libtxc_dxtn}} and {{pkg|lib32-libtxc_dxtn}}<br />
<br />
====Revenge of the Titans====<br />
=====Dependencies=====<br />
* {{pkg|libxtst}} and {{pkg|lib32-libxtst}}<br />
<br />
====Serious Sam 3: BFE====<br />
=====Dependencies=====<br />
* {{pkg|lib32-libtxc_dxtn}}<br />
<br />
=====Troubleshooting=====<br />
======No audio======<br />
Try running:<br />
# pacman -S lib32-alsa-plugins<br />
# mkdir -p /usr/lib/i386-linux-gnu/alsa-lib/<br />
# ln -s /usr/lib32/alsa-lib/libasound_module_pcm_pulse.so /usr/lib/i386-linux-gnu/alsa-lib/<br />
<br />
If that does not work, try tweaking ~/.alsoftrc as proposed by the [http://steamcommunity.com/app/221410/discussions/3/846940248238406974/ Steam community] (Serious Sam 3: BFE uses OpenAL to output sound). If you are not using Pulse Audio, you may want to write the following configuration:<br />
<br />
{{hc|$ nano ~/.alsoftrc|<nowiki><br />
[general]<br />
drivers = alsa<br />
[alsa]<br />
device = default<br />
capture = default<br />
mmap = true<br />
</nowiki>}}<br />
<br />
====Spacechem====<br />
=====Dependencies=====<br />
* {{pkg|lib32-sqlite}}<br />
* {{pkg|lib32-sdl_image}}<br />
* {{aur|lib32-sdl_mixer}}<br />
<br />
=====Troubleshooting=====<br />
======Game crash======<br />
The shipped x86 version of Spacechem does not work on x64 with the game's own libSDL* files, and crashes with some strange output.<br />
<br />
To solve this just remove or move the three files {{ic|libSDL-1.2.so.0}}, {{ic|libSDL_image-1.2.so.0}}, {{ic|libSDL_mixer-1.2.so.0}} from {{ic|~/.steam/root/SteamApps/common/SpaceChem}}<br />
<br />
====Space Pirates and Zombies====<br />
=====Dependencies=====<br />
* {{pkg|lib32-openal}}<br />
=====Troubleshooting=====<br />
======No audio======<br />
Apply the fix documented in Serious Sam 3: BFE above.<br />
<br />
====Splice====<br />
Splice comes with both x86 and x64 binaries. Steam does not have to be running to launch this game.<br />
=====Dependencies=====<br />
* {{pkg|glu}}<br />
* {{pkg|mono}}<br />
<br />
====Steel Storm: Burning Retribution====<br />
=====Troubleshooting=====<br />
======Start with black screen======<br />
The game tries to launch in 1024x768 resolution with fullscreen mode by default. It is impossible on some devices.<br />
(for example laptop Samsung Series9 with intel hd4000 video).<br />
<br />
You can launch the game in windowed mode. To do this open game Properties in Steam, in General tab select "Set launch options..." and type "-window".<br />
<br />
Now you can change the resolution in game.<br />
<br />
======No English fonts======<br />
If you use intel video card, just disable S3TC in DriConf.<br />
<br />
====Superbrothers: Sword & Sworcery EP====<br />
=====Dependencies=====<br />
* {{pkg|lib32-glu}}<br />
<br />
====Team Fortress 2 ====<br />
=====Dependencies=====<br />
* {{pkg|lib32-libtxc_dxtn}}<br />
<br />
=====Troubleshooting=====<br />
======No audio======<br />
It happens if there is no PulseAudio in your system.<br />
If you want to use [[ALSA]], you need to launch Steam or the game directly with {{ic|1=SDL_AUDIODRIVER=alsa}} <br />
(From [http://steamcommunity.com/app/221410/discussions/0/882966056462819091/#c882966056470753683 SteamCommunity]).<br />
<br />
If it still does not work, you may also need to set the environment variable AUDIODEV. For instance {{ic|1=AUDIODEV=Live}}. Use {{ic|aplay -l}} to list the available sound cards.<br />
<br />
====The Book of Unwritten Tales====<br />
If the game does not start, go to Properties --> Uncheck "Enable Steam Community In-Game".<br />
<br />
The game may segfault upon clicking the Setting menu and possibly during or before gameplay. This is a known issue and you will unfortunately have to wait for a fix from the developer.<br />
=====Dependencies=====<br />
* {{aur|lib32-libxaw}}<br />
* {{aur|lib32-jasper}}<br />
<br />
====The Clockwork Man====<br />
=====Dependencies=====<br />
* {{pkg|lib32-libidn}}<br />
<br />
====Trine 2====<br />
=====Dependencies=====<br />
* {{pkg|lib32-glu}}<br />
* {{pkg|lib32-libxxf86vm}}<br />
* {{pkg|lib32-libdrm}}<br />
* {{pkg|lib32-openal}}<br />
* {{pkg|xorg-xwininfo}}<br />
<br />
=====Troubleshooting=====<br />
* If colors are wrong with FOSS drivers (r600g at least), try to run the game in windowed mode, rendering will be corrected. ([https://bugs.freedesktop.org/show_bug.cgi?id=60553 bugreport])<br />
* If sound plays choppy, try to edit {{ic|/etc/openal/alsoft.conf}} with values<br />
<br />
drivers=pulse,alsa<br />
frequency=48000<br />
<br />
* If the game resolution is wrong when using a dual monitor setup and you can't see the whole window edit {{ic|~/.frozenbyte/Trine2/options.txt}} and change the options ForceFullscreenWidth and ForceFullscreenHeight to the resolution of your monitor on which you want to play the game.<br />
<br />
====Unity of Command====<br />
=====Dependencies=====<br />
* {{pkg|lib32-pango}}<br />
<br />
=====Troubleshooting=====<br />
* If squares are shown instead of text, try removing {{ic|$HOME/Steam/SteamApps/common/Unity of Command/bin/libpangoft2-1.0.so.0}}.<br />
<br />
====World of Goo====<br />
=====Changing Resolution=====<br />
* To change the game resolution edit the section "Graphics display" in the configuration file {{ic|$HOME/Steam/SteamApps/common/World of Goo/properties/config.txt}}. For example, see below:<br />
<!-- Graphics display --><br />
<param name="screen_width" value="1680" /><br />
<param name="screen_height" value="1050" /><br />
<param name="color_depth" value="0" /><br />
<param name="fullscreen" value="true" /><br />
<param name="ui_inset" value="10" /><br />
<br />
===Skins for Steam===<br />
<br />
The Steam interface can be fully customized by copying its various interface files in its skins directory and modifying them.<br />
<br />
====Steam Skin Manager====<br />
<br />
The process of applying a skin to Steam can be greatly simplified using {{aur|steam-skin-manager}} from the AUR. The package also comes with a hacked version of the Steam launcher which allows the window manager to draw its borders on the Steam window.<br />
<br />
As a result, skins for Steam will come in two flavors, one with and one without window buttons. The skin manager will prompt you whether you use the hacked version or not, and will automatically apply the theme corresponding to your GTK theme if it is found. You can of course still apply another skin if you want.<br />
<br />
The package ships with two themes for the default Ubuntu themes, Ambiance and Radiance. A Faience theme is under development and already has its own package on the AUR {{aur|steam-skin-faience-git}}.<br />
<br />
== Steam on Wine ==<br />
<br />
Install {{Pkg|wine}} from the official repositories and follow the instructions provided in the [[Wine|article]].<br />
<br />
Install the required Microsoft fonts {{AUR|ttf-microsoft-tahoma}} and {{AUR|ttf-ms-fonts}} from the [[AUR]] or through {{AUR|winetricks-svn}}.<br />
{{Note|If you have access to Windows discs, you may want to install {{AUR|ttf-win7-fonts}} instead.}}<br />
<br />
If you have an old Wine prefix ({{ic|~/.wine}}), you should remove it and let Wine create a new one to avoid problems (you can transfer over anything you want to keep to the new Wine prefix).<br />
<br />
===Installation===<br />
<br />
Download and run the Steam installer from [http://store.steampowered.com/about/ steampowered.com]. It is no longer an {{ic|.exe}} file so you have to start it with {{ic|msiexec}}: <br />
$ msiexec /i SteamInstall.msi<br />
<br />
===Starting Steam===<br />
<br />
On x86:<br />
$ wine ~/.wine/drive_c/Program\ Files/Steam/Steam.exe<br />
<br />
On x86_64 (with steam installed to a clean wine prefix):<br />
$ wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe<br />
<br />
Alternatively, you may use this method:<br />
<br />
$ wine "C:\\Program Files\\Steam\\steam.exe" <br />
<br />
You should consider making an alias to easily start steam (and put it in your shell's rc file), example:<br />
alias steam='wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe >/dev/null 2>&1 &'<br />
<br />
{{Note|If you are using an nvidia card through bumblebee, you should prefix those commands with {{ic|optirun}}.}}<br />
<br />
===Tips===<br />
<br />
====Performance====<br />
<br />
Consider disabling wine debugging output by adding this to your shell rc file:<br />
export WINEDEBUG=-all<br />
or, just add it to your steam alias to only disable it for steam:<br />
alias steam='WINEDEBUG=-all wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe >/dev/null 2>&1 &'<br />
Additionally, Source games rely on a paged pool memory size specification for audio, and WINE by default does not have this set. To set it:<br />
wine reg add "HKLM\\System\\CurrentControlSet\\Control\\Session Manager\\Memory Management\\" /v PagedPoolSize /t REG_DWORD /d 402653184 /f<br />
<br />
==== Application Launch Options ====<br />
Go to "Properties" -> "Set Launch Options", e.g.:<br />
{{bc|-console -dxlevel 90 -width 1280 -height 1024<br />
}}<br />
* {{ic|console}}<br />
Activate the console in the application to change detailed applications settings.<br />
* {{ic|dxlevel}}<br />
Set the application's DirectX level, e.g. 90 for DirectX Version 9.0. It is recommended to use the video card's DirectX version to prevent crashes. See the official Valve Software Wiki http://developer.valvesoftware.com/wiki/DirectX_Versions for details.<br />
* {{ic|width}} and {{ic|height}}<br />
Set the screen resolution. In some cases the graphic settings are not saved in the application and the applications always starts in the default resolution.<br />
Please refer to http://developer.valvesoftware.com/wiki/Launch_options for a complete list of launch options.<br />
<br />
==== Using a Pre-Existing Steam Install ====<br />
<br />
If you have a shared drive with Windows, or already have a Steam installation somewhere else, you can simply symlink the Steam directory to {{ic|~/.wine/drive_c/Program Files/Steam/}} . However, be sure to do '''all''' the previous steps in this wiki. Confirm Steam launches and logs into your account, ''then'' do this:<br />
<br />
cd ~/.wine/drive_c/Program\ Files/ <br />
mv Steam/ Steam.backup/ (or you can just delete the directory)<br />
ln -s /mnt/windows_partition/Program\ Files/Steam/<br />
<br />
{{Note|If you have trouble starting Steam after symlinking the entire Steam folder, try linking only the {{ic|steamapps}} subdirectory in your existing wine steam folder instead.}}<br />
<br />
{{Note|If you still have trouble starting games, use {{ic|sudo mount --bind /path/to/SteamApps ~/.local/share/Steam/SteamApps -ouser&#61;your-user-name }}, this is the only thing that worked for me with {{ic|TF2}}}}<br />
<br />
====Running Steam in a second X Server====<br />
<br />
Assuming you are using the script above to start Steam, make a new script, called {{ic|x.steam.sh}}. You should run this when you want to start Steam in a new X server, and {{ic|steam.sh}} if you want Steam to start in the current X server. <br />
<br />
If due to misconfiguration a black screen is shown, you could always close down the second X server by pressing {{Keypress|Ctrl}} + {{Keypress|Alt}} + {{Keypress|Backspace}}.<br />
<br />
{{bc|1=<br />
#!/bin/bash <br />
<br />
DISPLAY=:1.0<br />
<br />
xinit $HOME/steam.sh $* -- :1<br />
}}<br />
<br />
Now you can use {{Keypress|Ctrl}} + {{Keypress|Alt}} + {{Keypress|F7}} to get to your first X server with your normal desktop, and {{Keypress|Ctrl}} + {{Keypress|Alt}} + {{Keypress|F8}} to go back to your game. <br />
<br />
Because the second X server is ''only'' running the game and the first X server with all your programs is backgrounded, performance should increase. In addition, it is much more convenient to switch X servers while in game to access other resources, rather than having to exit the game completely or {{Keypress|Alt}}-{{Keypress|Tab}} out. Finally, it is useful for when Steam or WINE goes haywire and leaves a bunch of processes in memory after Steam crashes. Simply {{Keypress|Ctrl}} + {{Keypress|Alt}} + {{Keypress|Backspace}} on the second X server to kill that X and all processes on that desktop will terminate as well. <br />
<br />
'''If you get errors that look like "Xlib: connection to ":1.0" refused by server" when starting the second X''': You will need to adjust your X permissions.<br />
<br />
'''If you lose the ability to use the keyboard while using Steam''': This is an odd bug that does not happen with other games. A solution is to use a WM in the second X as well. Thankfully, you do not need to run a large WM. Openbox and icewm have been confirmed to fix this bug (evilwm, pekwm, lwm ''do not'' work), but the icewm taskbar shows up on the bottom of the game, thus it's recommended to use [[Openbox]]. Install {{Pkg|openbox}} from the [[official repositories]], then add {{Ic|openbox &}} to the top of your {{ic|steam.sh}} file. Note you can run other programs (ex. Teamspeak &) or set X settings (ex. xset, xmodmap) before the WINE call as well.<br />
<br />
====Steam Links in Firefox, Chrome, Etc====<br />
To make steam:// urls in your browser connect with steam in wine, there are several things you can do. One involves making steam url-handler keys in gconf, another involves making protocol files for kde, others involve tinkering with desktop files or the Local State file for chromium. These seem to only work in firefox or under certain desktop configurations. One way to do it that works more globally is using mimeo, a tool made by Xyne (an Arch TU) which follows. For another working and less invasive (but firefox-only) way, see the first post [http://ubuntuforums.org/showthread.php?t=433548 here] .<br />
<br />
* Make {{ic| /usr/bin/steam}} with your favorite editor and paste:<br />
<br />
{{bc|<br />
#!/bin/sh<br />
#<br />
# Steam wrapper script<br />
#<br />
exec wine "c:\\program files\\steam\\steam.exe" "$@"<br />
}}<br />
<br />
* Make it executable.<br />
<br />
# chmod +x /usr/bin/steam<br />
<br />
* Install {{AUR|mimeo}} and {{AUR|xdg-utils-mimeo}} from AUR. You will need to replace the existing {{pkg|xdg-utils}} if installed. In XFCE, you will also need {{pkg|xorg-utils}}.<br />
<br />
* Create {{ic|~/.config/mimeo.conf}} with your favorite editor and paste:<br />
<br />
{{bc|<br />
/usr/bin/steam %u<br />
^steam://<br />
}}<br />
<br />
* Lastly, open {{ic|/usr/bin/xdg-open}} in your favorite editor. Go to the {{ic|detectDE()}} section and change it to look as follows:<br />
<br />
{{bc|<nowiki><br />
detectDE()<br />
{<br />
#if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;<br />
#elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;<br />
#elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;<br />
#elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;<br />
#elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;<br />
#else DE=""<br />
#fi<br />
DE=""<br />
}<br />
</nowiki>}}<br />
<br />
* Restart the browser and you should be good to go. In chromium, you cannot enter a {{ic|steam://}} link in the url box like you can with firefox. The forum link above has a {{ic|steam://open/friends}} link to try if needed.<br />
<br />
{{Note|If you have any problems with file associations after doing this, simply revert to regular xdg-utils and undo your changes to {{ic|/usr/bin/xdg-open}}.}}<br />
{{Note|Those on other distributions that stumble upon this page, see the link above for firefox specific instructions. No easy way to get it working on Chromium on other distros exists.}}<br />
<br />
====No text rendered problem====<br />
If there is no text/font rendered when starting steam you should try to start steam with the parameter {{ic|-no-dwrite}}. Read more in [https://bbs.archlinux.org/viewtopic.php?id=146223 the forum thread about it.]<br />
{{bc|wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe -no-dwrite}}<br />
<br />
== See Also ==<br />
* https://wiki.gentoo.org/wiki/Steam</div>Silenti620https://wiki.archlinux.org/index.php?title=OfflineIMAP&diff=239741OfflineIMAP2012-12-10T10:12:11Z<p>Silenti620: /* systemd Service */ - If it can't resolve host names it exits, thus should start after networking.</p>
<hr />
<div>[[Category:Email Client]]<br />
[http://offlineimap.org/ OfflineIMAP] is an utility to sync mail from IMAP servers. It does not work with the POP3 protocol or mbox, and is usually paired with a MUA such as [[Mutt]].<br />
<br />
==Installing==<br />
Install the {{Pkg|offlineimap}} package with [[pacman]]:<br />
# pacman -S offlineimap<br />
<br />
==Configuring==<br />
Offlineimap is distributed with two default configuration files, which are both located in {{ic|/usr/share/offlineimap/}}. {{ic|offlineimap.conf}} contains every setting and is thorougly documented. Alternatively, {{ic|offlineimap.conf.minimal}} is not commented and only contains a small number of settings (see: [[#Minimal|Minimal]]).<br />
<br />
Copy one of the default configuration files to {{ic|~/.offlineimaprc}}.<br />
<br />
{{note|Writing a comment after an option/value on the same line is invalid syntax, hence take care that comments are placed on their own separate line.}}<br />
<br />
===Minimal===<br />
The following file is a commented version of {{ic|offlineimap.conf.minimal}}.<br />
{{hc|~/.offlineimaprc|2=<br />
<nowiki><br />
[general]<br />
# List of accounts to be synced, separated by a comma.<br />
accounts = main<br />
<br />
[Account main]<br />
# Identifier for the local repository; e.g. the maildir to be synced via IMAP.<br />
localrepository = main-local<br />
# Identifier for the remote repository; i.e. the actual IMAP, usually non-local.<br />
remoterepository = main-remote<br />
# Status cache. Default is plain, which eventually becomes huge and slow.<br />
status_backend = sqlite<br />
<br />
[Repository main-local]<br />
# Currently, offlineimap only supports maildir and IMAP for local repositories.<br />
type = Maildir<br />
# Where should the mail be placed?<br />
localfolders = ~/Maildir<br />
<br />
[Repository main-remote]<br />
# Remote repos can be IMAP or Gmail, the latter being a preconfigured IMAP.<br />
type = IMAP<br />
remotehost = host.domain.tld<br />
remoteuser = username<br />
</nowiki><br />
}}<br />
<br />
==Usage==<br />
Before running offlineimap, create any parent directories that were allocated to local repositories:<br />
$ mkdir ~/Maildir<br />
<br />
Now, run the program:<br />
$ offlineimap<br />
<br />
Mail accounts will now be synced. If anything goes wrong, take a closer look at the error messages. OfflineIMAP is usually very verbose about problems; partly because the developers didn't bother with taking away tracebacks from the final product.<br />
<br />
==Miscellaneous==<br />
''Various settings and improvements''<br />
<br />
===Running offlineimap in the background===<br />
Most other mail transfer agents assume that the user will be using the tool as a [[daemon]] by making the program sync periodically by default. In offlineimap, there are a few settings that control backgrounded tasks.<br />
<br />
Confusingly, they are spread thin all-over the configuration file:<br />
{{hc|~/.offlineimaprc|2=<br />
<nowiki><br />
# In the general section<br />
[general]<br />
# Controls how many accounts may be synced simultaneously<br />
maxsyncaccounts = 1<br />
<br />
# In the account identifier<br />
[Account main]<br />
# Minutes between syncs<br />
autorefresh = 5<br />
# Number of quick-syncs between autorefreshes. Quick-syncs do not update if the<br />
# only changes were to IMAP flags<br />
quick = 10<br />
<br />
# In the remote repository identifier<br />
[Repository main-remote]<br />
# Instead of closing the connection once a sync is complete, offlineimap will<br />
# send empty data to the server to hold the connection open. A value of 60<br />
# attempts to hold the connection for a minute between syncs (both quick and<br />
# autorefresh).This setting has no effect if autorefresh and holdconnectionopen<br />
# are not both set.<br />
keepalive = 60<br />
# OfflineIMAP normally closes IMAP server connections between refreshes if<br />
# the global option autorefresh is specified. If you wish it to keep the<br />
# connection open, set this to true. This setting has no effect if autorefresh<br />
is not set.<br />
holdconnectionopen = yes<br />
</nowiki><br />
}}<br />
<br />
====systemd Service====<br />
Writing a systemd service for offlineimap is trivial, just be sure to run it as the correct user by replacing the {{ic|User&#61;UserToRunAs}} with your user. (e.g. {{ic|User&#61;wgiokas}})<br />
{{hc|offlineimap-user.service|2=<br />
<nowiki><br />
[Unit]<br />
Description=Start offlineimap as a daemon<br />
Requires=network.target<br />
After=network.target<br />
<br />
[Service]<br />
User=UserToRunAs<br />
ExecStart=/usr/bin/offlineimap<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki><br />
}}<br />
<br />
====cron job====<br />
1. Configure background jobs as shown in [[#Running offlineimap in the background]].<br />
<br />
2. Use a log-friendly user interface:<br />
{{hc|~/.offlineimaprc|2=<br />
<nowiki><br />
[general]<br />
# This will suppress anything but errors<br />
ui = quiet<br />
</nowiki><br />
}}<br />
<br />
3. Write a wrapper script for [[daemon]]izing programs, or use the one shown below:<br />
{{hc|/usr/local/bin/start_daemon|2=<br />
<nowiki><br />
#!/bin/sh<br />
<br />
set -efu<br />
<br />
ionice_class=<br />
ionice_priority=<br />
nice=<br />
<br />
while getopts c:p:n: f; do<br />
case $f in<br />
c) ionice_class=$OPTARG;;<br />
p) ionice_priority=$OPTARG;;<br />
n) nice=$OPTARG;;<br />
*) exit 2;;<br />
esac<br />
done<br />
shift $((OPTIND - 1))<br />
<br />
cmd=$*<br />
io=<br />
<br />
if pgrep -u "$(id -u)" -xf -- "$cmd" >/dev/null 2>&1; then<br />
exit 0<br />
fi<br />
<br />
if type ionice >/dev/null 2>&1; then<br />
[ -n "$ionice_class" ] && { io=1; cmd="-c $ionice_class $cmd"; }<br />
[ -n "$ionice_priority" ] && { io=1; cmd="-n $ionice_priority $cmd"; }<br />
[ -n "$io" ] && cmd="ionice $cmd"<br />
fi<br />
<br />
if type nice >/dev/null 2>&1; then<br />
[ -n "$nice" ] && cmd="nice -n $nice $cmd"<br />
fi<br />
<br />
exec $cmd<br />
</nowiki><br />
}}<br />
<br />
4. Finally, add a crontab entry:<br />
$ crontab -e<br />
The line should specify the interpreter for correct {{Ic|pgrep -xf}} results:<br />
*/5 * * * * exec /usr/local/bin/start_daemon -n19 -c2 -p7 python2 /usr/bin/offlineimap<br />
<br />
The wrapper script is needed because offlineimap has the tendency to sporadically crash, even more so when facing connection problems.<br />
<br />
===Automatic mutt mailbox generation===<br />
[[Mutt]] cannot be simply pointed to an IMAP or maildir directory and be expected to guess which subdirectories happen to be the mailboxes, yet offlineimap can generate a muttrc fragment containing the mailboxes that it syncs.<br />
{{hc|~/.offlineimaprc|2=<br />
<nowiki><br />
[mbnames]<br />
enabled = yes<br />
filename = ~/.mutt/mailboxes<br />
header = "mailboxes "<br />
peritem = "+%(accountname)s/%(foldername)s"<br />
sep = " "<br />
footer = "\n"<br />
</nowiki><br />
}}<br />
<br />
Then add {{Ic|source ~/.mutt/mailboxes}} to {{ic|~/.mutt/muttrc}}.<br />
<br />
===Gmail configuration===<br />
This remote repository is configured specifically for Gmail support, substituting folder names in uppercase for lowercase, among other small additions. Keep in mind that this configuration does not sync the ''All Mail'' folder, since it is usually unnecessary and skipping it prevents bandwidth costs:<br />
<br />
{{hc|~/.offlineimaprc|2=<br />
<nowiki><br />
[Repository gmail-remote]<br />
type = Gmail<br />
remoteuser = user@gmail.com<br />
remotepass = password<br />
nametrans = lambda foldername: re.sub ('^\[gmail\]', 'bak',<br />
re.sub ('sent_mail', 'sent',<br />
re.sub ('starred', 'flagged',<br />
re.sub (' ', '_', foldername.lower()))))<br />
folderfilter = lambda foldername: foldername not in '[Gmail]/All Mail'<br />
# Necessary as of OfflineIMAP 6.5.4<br />
sslcacertfile = /etc/ssl/certs/ca-certificates.crt<br />
</nowiki><br />
}}<br />
<br />
{{Note|If you have Gmail set to another language, the folder names may appear translated too, e.g. "verzonden_berichten" instead of "sent_mail".}}<br />
<br />
{{Note|After version 6.3.5, offlineimap also creates remote folders to match your local ones. Thus you may need a nametrans rule for your local repository too that reverses the effects of this nametrans rule.}}<br />
<br />
{{Note|As of 1 October 2012 gmail SSL certificate fingerprint is not always the same. This prevents from using {{ic|cert_fingerprint}} and makes the {{ic|sslcacertfile}} way a better solution for the SSL verification (see [[OfflineIMAP#SSL fingerprint does not match]]).}}<br />
<br />
===Not having to enter the password all the time===<br />
====.netrc====<br />
Add the following lines to your {{ic|~/.netrc}}:<br />
<br />
machine hostname.tld<br />
login [your username]<br />
password [your password]<br />
<br />
Don't forget to give the file appropriate rights like 600 or 700:<br />
chmod 600 ~/.netrc<br />
<br />
====Gnome Keyring====<br />
http://www.clasohm.com/blog/one-entry?entry_id=90957 gives an example of how to use gnome-keyring to store the password. <br />
<br />
====python-keyring====<br />
There's a general solution that should work for any keyring. Install [http://pypi.python.org/pypi/keyring python-keyring] from [[AUR]], then change your ~/.offlineimaprc to say something like:<br />
<br />
{{bc|1=<br />
[general]<br />
pythonfile = /home/user/offlineimap.py<br />
…<br />
[Repository RemoteEmail]<br />
remoteuser = username@host.net<br />
remotepasseval = keyring.get_password("offlineimap","username@host.net")<br />
…<br />
}}<br />
<br />
and somewhere in ~/offlineimap.py add {{ic|import keyring}}. Now all you have to do is set your password, like so:<br />
<br />
{{bc|$ python2 <br />
>>> import keyring<br />
>>> keyring.set_password("offlineimap","username@host.net", "MYPASSWORD")'}}<br />
<br />
and it'll grab the password from your (kwallet/gnome-) keyring instead of having to keep it in plaintext or enter it each time.<br />
<br />
====Emacs EasyPG====<br />
See http://www.emacswiki.org/emacs/OfflineIMAP#toc2<br />
<br />
===Kerberos authentication===<br />
Install python2-kerberos from [https://aur.archlinux.org/packages.php?ID=50639 AUR] and do not specify remotepass in your .offlineimaprc. <br />
OfflineImap figure out the reset all if have a valid Kerberos TGT. <br />
If you have 'maxconnections', it will fail for some connection. Comment 'maxconnections' out will solve this problem.<br />
<br />
==Troubleshooting==<br />
<br />
===Overriding UI and autorefresh settings===<br />
For the sake of troubleshooting, it is sometimes convenient to launch offlineimap with a more verbose UI, no background syncs and perhaps even a debug level:<br />
$ offlineimap [ -o ] [ -d <debug_type> ] [ -u <ui> ]<br />
;-o<br />
:Disable autorefresh, keepalive, etc.<br />
<br />
;-d <debug_type><br />
:Where ''<debug_type>'' is one of {{Ic|imap}}, {{Ic|maildir}} or {{Ic|thread}}. Debugging imap and maildir are, by far, the most useful.<br />
<br />
;-u <ui><br />
:Where ''<ui>'' is one of {{Ic|CURSES.BLINKENLIGHTS}}, {{Ic|TTY.TTYUI}}, {{Ic|NONINTERACTIVE.BASIC}}, {{Ic|NONINTERACTIVE.QUIET}} or {{Ic|MACHINE.MACHINEUI}}. TTY.TTYUI is sufficient for debugging purposes.<br />
<br />
{{Note|More recent versions use the following for <ui>: {{Ic|blinkenlights}}, {{Ic|ttyui}}, {{Ic|basic}}, {{Ic|quiet}} or {{Ic|machineui}}.}}<br />
<br />
===Curses interface (Curses.Blinkenlights) locks terminal===<br />
Because of a bug in Python's ncurses package (http://bugs.python.org/issue7567) the Curses interface of OfflineIMAP breaks the terminal on exit.<br />
While it appears to irreparably lock the terminal, in reality it only prevents commands from being displayed.<br />
The bug has been fixed in Python's SVN for all versions 2.6 up to 3.2 but the current package in the repositories (Python 2.6.5) is still buggy.<br />
<br />
In order to solve the issue:<br />
*either append {{Ic|reset}} to OfflineIMAP's launch command:<br />
$ offlineimap; reset<br />
*or change the {{Ic|ui}} field in {{ic|~/.offlineimaprc}} to select a fully functional one:<br />
ui = TTY.TTYUI<br />
*or as quick workaround you can just use the following command to skip the reset() function in Curses.py which causes the problem<br />
# sed -i '125i\ \ \ \ \ \ \ \ return' /usr/lib/python2.6/site-packages/offlineimap/ui/Curses.py<br />
<br />
===netrc authentication===<br />
There are some bugs in the current {{Pkg|offlineimap}} which makes it impossible to read the authentication data from {{ic|~/.netrc}} if there are multiple Accounts per remote machine. ( see [http://comments.gmane.org/gmane.mail.imap.offlineimap.general/3024 Mail Archive ] ) But they are fixed in the GIT package {{AUR|offlineimap-git}} (note that is AUR package is flagged as out of date; see the current GitHub external link below).<br />
Using the package you can collect all passwords in {{ic|~/.netrc}}. And do not forget to set it's access rights:<br />
chmod 600 ~/.netrc<br />
An example netrc file would be<br />
{{hc|~/.netrc|<br />
machine mail.myhost.de<br />
login mr_smith<br />
password secret<br />
}}<br />
<br />
===socket.ssl deprecation warnings===<br />
Depending on the currently installed python version, running offlineimap throws this warning:<br />
DeprecationWarning: socket.ssl() is deprecated. Use ssl.wrap_socket() instead.<br />
<br />
This can be particularly annoying when offlineimap's output is being logged or mailed through [[cron]].<br />
<br />
To fix the problem, apply this [http://github.com/jgoerzen/offlineimap/commit/a7810166335bb0e6f5c7dab26adf707c38adf6ff upstream] patch or install {{AUR|offlineimap-git}}:<br />
{{bc|<nowiki><br />
--- offlineimap/imaplibutil.py.orig 2009-08-12 01:24:23.000000000 -0430<br />
+++ offlineimap/imaplibutil.py 2010-06-07 11:17:37.849038683 -0430<br />
@@ -23,9 +23,11 @@<br />
# Import the symbols we need that aren't exported by default<br />
from imaplib import IMAP4_PORT, IMAP4_SSL_PORT, InternalDate, Mon2num<br />
<br />
-# ssl is new in python 2.6<br />
-if (sys.version_info[0] == 2 and sys.version_info[1] >= 6) or sys.version_info[0] >= 3:<br />
+try:<br />
import ssl<br />
+ ssl_wrap = ssl.wrap_socket<br />
+except ImportError:<br />
+ ssl_wrap = socket.ssl<br />
<br />
class IMAP4_Tunnel(IMAP4):<br />
"""IMAP4 client class over a tunnel<br />
@@ -169,7 +171,7 @@<br />
if last_error != 0:<br />
# FIXME<br />
raise socket.error(last_error)<br />
- self.sslobj = socket.ssl(self.sock, self.keyfile, self.certfile)<br />
+ self.sslobj = ssl_wrap(self.sock, self.keyfile, self.certfile)<br />
self.sslobj = sslwrapper(self.sslobj)<br />
<br />
mustquote = re.compile(r"[^\w!#$%&'+,.:;<=>?^`|~-]")<br />
</nowiki>}}<br />
<br />
The diff is relative to the root buildir and it can be applied by using [[ABS]].<br />
<br />
===Folder could not be created===<br />
In version 6.5.3, offlineimap gained the ability to create folders in the remote repository, as described [http://comments.gmane.org/gmane.mail.imap.offlineimap.general/4784 here].<br />
<br />
This can lead to errors of the following form when using {{Ic|nametrans}} on the remote repository:<br />
ERROR: Creating folder bar on repository foo-remote<br />
Folder 'bar'[foo-remote] could not be created. Server responded: ('NO', ['[ALREADYEXISTS] Duplicate folder name bar (Failure)'])<br />
<br />
The solution is to provide an inverse {{Ic|nametrans}} lambda for the local repository, e.g.<br />
{{hc|~/.offlineimaprc|2=<br />
<nowiki><br />
[Repository foo-local]<br />
nametrans = lambda foldername: foldername.replace('bar', 'BAR')<br />
<br />
[Repository foo-remote]<br />
nametrans = lambda foldername: foldername.replace('BAR', 'bar')<br />
</nowiki><br />
}}<br />
<br />
* For working out the correct inverse mapping. the output of {{Ic|offlineimap --info}} should help.<br />
* After updating the mapping, it may be necessary to remove all of the folders under {{Ic|$HOME/.offlineimap/}} for the affected accounts.<br />
<br />
===SSL fingerprint does not match===<br />
ERROR: Server SSL fingerprint 'keykeykey' for hostname 'example.com' does not match configured fingerprint. Please verify and set 'cert_fingerprint' accordingly if not set yet.<br />
<br />
To solve this, add to {{ic|~/.offlineimaprc}} (in the same section as {{ic|1=ssl = yes}}) one of the following:<br />
* either add {{ic|cert_fingerprint}}, with the certificate fingerprint of the remote server. This checks whether the remote server certificate matches the given fingerprint.<br />
cert_fingerprint = keykeykey<br />
* or add {{ic|sslcacertfile}} with the path to the system CA certificates file. Needs {{Pkg|ca-certificates}} installed. This validates the remote ssl certificate chain against the Certification Authorities in that file.<br />
sslcacertfile = /etc/ssl/certs/ca-certificates.crt<br />
<br />
==External links==<br />
* [http://lists.alioth.debian.org/mailman/listinfo/offlineimap-project Official OfflineIMAP mailing list]<br />
* [http://roland.entierement.nu/blog/2010/09/08/gnus-dovecot-offlineimap-search-a-howto.html Gnus, Dovecot, OfflineIMAP, search: a HOWTO]<br />
** This setup worked for me, only difference being I had to add {{ic|1=mail_location = maildir:~/Maildir}} to {{ic|/etc/dovecot/dovecot.conf}}. Also, I used the [[OfflineIMAP#Gmail_configuration|Gmail configuration above]]. --[[User:Unhammer|Unhammer]] 09:24, 22 October 2010 (EDT)<br />
* [http://pbrisbin.com/posts/mutt_gmail_offlineimap/ Mutt + Gmail + Offlineimap]<br />
** An outline of brisbin's simple gmail/mutt setup using cron to keep offlineimap syncing.<br />
* [https://github.com/nicolas33/offlineimap Current OfflineIMAP maintainer's fork on GitHub]<br />
** Note that a strict build of this on current Arch will fail due to python references unless they are replaced with python2</div>Silenti620