public function beforeCompile()
	{
		$builder = $this->getContainerBuilder();

		$this->validateConfig($this->defaults);
		$config = $this->getConfig($this->defaults);

		foreach ($builder->findByType('Nette\Mail\IMailer') as $name => $def) {
			$builder->removeDefinition($name);
		}

		if ($config['debugger'] && interface_exists('Tracy\IBarPanel')) {
			$builder->addDefinition($this->prefix('panel'))
				->setClass('RM\MailPanel')
				->addSetup('$newMessageTime', [$config['newMessageTime']])
				->addSetup('$show', [array_unique($config['show'])])
				->addSetup('$autoremove', [$config['autoremove']])
				->addSetup('$hideEmpty', [$config['hideEmpty']]);
		}

		$builder->addDefinition($this->prefix('mailer'))
			->setClass('RM\FileMailer', [Helpers::expand($config['tempDir'], $builder->parameters)])
			->addSetup('@RM\MailPanel::setFileMailer', ['@self'])
			->addSetup('@Tracy\Bar::addPanel', [$this->prefix('@panel')]);
	}