I've read the tutorial posted by MountainX (Setup DKIM (DomainKeys) for Ubuntu, Postfix and Mailman), but I can't figure out how to apply these steps if I want to host and send e-mails for several domains. Does anybody have a clue?
I'm attempting to get postfix running on my server but keep getting the following error in my /var/log/mail.log
:
postfix/master[5041]: fatal: bind 0.0.0.0 port 25: Address already in use
I did some searching and found this excellent answer by Oli (regarding this very question) in which it's recommended that I basically rid my server of sendmail packages to avoid conflicts, then reinstall postfix, which will in turn install its own brand of sendmail. Unfortuantely it didn't quite solve the problem (see below for how).
I followed the instructions and ran the following check, to which I received an encouraging response:
$ dpkg -S `which sendmail`
postfix: /usr/sbin/sendmail
However when I started postfix again, I got the same error.
As per Oli's contingency, I looked for the process that was hogging port 25 with the following:
$ sudo netstat -pel | grep smtp
tcp 0 0 localhost.localdom:smtp *:* LISTEN root
35704126 27626/sendmail: MTA
But here's where it got confusing: I then looked for the process 27626
but was then told:
dpkg-query: no path found matching pattern 27626
connections.
I pulled up htop and was able to find the above PID associated with the following command:
sendmail:MTA: accepting connections
I then tried to kill the process with both killall sendmail
and killall 27626
and kept getting no process found
.
The problem is (besides the obvious) I don't know how to interpret these findings. I scrubbed the server of sendmail, so I can only assume that postfix's own version of sendmail is hijacking the port? I don't even know if that makes sense.
Anyway, if anyone could set me straight on this or at least give some interesting diagnostics questions, I'd appreciate it.
In case it's useful, I'm using virtualmin on the server to manage a few different domains and am also running wordpress.
Many thanks in advance!
In response to a request I've posted a ps -ef
below
root@upsmart:~# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Jan12 ? 00:00:00 init
root 2 1 0 Jan12 ? 00:00:00 [kthreadd/20017]
root 3 2 0 Jan12 ? 00:00:00 [khelper/20017]
root 68 1 0 Jan12 ? 00:00:00 upstart-udev-bridge --daemon
root 75 1 0 Jan12 ? 00:00:00 /sbin/udevd --daemon
root 110 1 0 Jan12 ? 00:00:00 /usr/sbin/sshd -D
root 130 75 0 Jan12 ? 00:00:00 /sbin/udevd --daemon
root 131 75 0 Jan12 ? 00:00:00 /sbin/udevd --daemon
root 175 1 0 Jan12 ? 00:00:00 upstart-socket-bridge --daemon
116 205 1 0 Jan12 ? 00:00:03 dbus-daemon --system --fork --activation=upstart
root 385 1 0 Jan12 ? 00:00:00 /usr/sbin/dovecot -F -c /etc/dovecot/dovecot.conf
root 386 1 0 Jan12 ? 00:00:04 cron
mysql 410 1 0 Jan12 ? 00:08:06 /usr/sbin/mysqld
dovecot 441 385 0 Jan12 ? 00:00:00 dovecot/anvil
root 442 385 0 Jan12 ? 00:00:00 dovecot/log
root 444 385 0 Jan12 ? 00:00:00 dovecot/config
syslog 445 1 0 Jan12 ? 00:00:08 /sbin/syslogd -u syslog
bind 474 1 0 Jan12 ? 00:00:12 /usr/sbin/named -u bind
clamav 844 1 0 Jan12 ? 00:01:34 /usr/sbin/clamd
clamav 951 1 0 Jan12 ? 00:03:27 /usr/bin/freshclam -d --quiet
list 969 1 0 Jan12 ? 00:00:00 /usr/bin/python /usr/lib/mailman/bin/mailmanctl -s -q start
list 970 969 0 Jan12 ? 00:01:03 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=ArchRunner:0:1 -
list 971 969 0 Jan12 ? 00:01:10 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=BounceRunner:0:1
list 972 969 0 Jan12 ? 00:01:03 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=CommandRunner:0:
list 973 969 0 Jan12 ? 00:01:07 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=IncomingRunner:0
list 974 969 0 Jan12 ? 00:01:01 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=NewsRunner:0:1 -
list 976 969 0 Jan12 ? 00:01:05 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=OutgoingRunner:0
list 978 969 0 Jan12 ? 00:01:06 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=VirginRunner:0:1
list 980 969 0 Jan12 ? 00:00:00 /usr/bin/python /var/lib/mailman/bin/qrunner --runner=RetryRunner:0:1
root 1410 1 0 Jan12 ? 00:00:00 /usr/sbin/saslauthd -a pam -m /var/spool/postfix/var/run/saslauthd -r
root 1413 1410 0 Jan12 ? 00:00:00 /usr/sbin/saslauthd -a pam -m /var/spool/postfix/var/run/saslauthd -r
root 2034 1 0 Jan12 ? 00:00:09 /usr/bin/perl /usr/share/usermin/miniserv.pl /etc/usermin/miniserv.con
proftpd 2054 1 0 Jan12 ? 00:00:07 proftpd: (accepting connections)
root 2096 1 0 Jan12 ? 00:00:13 /usr/bin/perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf
root 2173 1 0 Jan12 ? 00:00:15 /usr/sbin/console-kit-daemon --no-daemon
root 2241 1 0 Jan12 ? 00:00:07 /usr/lib/policykit-1/polkitd --no-debug
root 4895 1 0 03:15 ? 00:00:00 /usr/sbin/xinetd -dontfork -pidfile /var/run/xinetd.pid -stayalive -in
www-data 6494 30181 0 03:41 ? 00:00:06 /usr/sbin/apache2 -k start
www-data 6497 30181 0 03:42 ? 00:00:06 /usr/sbin/apache2 -k start
www-data 6499 30181 0 03:42 ? 00:00:06 /usr/sbin/apache2 -k start
www-data 6500 30181 0 03:42 ? 00:00:07 /usr/sbin/apache2 -k start
root 9477 30027 0 05:09 pts/5 00:00:00 sudo ps -ef
root 9478 9477 0 05:09 pts/5 00:00:00 ps -ef
root 27626 1 0 02:44 ? 00:00:00 sendmail: MTA: accepting connections
root 27902 110 0 02:51 ? 00:00:01 sshd: root@pts/4
root 27998 27902 0 02:51 pts/4 00:00:01 -bash
root 29931 110 0 02:59 ? 00:00:03 sshd: root@pts/5
root 30027 29931 0 02:59 pts/5 00:00:00 -bash
root 30181 1 0 03:00 ? 00:00:02 /usr/sbin/apache2 -k start
www-data 30183 30181 0 03:00 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 30636 30181 0 03:06 ? 00:00:13 /usr/sbin/apache2 -k start
I know this has been asked a hundred times. But I've done a lot of Google searching without success. My question: I want to log every activity of my postfix server. Neither the default file /var/log/mail
nor any other concerning mail
or postfix
exists.
- What's the exact string to put into the configuration file
/etc/postfx/main.cf
to enable logging? - Where can i see which configuration file postfix uses? (according to my hint below)
Thanks for your answers.
Hint: I use postfix together with dovecot. I installed meta package some months ago.
Output for postconf -n
:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
home_mailbox = Maildir/
inet_interfaces = all
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/conf.d/01-dovecot-postfix.conf -n -m "${EXTENSION}"
mailbox_size_limit = 0
mydestination = mydomain.de localhost
myhostname = mydomain.de
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_unknown_sender_domain
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/mail/vhosts
virtual_mailbox_domains = mydomain2.de
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_minimum_uid = 100
virtual_uid_maps = static:5000
Output for /etc/syslog.conf
# /etc/syslog.conf Configuration file for syslogd.
#
# For more information see syslog.conf(5)
# manpage.
#
# First some standard logfiles. Log by facility.
#
auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none;local0.none;local1.none -/var/log/syslog
#cron.* -/var/log/cron.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
lpr.* -/var/log/lpr.log
user.* -/var/log/user.log
#
# Logging for the mail system. Split it up so that
# it is easy to write scripts to parse these files.
#
# Logging for INN news system
#
news.crit -/var/log/news/news.crit
news.err -/var/log/news/news.err
news.notice -/var/log/news/news.notice
#
# Some `catch-all' logfiles.
#
*.=debug;\
auth,authpriv.none;\
news.none -/var/log/debug
*.=info;*.=notice;*.=warning;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages
#
# Emergencies are sent to everybody logged in.
#
*.emerg *
#
# I like to have messages displayed on the console, but only on a virtual
# console I usually leave idle.
#
#daemon,mail.*;\
# news.=crit;news.=err;news.=notice;\
# *.=debug;*.=info;\
# *.=notice;*.=warning /dev/tty8
# The named pipe /dev/xconsole is for the `xconsole' utility. To use it,
# you must invoke `xconsole' with the `-file' option:
#
# $ xconsole -file /dev/xconsole [...]
#
# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
# busy site..
#
daemon.*;mail.*;\
news.err;\
*.=debug;*.=info;\
*.=notice;*.=warning |/dev/xconsole
I'm running Ubuntu 12.04 with Postfix and Mailman. I want to set up DKIM. DomainKeys Identified Mail, or DKIM, is the successor to Yahoo's "DomainKeys". It incorporates Cisco's Identified Mail.
What are the steps for setting this up?
Is opendkim recommended?
The only reference I have is HowToForge, but I prefer to get help here (even if it is just a confirmation of the steps at that link). Actually, I think the info at HowToForge is outdated because it mentions dkim-filter instead of opendkim.
I have a couple of cron jobs that sometimes produce error output and would like to get a notification in my "real" email account, since I don't use my user's mailbox in my Ubuntu laptop, but cron (or is it postfix maybe) keeps trying to email the local root account.
I know I can add the MAILTO variable to the crontab:
ricardo@ricardo-laptop:~$ sudo crontab -l
[email protected]
# m h dom mon dow command
*/5 * * * * /home/ricardo/mrtg/cfg/run.sh
But it doesn't seem to pay any attention to it
I also tried adding my email to the /etc/aliases
file and running newaliases
ricardo@ricardo-laptop:~$ cat /etc/aliases
# See man 5 aliases for format
postmaster: root
root: [email protected]
ricardo: [email protected]
still, whenever cron wants to send an email it's still sending it to [email protected]
:
ricardo@ricardo-laptop:/var/log$ tail mail.log
Aug 3 16:25:01 ricardo-laptop postfix/pickup[2002]: D985B310: uid=0 from=<root>
Aug 3 16:25:01 ricardo-laptop postfix/cleanup[4117]: D985B310: message-id=<20100803192501.D985B310@ricardo-laptop>
Aug 3 16:25:01 ricardo-laptop postfix/qmgr[2003]: D985B310: from=<[email protected]>, size=762, nrcpt=1 (queue active)
Aug 3 16:25:03 ricardo-laptop postfix/smtp[4120]: D985B310: to=<[email protected]>, orig_to=<root>, relay=smtp.gmail.com[74.125.157.109]:25, delay=1.5, delays=0.38/0.02/0.9/0.18, dsn=5.7.0, status=bounced (host smtp.gmail.com[74.125.157.109] said: 530 5.7.0 Must issue a STARTTLS command first. d1sm12275173anc.19 (in reply to MAIL FROM command))
Any suggestions? I'm running Ubuntu 10.04, with everything up-to-date