Coder Social home page Coder Social logo

vexim2's Introduction

Virtual Exim 2

WARNING: This code is probably unsafe

As noted in #272 there might be security issues in this code. It was written as a helpful utility in 2004 and has had minimal changes since then. Very little effort went in at the time to protect it against various security attacks. While we do eventually fix security issues we become aware of, we aren't bound by any SLAs, so fixes don't always happen quickly.

Patches to fix security issues will be accepted as time permits, but the code (especially the admin panel) certainly needs an overhaul, and that will only happen if someone with enough time and motivation steps up. In fact, a potential replacement for our aged PHP admin panel already exists. Meet veximpy!

In short:

  • If you are considering VExim, we advise you to at least have a look at other similar solutions as well.
  • If you are already using VExim, please consider taking extra steps to secure it.
  • If you're interested in contributing a rewrite, or participating in one, let us know
  • And of course, pull requests with bugfixes are always welcome!

README AND INSTALL GUIDE

Thanks for picking the Virtual Exim package, for your virtual mail hosting needs! :-)

This document provides a basic guide on how to get Virtual Exim working on your system. In this guide, I assume that you have a little knowledge of both MySQL and Exim.

Before we go into any details, I'd like to thanks Philip Hazel and the Exim developers for a fine product. I would also like to thanks the postmasters at various domains for letting me play havoc with their mail while I set this up :-) Finally, a special note of thanks to Dan Bernstein for his Qmail MTA. Dan, thank you for educating me how mail delivery really shouldn't be done, on the Internet.

The Virtual Exim project currently lives on GitHub: https://github.com/vexim/vexim2 And its mailing list/Google group is available at: https://groups.google.com/group/vexim

Installation steps for each component:

NOTE FOR UPGRADING:

If you are upgrading from a previous version of Virtual Exim, you'll find additional notes marked 'UPGRADING' in some sections. If and when you do, follow these notes.

DISTRIBUTION-SPECIFIC NOTES:

Some sections may contain distribution or OS-specific notes. You'll find them after an appropriate prefix, such as 'DEBIAN' or 'FREEBSD' where appropriate.

PARTS:

  1. Prerequisites
  2. System user
  3. Databases and authentication
  4. Files and Apache
  5. Mailman
  6. Exim configuration
  7. Site Admin
  8. Virtual Domains
  9. Mail storage and Delivery
  10. POP3 and IMAP daemons (separate to this software)

Prerequisites:

The following packages must be installed on your system, for Virtual Exim to work. If you don't have any of these packages already installed, please refer to the documentation provided with your operating system on how to install each package:

  • Exim v4 with MySQL or PostgreSQL support (tested on v4.1x/4.2x/4.7x)
  • MySQL (tested on v5.1.x) or PostgreSQL
  • Apache or other HTTP server (Tested with Apache v2.2.x and NginX)
  • PHP (tested on v5.3.x, v7.x and v8.x) with at least the following extensions:
    • PDO
    • pdo_mysql or pdo_pgsql
    • imap
    • gettext
    • iconv
    • filter

The following packages provide optional functionality:

  • Mailman – to have mailing lists
  • ClamAV – for scanning e-mail for viruses
  • SpamAssassin – for scanning e-mail from spam

VExim might work with older (or newer) versions of these packages, but you may have to perform some adaptation work to achieve that. In any case, you are welcome to file bugs and/or provide patches on GitHub.

DEBIAN: The following command line installs all the packages mentioned above (last four are optional), if you're going with MySQL setup:

# apt-get install apache2 exim4-daemon-heavy mysql-server libapache2-mod-php php-mysql php-imap clamav-daemon clamav-freshclam spamassassin mailman

System user:

You should create a new user account to whom the virtual mailboxes will belong. Since you do not want anyone to be able to login using that account, you should also disable logging in for that user. Here are the command lines to do that. This manual assumes you want to have your virtual mailboxes in /var/vmail. If you want them elsewhere, adjust the commands. After the user and group are created, find their uid and gid using the last command and memorize these values:

# useradd -r -m -U -s /bin/false -d /var/vmail vexim
# id vexim

FREEBSD: Instead of the commands above, you should probably use the following (change 90 to another value if this user or group id is already used on your system):

# pw groupadd vexim -g 90
# pw useradd vexim -u 90 -g vexim -d /usr/local/mail -m -s /nonexistant

DEBIAN: Use the following command instead:

# adduser --system --home /var/vmail --disabled-password --disabled-login --group vexim

Databases and authentication:

MySQL:

This distribution contains a file "vexim2/setup/mysql.sql". This file provides the database schema used by vexim. You will have to import it into MySQL, like this:

# mysql -u root -D YOUR_DATABASE_NAME -p < vexim2/setup/mysql.sql

Where YOUR_DATABASE_NAME is the name of an empty database you have created for vexim. If you want the script to create the database for you and set up access to it, this is also doable: just open it in a text editor, and find a commented out block which begins with -- CREATE DATABASE near the top of the file. This block is documented just above it, so you may uncomment it, apply the changes you want and save the file. With the necessary changes made, you should run the following command line to initialize the database:

# mysql -u root -p < vexim2/setup/mysql.sql

A site admininistrator account is created with an autogenerated password required for your first login to Vexim.

PGSQL:

The code has been tested by several users to work with Virtual Exim, and we try our best to make sure it always will. Unfortunately I don't have much PostgreSQL knowledge to support it fully. A database schema for it is included however, as setup/pgsql.sql to help you set up the database. Make sure to adjust it similarly as per MySQL instructions above.

UPGRADING: If you are upgrading your installation, we have prepared MySQL migration scripts for you, which you will find under vexim2/setup/migrations/. Find out the version of Vexim that you have and apply the necessary scripts in a sequential manner, like this:

# mysql -u root -D YOUR_DATABASE_NAME -p < vexim2/setup/migrations/SCRIPT_FILENAME.sql

Files and Apache:

In this distribution is a directory called 'vexim'. You have two options:

  • Copy this directory into your current DocumentRoot for your domain, and optionally rename the directory.
  • Set up a new VirtualHost and point the DocumentRoot to the vexim directory.

Both should work equally well.

After copying the 'vexim' directory, you should find the 'variables.php.example', file in its subdirectory called 'config', copy that file to 'variables.php' and change the following values defined in it:

  • $sqlpass – to the vexim database user's password which you chose while editing 'mysql.sql' in the "Databases and authentication" step.
  • $uid, $gid and $mailroot to the values you have from the "System user" step.
  • $cryptscheme is set to "sha512", a more specific configuration or other crypt-schemes can be used.
  • $mailmanroot to the mailman URL

Other, less interesting options are documented in the comments of that file. Feel free to explore them as well.

Mailman:

Mailman needs to be installed if you want to use mailing lists. Edit the default configuration file (/etc/mailman/mm_cfg.py):

DEFAULT_URL_PATTERN = 'https://%s/mailman/'
DEFAULT_SERVER_LANGUAGE = 'en'
DEFAULT_EMAIL_HOST = 'mail.example.tld'
DEFAULT_URL_HOST   = 'mail.example.tld'

Debian will already create a default configuration for your webserver that you can enable with a2ensite mailman. Create your master password: `mmsitepass MY_PASSWORD``. Restart mailman and apache.

Exim configuration:

NOTE: the configuration files supplied here have been revised. You should use them carefully and report problems!

An example Exim 'configure' file, has been included with this distribution as 'docs/configure'. Copy this to the location Exim expects its configuration file to be on your installation. You will also need to copy docs/vexim* to /usr/local/etc/exim/. The following lines are important and will have to be edited if you are using this configure, or copied to your own configure file:

Edit these if your mailman is in a different location (in Debian: /var/lib/mailman):

MAILMAN_HOME=/usr/local/mailman
MAILMAN_WRAP=MAILMAN_HOME/mail/mailman

These need to match the username and group under which exim runs (in Debian: list/daemon):

MAILMAN_USER=mailnull
MAILMAN_GROUP=mail

Change this to the name of your server:

primary_hostname=mail.example.org

In general, it is required that your reverse DNS entry of your IP points to this hostname.

If you are using MySQL, uncomment the following two lines:

#VIRTUAL_DOMAINS = SELECT DISTINCT CONCAT(domain, ' : ') FROM domains type = 'local'
#RELAY_DOMAINS = SELECT DISTINCT CONCAT(domain, ' : ') FROM domains type = 'relay'

If you are using PGSQL, uncomment the following four lines:

#VIRTUAL_DOMAINS = SELECT DISTINCT domain || ' : ' FROM domains WHERE type = 'local'
#RELAY_DOMAINS = SELECT DISTINCT domain || ' : ' FROM domains WHERE type = 'relay'

Depending on the database type you are using, you will need to uncomment the appropriate lines in the config, to enable lookups.

These control which domains you accept mail for and deliver locally (local_domains), which domains you accept mail for and deliver remotely (relay_to_domains), which IP addresses are allowed to send mail to any domain (relay_from_hosts) and which system users are considered trusted (trusted_users). More on these options – in Exim documentation.

domainlist local_domains = @ : example.org : ${lookup mysql{VIRTUAL_DOMAINS}} : ${lookup mysql{ALIAS_DOMAINS}}
domainlist relay_to_domains = ${lookup mysql{RELAY_DOMAINS}}
hostlist   relay_from_hosts = localhost : @ : 192.168.0.0/24
#trusted_users = www-data

These lines configure database connectivity. You need to uncomment one of them (depending on the database type you have chosen) and adjust it to match your setup. You at least have to change the word 'CHANGE' to the password you used for the 'vexim' database user, which you have created before. The socket path depends on your system, for Debian it is:

#hide mysql_servers = localhost::(/var/run/mysqld/mysqld.sock)/db/user/password
#hide pgsql_servers = (/var/run/postgresql/.s.PGSQL.5432)/db/user/password

If you want to use either Anti-Virus scanning, or SpamAssassin, you will need to uncomment the appropriate line here.

# av_scanner = clamd:/tmp/clamd
# spamd_address = 127.0.0.1 783

in Debian use:

# av_scanner = clamd:/var/run/clamav/clamd.ctl
# spamd_address = /var/run/spamd.sock

Specify here, the username and group under which Exim runs (Debian: Debian-exim). This combination is also that under which mailman must run in order to work:

exim_user = mailnull
exim_group = mail

Also it is assumed that the mysql domain socket is /tmp/mysql.sock, which is where the FreeBSD port puts it. Other installations put it in /var/tmp, /usr/lib, or any number of other places. If yours isn't /tmp/mysql.sock, you will need to set this.

TLS is activated by default. We suppose that you already created a SSL key and certificate.

tls_certificate = /etc/exim4/exim.crt
tls_privatekey = /etc/exim4/exim.key

The creation of SSL-keys is the same like for webservers, e.g. https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-with-a-free-signed-ssl-certificate-on-a-vps . You can use the same certificate your the webserver of this host (if you use webmail).

tls_dhparam = /etc/exim4/dhparam.pem

The Diffie-Hellman group should have at least 1024 bit and can be created with this command (it can take some time):

# openssl dhparam -out /etc/exim4/dhparam.pem 2048

In tls_require_ciphers, currently (2016) secure ciphers are selected. It works by default on GnuTLS setups (Debian/Ubuntu). If your distribution uses OpenSSL (e.g. FreeBSD, CentOS), comment the block tls_require_ciphers = ... and uncomment the line openssl_options = .... If you are not sure, the output of exim -bV will show either GnuTLS or OpenSSL.

ACL's:

We have split all of the ACL's into separate files, to make managing them easier. Please review the ACL section of the configure file. If there are ACL's you would rather not have executed, please comment out the '.include' line that references them, or edit the ACL file directly and comment them out.

DEBIAN:

Typically, Debian setups use split Exim configuration with some Debconf magic. This manual will assume that you are familiar with it. If not, you should refer to the Debian documentation on Exim. To get the virtual mailboxes to work, copy the contents of docs/debian-conf.d/ to /etc/exim4/conf.d/ and change the MySQL password in .../main/00_vexim_listmacrosdefs. You may also want to review the ACL's in docs/vexim-acl-*.conf and selectively copy and paste their contents to the files provided by Debian in conf.d. By the way, some of these ACL's are already implemented by Debian, so you might just need to enable them by defining certain macros as described in Debian manual. This manual does not cover enabling ClamAV and SpamAssassin in Exin in Debian. Please look this up elsewhere. By the way, the author of this part never bothered to set up Vexim in such a way that Debian would take into account the status of the various user flag (on_av, on_spamassassin etc) for each user. In his setup, these flags have no effect, and all messages are checked for spam and viruses.

Stefan Tomanek has a nice writeup about using Vexim in Debian, but that article does not cover all aspects, is a bit outdated, and most of if has been incorporated (and improved!) into this document anyway. You can find it at http://stefans.datenbruch.de/rootserver/vexim.shtml.

Site Admin:

In order to add and delete domains from the database, you need to have a "site admin". This user can create the initial postmaster users for the individual domains. This user has been created along with the database (see mysql-section), use it here to log in. The password is case sensitive. You are advised to change it when you first log in.

Virtual Domains:

Virtual Exim can now control which local domains Exim accepts mail for and which domains it relays mail for. The features are controlled by the siteadmin, and domains can be easily added/removed from the siteadmin pages. Local domains can also be enabled/disabled on the fly, but relay domains are always enabled.

Mail storage and Delivery:

The mysql configuration assumes that mail will be stored in /var/vmail/domain.com/username/Maildir. If you want to change the path from '/var/vmail/', you need to edit the file:

vexim/config/variables.php

and change 'mailroot' to the correct path. Don't forget the / at the end.

POP3 and IMAP daemons:

There are many POP3 and IMAP daemons available. Some that we have found that work are:

  • Courier: docs/clients/courierimap.txt
  • Dovecot: docs/clients/dovecot.txt

Dovecot provides more features (server-side sieve filters) and is more performant on larger setups.

UPGRADING: If you are upgrading, you will need to update your configs for your POP/IMAP daemons, as the database layout has changed. You should be able to follow the above instructions without problem.

Docker Compose setup

Minimalistic Docker Compose setup is provided in this repository. This setup is only meant for development, not for production use. It is configured to mount vexim/config/variables.php.example file as variables.php. Additionally, it will execute setup/mysql.sql during first boot, so make note of the initial siteadmin credentials which will be echoed by the db container among other output.

Upon boot, Vexim UI will be available on http://localhost, and MySQL database on localhost:3306. Both ports can be overridden by setting WEB_PORT and/or MYSQL_PORT environment variables when running docker compose.

vexim2's People

Contributors

alexpandele avatar avleen avatar chusopr avatar ikonia avatar kami-no avatar kvsmirnov avatar luqelinux avatar nklatt avatar nogo avatar omatosan avatar rimas-kudelis avatar runout-at avatar sgf-dma avatar soujak avatar udera avatar z3po avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vexim2's Issues

Sitechange broken

  • Go to the sitechangeadmin-page
  • click on disable spamassassin for all domain users

All settings will be lost (maximum accounts, max quota, max message size, ...) or set to 0.Perhaps something went wrong at the last submission (or was broken already before): 7114826

Running this query (https://github.com/avleen/vexim2/blob/master/vexim/sitechangesubmit.php#L59-L73) makes no sense if the user wants to disable spamassassin. The disable-spamassassin button activates a different form and all the variables won't be submitted.

I'm not sure if I understood this code correctly. Could you verify @Kami-no @rimas-kudelis ?

DKIM

Is there any reason why DKIM hasn't been touched so far? I'm pondering converting my text based dkim lookups into SQL lookups to integrate with vexim but before I dive in... :)

Use higher uid/gid for Vexim by default

In README.md, we currently instruct our users to create a system (low-uid) user for Vexim. This might not be such a good idea after all (e.g. Dovecot disallows logging in for users with uid lower than 500 by default – and for a good reason!). I think we should update the readme to instruct how to create a user with higher uid by by default, e.g. with uid between 500 and 999, or something.

At least in Debian, normal users get uid's starting from 1000. We probably want our user to be a bit special, but not as special as to have a really low uid.

Perl script create_db.pl encoding issues while migrating DB

I tried to upgrade my DB from older vexim2 version. There are really some different tables in new DB. After using --act=migratemysql option new DB was created successfully with all data from old DB, but cyrillic symbols into the table fields was totally broken, when the new DB was also at UTF8. I fixed this by adding some strings to script. Here's some code at line about 550:
if ($dbtype eq "mysql") {

$mydbh = DBI->connect("DBI:mysql:database=mysql;host=localhost", "$superuser", "$superpass", {'RaiseError' => 1});
$mydbh->do("set character set utf8");
$mydbh->do("set names utf8");
create_mysqldb();
create_mysqltables();
sleep 1;
add_mysqlveximuser();
add_siteadminuser();
print "Database created successfully!\n\n";
}

Dash in e-mailaddress/user-based aliases

I found several discussions about dashes in e-mail-addresses (e.g. http://comments.gmane.org/gmane.mail.exim.vexim.devel/1973). In the standard-configuration

local_part_suffix = -*
local_part_suffix_optional

is active. A nice thing for such a suffix is that you can easily use different addresses for specific purposes (e.g. [email protected]). But it is easy to guess your real address and the address for other purposes ([email protected]).

In the past, I used random addresses for different services (e.g. [email protected]). I created a forwarding address myself. Advantage of this method: if someone obtains my github-address, he won't be able to guess neither my amazon/banking/whatever-address nor my real address and I can easily disable it to prevent spam mails. Unfortunately, this technique only works for admin-users.

For me there are two questions:

  1. Is this local-suffix used a lot? If most users are restrained by it, it might be better to disable it by default
  2. If there is a bigger interest in some purpose-based alias which can be set up by each user. This could be a nice feature for vexim. Maybe even some temporary addresses?

Integrate Arne Schirmancher's patches into Vexim

https://www.schirmacher.de/display/INFO/improved+Vexim+frontend+and+bug+fixes has some improvements made over Vexim 2.2RC1:

  • Filtering Spam: allows moving spam messages into their dedicated folder
  • Rewriting Subject of Spam: implements per-user rules of spam subject rewriting
  • Improved German translation: assuming ours hasn't been touched for years, I don't see how that could hurt

Perhaps we should integrate some (all) of these into 2.3?

EDIT: there's a page by Axel Sjøstedt, which also offers some customizations, we should check these out as well: http://axel.sjostedt.no/misc/dev/vexim-customizations/

Newly created users can't log in.

When we use empty salt (or none at all) upon creating new users, the actual hashing algorithm depends on what PHP supports. For example, on my current desktop system, it is SHA-512. This is a problem, because:

  • the size of the crypt field in our database schema is way too small for SHA-512
  • if I'm reading correctly, starting with v. 5.3, PHP might support more hashing algorithms than the underlying OS. I guess this might mean that even if we increase the size of the crypted password field, the SMTP/POP3/IMAP4 daemon might not be able to authenticate against such hash.

Thus, in order to favor the config value we have available, we should always provide a salt.

A domain should not be created if its home dir cannot be created

If "Domain Mail directory" is filled incorrectly when creating a new domain (e.g. I had /var/vmail there, but this dir did not exist, and Apache didn't have permission to create it), Vexim will set new domain's homedir to /domain.name/ (instead of /var/vmail/domain.name/). This is wrong and the domain should not be created at all in such situation. Instead, a proper error message should be presented to the user.

Vexim - DNSBL is blocking authenticated users

Hi ... I'm having a problem with a new vexim installation on debian. Mailserver is working perfectly using the local installed roundcube webmail. If I configure a thunderbird on my PC I'm able to receive mails but I'm not able to send emails. It seems that DNSBL usage is blocking my outgoing mails (of cause yes because my PC has a dynamic address). I'm using the default configuration and ACL files from you package. I also tried to add a "Accept Authenticated = *" to the vexim-acl-check-rcpt.conf file but that doesn't help. Removing the hile deny dnslist... results in a relay not permitted message

Fix the `pw useradd` FreeBSD command in the manual

Quoting an e-mail to vexim-users from Yury Zyga:

i'm read README.md and will create user

manual command for freebsd contain a error
pw useradd vexim -u 1,100 -g "" -d /var/vmail -m -s /nonexistant

manual pw adduser
-u uid Specify the user/account numeric id.
contain only uid. not two options.

I understand the meaning was meant UID and GID. but why, if for example debian does not contain specific UID and GID?

propose edit REDME.md and change its string

pw useradd vexim -d /var/vmail -m -s /nonexistant

My guess is -u 1,100 was supposed to mean min and max uids, but it doesn't work that way. We should update our command in some way.

In addition to that, I've checked what shell the default users on FreeBSD have, and it seems we should use /usr/sbin/nologin instead of /nonexistent (the FreeBSD manpage for pw still says /nonexistent can be used for accounts which aren't supposed to log in, but I see no reason to do that).

Also, depending on how we choose to go with regards to #80, there are two different commands we could use to create a user.

  • If we decide to go with the first available uid above 500, we can use the following command:

    echo vexim:500:::::Vexim Email Owner:/var/vmail:/usr/sbin/nologin: | adduser -m no -w no -N -f -

  • OTOH if we decide to just go with a normal account, then here's Yury's suggestion with slight tweaks:

    pw useradd vexim -c "Vexim Email Owner" -d /var/vmail -m -s /usr/sbin/nologin

Disabled accounts should probably be inaccessible by all means possible

A few nights ago I suddently came to realization that even if we disable account, mail for it can still be checked out over IMAP and/or POP3, if the admin just follows our instructions.

Perhaps we should update these instructions to actually take into account the enabled/disabled status of the account (or even domain) which the user attempts to access? What do you folks think?

Enable logging in using unencrypted connections from localhost

In 4effffa, I changed the Exim configuration file we provide to require encryption when authenticating using PLAIN or LOGIN. IMO, it doesn't make much sense for connections from localhost, so we shouldn't require encryption when connecting from 127.0.0.1 and ::1 (and other IP addresses of the server we run on).

Remove remaining notions of the `clear` password field

Apparently, in #23 not all notions of the clear field were removed. This may have lead us to #35 and #36, where patches have been proposed which were supposed "fix" non-handling of that field in the code (basically by undoing #14).
We should get rid of these remnants.
@Udera, would you perhaps like to do this?

Some special characters in passwords ignored

If you want to set a password, some special characters like the $-sign are ignored (full list: ['";$%]). All form data is checked and these characters are removed in vexim/config/functions.php (due to a6dcb40). I want to use a pipe-command which contains a $-sign. Normally, the PDO::prepare()-command should "help" to prevent SQL injections. I'm no expert to tell if is sufficient to rely on this prepare()-command.

check passwort complexity

It would be very useful to check the complexity of a new/changed password
If the clear field disappears we have no chance to check later if people use strong passwords. And i really know... users just don't care... I see weak passwords on mail accounts too often!

I would suggest to include something like this
http://code.runnable.com/UmrnTejI6Q4_AAIM/how-to-validate-complex-passwords-using-regular-expressions-for-php-and-pcre
in vexim/config/functions.php: function crypt_password

domainguess, regex

Would be nice to have a config variable to strip subdomains for domainguess like:

$domainguess_lefttrim = "mail|vexim";

for usage in index.php (line 20)

if($domainguess===1) echo '@'.preg_replace ("/^".$domainguess_lefttrim."\./", "", $_SERVER["SERVER_NAME"]);

and login.php (line 14)

if($domainguess === 1 && $_POST['username']!=='siteadmin') $_POST['username'].='@'.preg_replace ("/^".$domainguess_lefttrim."\./", "", $_SERVER["SERVER_NAME"]);

quota does not work

i think quota should be given in Mbyte in
/docs/debian-conf.d/transport/30_vexim_virtual_delivery

quota = ${extract{quota}{$address_data}}
should be:
quota = ${extract{quota}{$address_data}}M

remove remaining shorttags

Please fix the remaining shorttags found in the latest download:

vexim # grep -rn "<?[^p]" *
adminuserchange.php:197:                <? if ($row['on_spamassassin'] == "1") {
adminuserchange.php:268:            <? echo _('Must be a full e-mail address'); ?>!<br>
adminuserchange.php:269:            <? echo _('OR') .":<br>\n"; ?>
siteadd.php:100:                value="0"><? echo _('Mb'); ?>
vexim #

db, field length too short

The field length if pop and smtp fields in the users table is too short.
It's only 255 bytes which is very less on long user/domain names.
I would suggest 4096 bytes for those fields. AFAIR 4096 is the spec for path length in the file system.

Useless code in vexim/sitechangesubmit.php

Code in vexim/sitechangesubmit.php after the line 98 is useless.
There are lines before:

if ($success) {
header("Location: site.php?updated={$_POST['domain']}");
die;
} else {
header("Location: site.php?failupdated={$_POST['domain']}");
die;
}

#52

No submit button on user edit page

Good day and thank you for this project. In this version i found one issue. When I'm trying to change users password I cant submit changes, because submit button doesnt exist.

Here is a screenshot:
vexim

Broken exim4-config on debian jessie

I tried to set up a new mail server on debian jessie. Unfortunately, there is still the string expansion problem in the headers_remove statements, like reported here:
http://www.gossamer-threads.com/lists/exim/users/100446

ref in our code:
https://github.com/vexim/vexim2/blob/master/docs/configure#L665-L676

related bug: https://bugs.exim.org/show_bug.cgi?id=1533
but this fix doesn't seem to be in the debian-jessie packages (neither in the testing).

So it makes vexim unusable for debian jessie at the moment.

Spam scanning: sa-exim or exiscan

I think there is incoherence between documentation and configuration with respect to SpamAssassin email scanning:

  1. README.md suggests the installation of sa-exim for Debian-like distribution,
  2. vexim-acl-check-content.conf invokes Exim internal scan.

Hence, in Debian-like systems the default behaviour is to make every message to be processed twice by SpamAssassin, which does not look desirable.

Prepare data migration scripts for 2.3

Our database structure has been changing over the years, and it looks like we never really had proper migration scripts.

I think we should provide them in 2.3 to make upgrades easier to users of older releases.

Encrypted connections for IMAP/POP/ Webserver

We made some efforts to implement a more secure password hashing, it would be a pity to transmit all these passwords through unencrypted connections. We have already fixed this in exim (4effffa).

For the web-interface, we should perhaps mention to use SSL connections and point to some guides.

For IMAP/POP servers, we should perhaps provide more detailed information. It's not really difficult, I can contribute my dovecot implementation in the next days. Would be nice if someone on courier could contribute his settings too.

Qpopper?

Spam-Handling

The updated debian-routers for exim contain a more advanced spam handling (https://github.com/avleen/vexim2/blob/master/docs/debian-conf.d/router/249_vexim_ditch_routers#L49). Unfortunately, this has not been introduced to this repo. I already updated the single configuration file #42 and the database-files #43.
We propably still need to update the vexim-webinterface. Perhaps, I will find some time the following days. If someone already has implemented this change, a pull request is welcome.

release

Hello, when the release is scheduled?

Use PDO instead of PEAR-DB

PHP has its own DB abstraction layer now. I think we should migrate to that from PEAR-DB which we're using now.

Mark disabled domains/account

In the list of domains or accounts, you won't see which one is not activated. You need to open the preferences. It would be better to mark them in a way, make them italic, other color...

Code fixes to be done before testing/release of v2.3

  • Migration scripts: #59
  • Enable spamassassin for all addresses of a domain: #69 PR: #123 and #125
  • [Design]->display disabled accounts differently: #86, PR #96
  • Fix login when domain/account is disabled: #PR: #99
  • Make sure the e-mailaddress is RFC-conform: #108
  • Single Login-field: #110

these topics are still in discussion, they are not needed for some basic testing:

  • Update config-files: #8
  • SSL-configuration: #45

@rimas-kudelis @Kami-no

I just put together a list of open issues that need to be solved before the new release. It would be great to fix them as soon as possible in order to proceed with testing. Testing can be used to improve the documentation.

Anything else?

Update the example exim config file and make sure that it works

I suspect that after 4effffa, our config might be partially unusable, because $tls_advertise_hosts is not defined in it, which IIRC means that STARTTLS won't be available, which in turn means that the user will never be able to authenticate to send email.

Furthermore, the variables $auth1, $auth2 and $auth3, which replaced $1, $2 and $3 in 0aa951a, don't work in Exim3. I don't think this is a problem, however, this means we should update our README file as well.

Move variables.php to variables.php.sample

It would be nice to move variables.php to variables.php.sample and to add variables.php to .gitignore

In this case you cat pull repo directly to the server with active installation and have no problem with own settings in the variables.php

email route process with chinese lang problem

hi,

i got vexim-2.2.1_1 , with exim -postgresql-4.77 running.

My problem was when receive email with content have chinese language, in the router section which scan message got defer because the database said with error :

HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.
WARNING: nonstandard use of escape in a string literal at character 108
HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.

this problem recorded in exim log :

== #####@####.com R=ditch_hdrfrom defer (-1): condition check lookup defer

When i check the mail header with exim -Mvh , the from content chinese character.

The postgresql database already set using UTF8 encoding.

When i disable the ditch_hdrfrom in router, the message delivered.

How to fix this encoding problem i guess...or how to fix this issue.

Thanks

Compatible Nginx?

Hello
Compatible with Nginx?
Or only to be used apache2 to manage email accounts?
Many greetings
Mz

headers_remove in exim configure file

There is a issue with this if/or condition missed or extra '}' '{' i cannot find it

headers_remove = ${if or { { <{$spam_score_int}{1} } \
                            { <{$spam_score_int} {${lookup mysql{select users.sa_tag * 10 from users,domains \
                               where localpart = '${quote_mysql:$local_part}' \
                               and domain = '${quote_mysql:$domain}' \
                               and users.on_spamassassin = 1 \
                               and users.domain_id=domains.domain_id} {$value}fail} } } \
                             { eq {0}{${lookup mysql{select users.sa_tag * 10 from users,domains \
                               where localpart = '${quote_mysql:$local_part}' \
                               and domain = '${quote_mysql:$domain}' \
                               and users.on_spamassassin = 0 \
                               and users.domain_id=domains.domain_id} {$value}fail} } } \
                           } {X-Spam-Score:X-Spam-Report} }

Two-factor authentification

E-mail accounts contain a lot of important information. Someone can get your e-mail password and gain access to your e-mails. At the moment, the attacker can as well login to vexim and change your password that you won't have access to your mails any more (and you cannot change the password yourself). With two-factor authentication, the attacker can still access all e-mails but he cannot change password or delete other users (in case of an admin-account).

In some webmail solutions (e.g. Roundcube), two-factor authentication can be activated. In my opition, it makes no sense because mails can be access via imap.

Configuration not straight

I appreciate the work that you have done with the project. I was forced to reinstall my very old debian server and now I use ubuntu. With this project I was able resetup my mail stack without much conversion regarding existing accounts. Thank you.

After it took me nearly a day to figure this out, I would to report this here as it may affect other, too.

I wanted to have the SPAM_REPORT hearder always in my mails, even if they are ham so i may look why spam was not identified.

Within vexim-acl-check-content.conf I have found the following configuration which tells me that it should do exactly what i want:

  # Always add X-Spam-Score and X-Spam-Report headers, using SA system-wide settings
  # (user "nobody"), no matter if over threshold or not.
  warn  message     = X-Spam-Score: $spam_score ($spam_bar)
        spam        = maildeliver:true
  warn  message     = X-Spam-Report: $spam_report
        spam        = maildeliver:true
  accept hosts      = 127.0.0.1:+relay_from_hosts
  accept authenticated  = *

However, non spam mails doesnt contain the header (used my corporate mail account to test it).

I found the following passage in the exim configuration example (docs/configure)

virtual_domains:
  driver = redirect
  domains = +local_domains
  address_data = ${lookup mysql{\
        select smtp, users.sa_tag*10 AS sa_tag, users.on_spamassassin AS on_spamassassin, \
        users.uid AS uid, users.gid AS gid, quota from users,domains \
        where localpart = '${quote_mysql:$local_part}' \
                and domain = '${quote_mysql:$domain}' \
                and domains.enabled = '1' \
                and users.enabled = '1' \
                and users.domain_id = domains.domain_id}{$value}fail}
  allow_fail
  data = ${extract{smtp}{$address_data}}
  headers_add = ${if and { \
                    {>{$spam_score_int}{${extract{sa_tag}{$address_data}}}} \
                    {eq{1}{${extract{on_spamassassin}{$address_data}}}} \
                    } {X-Spam-Flag: YES\n}{} }
  # Whether to use old or new headers_remove behavior.
  .ifndef OLD_HEADERS_REMOVE
    headers_remove = ${if or { { <{$spam_score_int}{1} } \
                              { and {{<{$spam_score_int}{${extract{sa_tag}{$address_data}}} } \
                                     {eq {1}{${extract{on_spamassassin}{$address_data}}}} \
                                    } \
                              } { eq {0}{${extract{on_spamassassin}{$address_data}}}} \
                            }  {X-Spam-Score}}
    headers_remove = ${if or { { <{$spam_score_int}{1} } \
                              { and {{<{$spam_score_int}{${extract{sa_tag}{$address_data}}} } \
                                     {eq {1}{${extract{on_spamassassin}{$address_data}}}} \
                                    } \
                              } { eq {0}{${extract{on_spamassassin}{$address_data}}}} \
                            }  {X-Spam-Report}}
  .else
    headers_remove = ${if or { { <{$spam_score_int}{1} } \
                              { and {{<{$spam_score_int}{${extract{sa_tag}{$address_data}}} } \
                                     {eq {1}{${extract{on_spamassassin}{$address_data}}}} \
                                    } \
                              } { eq {0}{${extract{on_spamassassin}{$address_data}}}} \
                            }  {X-Spam-Score:X-Spam-Report}}
  .endif
  .ifdef VEXIM_LOCALPART_SUFFIX
    local_part_suffix = VEXIM_LOCALPART_SUFFIX
    local_part_suffix_optional
  .endif
  retry_use_local_part
  file_transport = virtual_delivery
  reply_transport = address_reply
  pipe_transport = address_pipe

To archive my goal I have had to comment out the second passage in the OLD_HEADERS_REMOVE:

virtual_domains:
  driver = redirect
  domains = +local_domains
  address_data = ${lookup mysql{\
        select smtp, users.sa_tag*10 AS sa_tag, users.on_spamassassin AS on_spamassassin, \
        users.uid AS uid, users.gid AS gid, quota from users,domains \
        where localpart = '${quote_mysql:$local_part}' \
                and domain = '${quote_mysql:$domain}' \
                and domains.enabled = '1' \
                and users.enabled = '1' \
                and users.domain_id = domains.domain_id}{$value}fail}
  allow_fail
  data = ${extract{smtp}{$address_data}}
  headers_add = ${if and { \
                    {>{$spam_score_int}{${extract{sa_tag}{$address_data}}}} \
                    {eq{1}{${extract{on_spamassassin}{$address_data}}}} \
                    } {X-Spam-Flag: YES\n}{} }
  # Whether to use old or new headers_remove behavior.
  .ifndef OLD_HEADERS_REMOVE
    headers_remove = ${if or { { <{$spam_score_int}{1} } \
                              { and {{<{$spam_score_int}{${extract{sa_tag}{$address_data}}} } \
                                     {eq {1}{${extract{on_spamassassin}{$address_data}}}} \
                                    } \
                              } { eq {0}{${extract{on_spamassassin}{$address_data}}}} \
                            }  {X-Spam-Score}}
#    headers_remove = ${if or { { <{$spam_score_int}{1} } \
#                              { and {{<{$spam_score_int}{${extract{sa_tag}{$address_data}}} } \
#                                     {eq {1}{${extract{on_spamassassin}{$address_data}}}} \
#                                    } \
#                              } { eq {0}{${extract{on_spamassassin}{$address_data}}}} \
#                            }  {X-Spam-Report}}
  .else
    headers_remove = ${if or { { <{$spam_score_int}{1} } \
                              { and {{<{$spam_score_int}{${extract{sa_tag}{$address_data}}} } \
                                     {eq {1}{${extract{on_spamassassin}{$address_data}}}} \
                                    } \
                              } { eq {0}{${extract{on_spamassassin}{$address_data}}}} \
                            }  {X-Spam-Score:X-Spam-Report}}
  .endif
  # using local_part_suffixes enables possibility to use user-"something" localparts
  # which could cause you trouble if you're creating email-adresses with dashes in between.
  .ifdef VEXIM_LOCALPART_SUFFIX
    local_part_suffix = VEXIM_LOCALPART_SUFFIX
    local_part_suffix_optional
  .endif
  retry_use_local_part
  file_transport = virtual_delivery
  reply_transport = address_reply
  pipe_transport = address_pipe

Now i have the result i wanted. One additional note: While googling regarding this issue, i found many hints regarding amavis and to set the tag score to -99. The new tables doesnt support signed values and even after i changed the table shema, and set a tag score to -3 (my test messages got a 0) I didnt got the report in my headers.

I am not sure if that is intended or not so it is just reporting.

Best regards

Frank

Adding empty-password users through a bug in validate_password()

The latest update d06625b introduced a bug into the validate_password() function as it returns true for null values.
E.g.: siteaddsubmit.php line 82
if (validate_password($_POST['clear'], $_POST['vclear'])) returns true if clear and vclear input fields have been removed from the DOM before submitting.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.