Giter Club home page Giter Club logo

Comments (7)

tomav avatar tomav commented on May 13, 2024

Hi @GerrAlt12, I'm trying to reproduce but I need more information.
This is what I tried to match your usecase:

docker run --name mail -v "$(pwd)/postfix":/tmp/postfix -v "$(pwd)/spamassassin":/tmp/spamassassin -p "25:25" -p "143:143" -p "587:587" -p "993:993" -h mail.my-domain.com -ti tvial/docker-mailserver bash

root@mail:/# /bin/sh -c /usr/local/bin/start-mailserver.sh
Regenerating postfix 'vmailbox' and 'virtual' for given users
user 'user' for domain 'domain.tld' with password '********'
Postfix configurations
Fixing permissions
Creating /etc/mailname
Configuring Spamassassin
Starting daemons
 * Starting enhanced syslogd rsyslogd                                                                                                                                         [ OK ]
 * Starting file alteration monitor FAM
   ...done.
 * Starting  saslauthd                                                                                                                                                        [ OK ]
 * Starting Courier authentication services authdaemond                                                                                                                       [ OK ]
 * Starting Courier IMAP server imapd                                                                                                                                         [ OK ]
 * Starting Courier IMAP-SSL server imapd-ssl                                                                                                                                 [ OK ]
Starting SpamAssassin Mail Filter Daemon: spamd.
 * Starting ClamAV daemon clamd
LibClamAV Warning: **************************************************
LibClamAV Warning: ***  The virus database is older than 7 days!  ***
LibClamAV Warning: ***   Please update it as soon as possible.    ***
LibClamAV Warning: **************************************************
                                                                                                                                                                              [ OK ]
Starting amavisd: amavisd-new.
 * Starting Postfix Mail Transport Agent postfix                                                                                                                              [ OK ]
Listing SASL users
[email protected]: userPassword
Starting...
Aug 25 22:13:46 mail amavis[553]: No decoder for       .doc  tried: ripole
Aug 25 22:13:46 mail amavis[553]: Found decoder for    .cab  at /usr/bin/cabextract
Aug 25 22:13:46 mail amavis[553]: No decoder for       .tnef
Aug 25 22:13:46 mail amavis[553]: Internal decoder for .tnef
Aug 25 22:13:46 mail amavis[553]: Found decoder for    .exe  at /usr/bin/arj
Aug 25 22:13:46 mail amavis[553]: Using primary internal av scanner code for ClamAV-clamd
Aug 25 22:13:46 mail amavis[553]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan
Aug 25 22:13:46 mail amavis[553]: Deleting db files  in /var/lib/amavis/db
Aug 25 22:13:46 mail amavis[553]: Creating db in /var/lib/amavis/db/; BerkeleyDB 0.54, libdb 5.3
Aug 25 22:13:46 mail postfix/master[655]: daemon started -- version 2.11.0, configuration /etc/postfix

Everything starts as expected.
And the telnet result:

  ➜  ~  telnet 192.168.59.103 25
  Trying 192.168.59.103...
  Connected to 192.168.59.103.
  Escape character is '^]'.
  220 mail.my-domain.com ESMTP Postfix (Ubuntu)

Again, it seems Ok.
Could you tell me more about that?

from docker-mailserver.

GerrAlt12 avatar GerrAlt12 commented on May 13, 2024

I have following log:

root@docker:~# /bin/sh -c /usr/local/bin/start-mailserver.sh
Regenerating postfix 'vmailbox' and 'virtual' for given users
sed: can't read /tmp/postfix/accounts.cf: No such file or directory
/usr/local/bin/start-mailserver.sh: 10: /usr/local/bin/start-mailserver.sh: cann ot open /tmp/postfix/accounts.cf: No such file
/etc/courier/userdb: not found.
cp: cannot stat '/tmp/postfix/virtual': No such file or directory
Postfix configurations
postmap: fatal: open /etc/postfix/virtual: No such file or directory
cat: /tmp/vhost.tmp: No such file or directory
rm: cannot remove '/tmp/vhost.tmp': No such file or directory
Fixing permissions
Creating /etc/mailname
Configuring Spamassassin
cp: cannot stat '/tmp/spamassassin/rules.cf': No such file or directory
Starting daemons

  • Starting enhanced syslogd rsyslogd [ OK ]
  • Starting file alteration monitor FAM
    ...done.
  • Starting saslauthd [ OK ]
  • Starting Courier authentication services authdaemond [ OK ]
  • Starting Courier IMAP server imapd [ OK ]
  • Starting Courier IMAP-SSL server imapd-ssl [ OK ]
    Starting SpamAssassin Mail Filter Daemon: spamd.
  • Starting ClamAV daemon clamd [ OK ]
    Starting amavisd: changed ownership of '/var/run/amavis' from root:root to amavis:amavis
    amavisd-new.
  • Starting Postfix Mail Transport Agent postfix [ OK ]
    Listing SASL users
    Starting...
    Aug 26 05:23:52 docker amavis[1132]: No decoder for .doc tried: ripole
    Aug 26 05:23:52 docker amavis[1132]: Found decoder for .cab at /usr/bin/cabextract
    Aug 26 05:23:52 docker amavis[1132]: No decoder for .tnef
    Aug 26 05:23:52 docker amavis[1132]: Internal decoder for .tnef
    Aug 26 05:23:52 docker amavis[1132]: Found decoder for .exe at /usr/bin/arj
    Aug 26 05:23:52 docker amavis[1132]: Using primary internal av scanner code for ClamAV-clamd
    Aug 26 05:23:52 docker amavis[1132]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan
    Aug 26 05:23:52 docker amavis[1132]: Deleting db files in /var/lib/amavis/db
    Aug 26 05:23:52 docker amavis[1132]: Creating db in /var/lib/amavis/db/; BerkeleyDB 0.54, libdb 5.3
    Aug 26 05:23:55 docker postfix/master[1226]: fatal: open lock file /var/lib/postfix/master.lock: cannot open file: Permission denied

Looks like docker run command does not execute correctly - no volume mounted

Maybe I can edit start-mailserver.sh script for correct volume mount?

from docker-mailserver.

tomav avatar tomav commented on May 13, 2024

Yep. I don't have your dockercommand line to see if it's correct or not, but it seems that you don't mount the postfix/accounts.cf to /tmp/postfix/accounts.cf.
Have a look to the documentation to fix it.

You can also modify the start-mailserver.sh script, but this image already does what you probably want to do.

I'll try to add a check in start-mailserver.sh to die if the mandatory files are not found.

Let me know if it's ok.

from docker-mailserver.

GerrAlt12 avatar GerrAlt12 commented on May 13, 2024

Unfortunately now I don't see any way to run "docker run" exactly as you describe because I use Jelastic, and I can execute any commands only inside the container (Jelastic docs have no remarks about such possibilities).

Now I have script for create /tmp/postfix dir and add files accounts.cf, main.cf, master.cf from your examples located in this repo. I run this script from second line of start-mailserver.sh. Now I see only one error about Permission denaided - last line in my log.

from docker-mailserver.

GerrAlt12 avatar GerrAlt12 commented on May 13, 2024

I think I have issue with permissions on some lib or dir, I will check all permissions.

I think checking for mandatory files is nice idea, better execute all functionality correctly or perform no execution at all

from docker-mailserver.

tomav avatar tomav commented on May 13, 2024

Since your problem is related to your specific environment, I close this issue.
A added a check as proposed above for better understanding.

I'll let you know when the updated image will be available on the docker registry.

from docker-mailserver.

tomav avatar tomav commented on May 13, 2024

Done. You can now docker pull tvial/docker-mailserver.

from docker-mailserver.

Related Issues (20)

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.