3 changed files with 86 additions and 30 deletions
@ -1,35 +1,87 @@
|
||||
## |
||||
## lmtp2nntp.conf |
||||
## lmtp2nntp.conf -- Mail to News Gateway Configuration |
||||
## |
||||
|
||||
# PID, socket and logging file |
||||
pidfile '@l_prefix@/var/lmtp2nntp/lmtp2nntp.pid' |
||||
bind '@l_prefix@/var/lmtp2nntp/lmtp2nntp.socket' |
||||
l2spec ' \ |
||||
info: prefix(prefix="%%b %%d %%H:%%M:%%S <%%L> lmtp2nntp[%%P]: ",timezone=local) \ |
||||
-> file(path="@l_prefix@/var/lmtp2nntp/lmtp2nntp.log",append=0,perm=0644) \ |
||||
' |
||||
# --- DAEMON --- |
||||
user @l_musr@ |
||||
childsmax 10 |
||||
pidfile "@l_prefix@/var/lmtp2nntp/lmtp2nntp.pid" |
||||
|
||||
# run-time parameters |
||||
#user @l_musr@ |
||||
destination news |
||||
groupmode envelope |
||||
operationmode post |
||||
newsgroup * |
||||
# --- LMTP SERVER --- |
||||
|
||||
# header rewriting: remove headers |
||||
headerrule '500:^(-EF|Path|Received|To|Cc|Bcc|):$1:' |
||||
# server communication on TCP socket (address:port) |
||||
#acl 127.0.0.1/32 |
||||
#bind 127.0.0.1:24 |
||||
|
||||
# header rewriting: merge values from duplicate headers and separte them with "comma space" |
||||
headerrule '510:^(Reply-To):$1:[${msg.header.${1}[#]}${msg.header.${1}[#+1]:+, }]' |
||||
# server communication on Unix domain socket (path:permissions) |
||||
bind "@l_prefix@/var/lmtp2nntp/lmtp2nntp.socket:660" |
||||
|
||||
# header rewriting: replace empty Subject with text "None" |
||||
headerrule '520::Subject:${msg.header.Subject:-None}' |
||||
# server communication on stdin/stdout (remove DAEMON section above) |
||||
#bind - |
||||
|
||||
# header rewriting: create Message-ID if omitted or illegal (no or more than one '@') |
||||
headerrule '530::Message-ID:${msg.header.Message-ID:-@@:s/^.*@.*@.*$//:%createmessageid}' |
||||
# server communication limits |
||||
timeoutlmtp 0 |
||||
timeoutlmtpaccept 0 |
||||
timeoutlmtpread 10 |
||||
timeoutlmtpwrite 10 |
||||
size 8388608 |
||||
|
||||
# header rewriting: append a header |
||||
headerrule '540::Path:lmtp2nntp!not-for-mail' |
||||
headerrule '550::X-Gateway:lmtp2nntp' |
||||
# ---- NNTP CLIENT ---- |
||||
|
||||
# client communication via TCP socket |
||||
#client 127.0.0.1 |
||||
destination 127.0.0.1:nntp |
||||
|
||||
# client communication limits |
||||
timeoutnntp 30 |
||||
timeoutnntpconnect 60 |
||||
timeoutnntpread 60 |
||||
timeoutnntpwrite 60 |
||||
operationmode post |
||||
|
||||
# ---- GATEWAY OPERATION ---- |
||||
|
||||
# processing mode |
||||
groupmode envelope |
||||
mailfrom ".*" |
||||
nodename "gateway" |
||||
restrictheader "Cc: j\.doe@example\.org" |
||||
newsgroup "local.test" |
||||
|
||||
# remove headers (using empty value) |
||||
headerrule '500:^(-EF|Path|Received|To|Cc|Bcc|):$1:' |
||||
|
||||
# merge values from duplicate headers and separte them with "comma space" |
||||
headerrule '510:^(Reply-To):$1:[${msg.header.${1}[#]}${msg.header.${1}[#+1]:+, }]' |
||||
|
||||
# replace empty Subject with text "None" |
||||
headerrule '520::Subject:${msg.header.Subject:-None}' |
||||
|
||||
# create Message-ID if omitted or illegal (no or more than one '@') |
||||
headerrule '530::Message-ID:${msg.header.Message-ID:-@@:s/^.*@.*@.*$//:%createmessageid}' |
||||
|
||||
# append a header |
||||
headerrule '540::Path:lmtp2nntp!not-for-mail' |
||||
|
||||
# append a header |
||||
headerrule '610::X-Gateway:lmtp2nntp' |
||||
headerrule '620::Approved:gateway@example.com' |
||||
|
||||
# ---- LOGGING ---- |
||||
|
||||
# normal operation |
||||
l2spec 'info: prefix(prefix="%b %d %H:%M:%S <%L> lmtp2nntp[%P]: ", timezone=local) \ |
||||
-> buffer(size=65536) \ |
||||
-> file(path="@l_prefix@/var/lmtp2nntp/lmtp2nntp.log", append=1, perm=0640)' |
||||
|
||||
# normal and debug operation |
||||
#l2spec 'noop -> { \ |
||||
info: prefix(prefix="%b %d %H:%M:%S <%L> lmtp2nntp[%P]: ", timezone=local) \ |
||||
-> buffer(size=65536) \ |
||||
-> file(path="@l_prefix@/var/lmtp2nntp/lmtp2nntp.log", append=1, perm=0640); \ |
||||
debug: prefix(prefix="%b %d %H:%M:%S <%L> lmtp2nntp[%P]: ", timezone=local) \ |
||||
-> file(path="@l_prefix@/var/lmtp2nntp/lmtp2nntp.debug", append=0, perm=0640) }' |
||||
|
||||
# raw debug operation only |
||||
#l2spec 'debug: fd(fd=2)' |
||||
|
||||
|
||||
Loading…
Reference in new issue