$ sudo /usr/lib/mailman/bin/newlist --language=ja mailman
Enter the email of the person running the list: postmaster@mydomain.com
Initial mailman password:xxxxx
To finish creating your mailing list, you must edit your /etc/aliases (or
equivalent) file by adding the following lines, and possibly running the
`newaliases' program:
$ sudo vi /etc/mailman/mm_cfg.py
DEFAULT_URL_PATTERN = 'https://%s/mailman/'
DEFAULT_EMAIL_HOST = 'ml.mydomain.com'
VIRTUAL_EMAIL_HOST1 = 'ml.mydomein2.net'
DEFAULT_URL_HOST = 'ml.mydomain.com'
VIRTUAL_URL_HOST1 = 'ml.mydomain2.net'
#####
# Archive defaults
#####
# Are archives on or off by default?
DEFAULT_ARCHIVE = Off
# Are archives public or private by default?
# 0=public, 1=private
DEFAULT_ARCHIVE_PRIVATE = 1
#####
# Delivery defaults
#####
MTA='Postfix'
POSTFIX_STYLE_VIRTUAL_DOMAINS = [DEFAULT_EMAIL_HOST, VIRTUAL_EMAIL_HOST1]
add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
add_virtualhost(VIRTUAL_URL_HOST1, VIRTUAL_EMAIL_HOST1)
SMTPHOST = DEFAULT_EMAIL_HOST
SMTPPORT = 25 # 0:default from smtplib
#####
# General defaults
#####
DEFAULT_SERVER_LANGUAGE = 'ja'
OWNERS_CAN_DELETE_THEIR_OWN_LISTS = Yes
DEFAULT_NEW_MEMBER_OPTIONS = 256 # Default see Bitfield for user options
#####
# List defaults. NOTE: Changing these values does NOT change the
# configuration of an existing list. It only defines the default for new
# lists you subsequently create.
#####
DEFAULT_LIST_ADVERTISED = No
DEFAULT_SUBJECT_PREFIX = '[%(real_name)s:%%05d] '
# What should happen to non-member posts which are do not match explicit
# non-member actions?
# 0 = Accept
# 1 = Hold
# 2 = Reject
# 3 = Discard
DEFAULT_GENERIC_NONMEMBER_ACTION = 2
DEFAULT_SEND_REMINDERS = 0
DEFAULT_SEND_WELCOME_MSG = No
DEFAULT_SEND_GOODBYE_MSG = No
# Mailman can be configured to "munge" Reply-To: headers for any passing
# messages. One the one hand, there are a lot of good reasons not to munge
# Reply-To: but on the other, people really seem to want this feature. See
# the help for reply_goes_to_list in the web UI for links discussing the
# issue.
# 0 - Reply-To: not munged
# 1 - Reply-To: set back to the list
# 2 - Reply-To: set to an explicit value (reply_to_address)
DEFAULT_REPLY_GOES_TO_LIST = 1
# SUBSCRIBE POLICY
# 0 - open list (only when ALLOW_OPEN_SUBSCRIBE is set to 1) **
# 1 - confirmation required for subscribes
# 2 - admin approval required for subscribes
# 3 - both confirmation and admin approval required
#
# ** please do not choose option 0 if you are not allowing open
# subscribes (next variable)
DEFAULT_SUBSCRIBE_POLICY = 2
#####
# Digestification defaults. Same caveat applies here as with list defaults.
#####
DEFAULT_DIGESTABLE = No
$ sudo vi /root/fetchmail_time.sh
-----
#!/bin/bash
sleep 60
while true
do
if [ -w /var/log/fetchmail.log ]; then
echo ' ' `date '+%Y/%m/%d %H:%M:%S'`>> /var/log/fetchmail.log
fi
sleep 3600
done
-----
$ sudo chown root.root /root/fetchmail_time.sh
$ sudo chmod 700 /root/fetchmail_time.sh
$ sudo vi /etc/sudoers.d/auto-start
%sudo ALL=NOPASSWD: /root/fetchmail_time.sh
$ vi ~/.bash_aliases
ps -ef | grep -vw "^`whoami`" | grep -w fetchmail_time || sudo /root/fetchmail_time.sh &
rsyslog
・logrotateの設定
rsysrog-rotateファイルを書き換える。
$ sudo vi /usr/lib/rsyslog/rsysrog-rotate
if [ -d /run/systemd/system ]; then
systemctl kill -s HUP rsyslog.service
fi
↓
if [ -d /run/systemd/system ]; then
systemctl kill -s HUP rsyslog.service
else
kill -HUP $(cat /var/run/rsyslogd.pid)
fi
cronやpostfixは再起動されないので、独自のファイルを作成する
$ sudo vi /etc/logrotate.d/rsyslog
#/var/log/mail.info
#/var/log/mail.warn
#/var/log/mail.err
#/var/log/mail.log
#/var/log/cron.log
for /f "usebackq delims=" %%f in (`wsl.exe -- ls /var/lib/mailman/lists/`) do (
wsl.exe -- sudo /usr/lib/mailman/bin/dumpdb /var/lib/mailman/lists/%%f/config.pck > C:\Temp\config.pck.%%f.txt
)
Amazon SESコンソールを開く
Configurationの下のVerified identitiesをクリック
Create identityを押す、identity typeのDomainをチェック
Domainにサブドメイン名を入力 mail.mydomain.com
Assign a default configuration set: off
Use a custom MAIL FROM domain: off
Create identifyを押す
作成されたLegacy TXT RecordsとPublish DNS recordsをDNSに追加する
TXT,_amazonses.mail.mydomain.com,xxxxx
TXT,mail.mydomain.com,amazonses:xxxxx
CNAME,xxx._domainkey.mail.mydomain.com,xxx.dkim.amazonses.com
CNAME,yyy._domainkey.mail.mydomain.com,yyy.dkim.amazonses.com
CNAME,zzz._domainkey.mail.mydomain.com,zzz.dkim.amazonses.com
しばらくしてAWS側の検証が完了すると、DKIM setup SUCCESS for ドメイン という件名のメールがAWSアカウント宛に届く
Amazon SESコンソールを開く
Configurationの下のVerified identitiesをクリック
対象のアイテム(ドメイン)をクリックする
AuthenticationタブのDomainKeys Identified Mail (DKIM)にあるEditを押す
DKIM signing key lengthの RSA_2048_BIT か RSA_1024_BIT を選ぶ
Save changesを押す
次に送られるメールからは、キー長が変わるらしい。
・追加したサブドメインにバウンス対応用のSNS通知を設定しておく
2.毎日06:30ごろにroot宛にCronのエラーメールが来る
Cron <root@xxxx> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
/etc/cron.daily/logrotate:
invoke-rc.d: could not determine current runlevel