[linux] 修复 Redmine 无法发送通知邮件,提示 550 5.7.1 Unable to relay 的问题

前两天接手了公司 Redmine 系统的维护工作,需要写一个安装维护文档。 所以我就在本地虚拟机上尝试进行了一下安装。 安装后,测试使用的过程中遇到了无法发送通知邮件的问题, 日志信息如下:

The following error occured while sending email notification:
"550 5.7.1 Unable to relay".
Check your configuration in config/configuration.yml.

Redmine 版本: 1.2.1

最终的解决办法是,修改 config/configuration.yml ,添加 authentication: :none :

default:
  # Outgoing emails configuration (see examples above ...
more ...

[python] 定义抽象基类(Abstract Base Classes)

Date Category python

抽象基类一般用于规定子类必须重新定义某些方法。比如 web 框架中的 cache 部分的基类一般类似下面这样:

class BaseCache(object):
    def get(self, key):
        raise NotImplementedError('subclasses of BaseCache must provide a get() method')

    def set(self, key, value, timeout=60):
        raise NotImplementedError('subclasses of BaseCache must provide a set() method')


class MemcachedCache(BaseCache):
    def get(self, key):
        value = self._cache ...
more ...