Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mailinabox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mailinabox
Commits
a1260b75
Commit
a1260b75
authored
Aug 31, 2013
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
various fixes; rewrote test scripts
parent
3839054b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
14 deletions
+34
-14
mail.sh
scripts/mail.sh
+9
-2
spamassassin.sh
scripts/spamassassin.sh
+1
-1
start.sh
scripts/start.sh
+2
-0
imap.py
tests/imap.py
+10
-5
smtp_submission.py
tests/smtp_submission.py
+12
-6
No files found.
scripts/mail.sh
View file @
a1260b75
...
...
@@ -111,11 +111,18 @@ EOF
sed
-i
"s/#port = 143/port = 0/"
/etc/dovecot/conf.d/10-master.conf
sed
-i
"s/#port = 110/port = 0/"
/etc/dovecot/conf.d/10-master.conf
# Create a Unix domain socket specific for postgres
to connect via
LMTP because
# postgres is
already configured to use this location
, and create a TCP socket
# Create a Unix domain socket specific for postgres
for auth and
LMTP because
# postgres is
more easily configured to use these locations
, and create a TCP socket
# for spampd to inject mail on (if it's configured later). dovecot's standard
# lmtp unix socket is also listening.
cat
>
/etc/dovecot/conf.d/99-local.conf
<<
EOF
;
service auth {
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
user = postfix
...
...
scripts/spamassassin.sh
View file @
a1260b75
# Spam filtering with spamassassin via spampd.
apt-get
-q
-y
install
spampd dovecot-antispam
apt-get
-q
-y
install
spampd dovecot-
sieve dovecot-
antispam
# Hook into postfix. Replace dovecot with spampd as the mail delivery agent.
tools/editconf.py /etc/postfix/main.cf
virtual_transport
=
lmtp:[127.0.0.1]:10025
...
...
scripts/start.sh
View file @
a1260b75
...
...
@@ -48,3 +48,5 @@ EOF
.
scripts/dns_update.sh
.
scripts/add_mail_user.sh
.
scripts/users_update.sh
.
scripts/web.sh
tests/imap.py
100644 → 100755
View file @
a1260b75
import
imaplib
,
os
#!/usr/bin/python3
import
imaplib
,
sys
username
=
"testuser@"
+
os
.
environ
.
get
(
"DOMAIN"
,
"testdomain.com"
)
if
len
(
sys
.
argv
)
<
3
:
print
(
"Usage: tests/imap.py host username password"
)
sys
.
exit
(
1
)
M
=
imaplib
.
IMAP4_SSL
(
os
.
environ
[
"INSTANCE_IP"
])
M
.
login
(
username
,
"testpw"
)
M
.
select
()
host
,
username
,
pw
=
sys
.
argv
[
1
:
4
]
M
=
imaplib
.
IMAP4_SSL
(
host
)
M
.
login
(
username
,
pw
)
print
(
"Login successful."
)
M
.
select
()
typ
,
data
=
M
.
search
(
None
,
'ALL'
)
for
num
in
data
[
0
]
.
split
():
typ
,
data
=
M
.
fetch
(
num
,
'(RFC822)'
)
...
...
tests/smtp_submission.py
100644 → 100755
View file @
a1260b75
import
smtplib
,
sys
,
os
#!/usr/bin/python3
import
smtplib
,
sys
fromaddr
=
"testuser@"
+
os
.
environ
.
get
(
"DOMAIN"
,
"testdomain.com"
)
if
len
(
sys
.
argv
)
<
3
:
print
(
"Usage: tests/smtp_submission.py host email.from pw email.to"
)
sys
.
exit
(
1
)
host
,
fromaddr
,
pw
,
toaddr
=
sys
.
argv
[
1
:
5
]
msg
=
"""From:
%
s
To:
%
s
Subject: SMTP server test
This is a test message."""
%
(
fromaddr
,
sys
.
argv
[
1
]
)
This is a test message."""
%
(
fromaddr
,
toaddr
)
server
=
smtplib
.
SMTP
(
os
.
environ
[
"INSTANCE_IP"
]
,
587
)
server
=
smtplib
.
SMTP
(
host
,
587
)
server
.
set_debuglevel
(
1
)
server
.
starttls
()
server
.
login
(
fromaddr
,
"testpw"
)
server
.
sendmail
(
fromaddr
,
[
sys
.
argv
[
1
]
],
msg
)
server
.
login
(
fromaddr
,
pw
)
server
.
sendmail
(
fromaddr
,
[
toaddr
],
msg
)
server
.
quit
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment