Outgoing mail issues

Hrm, that’s unusual, those entries should both be in everything master.cf file by default.

Can you attach your /etc/postfix/master.cf file to the thread here?

-Eric

Attached as a text file

That’s your main.cf file, the Submission/SMTPS stuff we’re talking about would be in your master.cf file :slight_smile:

-Eric

Doh sorry!

OK uncommented…

submission inet n - n - - smtpd

The line

smtps inet n - n - - smtpd

is already uncommented

[root@babyandtoddlerworld ~]# /etc/init.d/postfix restart
Shutting down postfix: [ OK ]
Starting postfix: [ OK ]
[root@babyandtoddlerworld ~]# netstat -an | grep 587
tcp 0 0 46.38.189.235:587 0.0.0.0:* LISTEN
[root@babyandtoddlerworld ~]#

Okay, that’s good!

Now, configure Outlook so that when it connects, it connects to port 587, and uses SSL or TLS. If port 587 doesn’t work, try port 465.

-Eric

It’s still not liking it tried both SSL & TSL ports 587 & 465 and each time I get the same message…

‘Outlook cannot connect to the Outgoing SMTP email server’

The maillog on the server is only showing the POP connects and disconnects not SMTP attempts?

Whenever I try to connect to port 587 on your IP address, I receive a “No route to host” error.

Are you sure there isn’t a router or firewall in front of your server blocking that port?

-Eric

Got in contact with ISP and they advised me to add…

-A RH-Firewall-1-INPUT -m tcp -p tcp --dport 587 -j ACCEPT
-A RH-Firewall-1-INPUT -m tcp -p tcp --dport 465 -j ACCEPT

into the IP tables and restart the service.

Now seems to connect on port 465 with SSL, just doing some sending tests, just noticed a couple of things in the maillog, a warning and another line saying removed, are these issues I need to sort, if so how?

Sep 6 16:28:04 babyandtoddlerworld postfix/trivial-rewrite[9062]: warning: do not list domain babyandtoddlerworld.co.uk in BOTH mydestination and virtual_alias_domains

Sep 6 16:28:07 babyandtoddlerworld postfix/smtp[9064]: AC2A4130602: to=my_email_address@gmail.com, relay=gmail-smtp-in.l.google.com[209.85.227.27]:25, delay=2.6, delays=0.39/0.03/0.4/1.8, dsn=2.0.0, status=sent (250 2.0.0 OK 1315322877 et19si8816166wbb.3)

Sep 6 16:28:07 babyandtoddlerworld postfix/qmgr[13177]: AC2A4130602: removed

Ah, so that means you’re running a firewall on your own server.

That’s not the default… so that means anytime you’re trying to run a new service on your system, you’ll need to add a line similar to what you did above for that new service.

As far as your mail log entries go – those are all okay. The warning is safe to ignore, and the other entries are typical entries that you’d see in the mail log.

-Eric

OK thanks, I’m nearly there now I think, sending seems to be working after a couple of test, just trying to work out what’s going on with the incoming mail seems to be hitting the server however not arriving in the mailbox for collection see this extract from the maillog below, what is wrong?

Sep 6 16:56:17 babyandtoddlerworld spamd[1214]: spamd: clean message (3.6/5.0) for marketing.btw:502 in 0.5 seconds, 12159 bytes.
Sep 6 16:56:17 babyandtoddlerworld spamd[1214]: spamd: result: . 3 - EXTRA_MPART_TYPE,HTML_MESSAGE,RCVD_NUMERIC_HELO scantime=0.5,size=12159,user=marketing.btw,uid=502,required_score=5.0,rhost=localhost,raddr=127.0.0.1,rport=59924,mid=F16D267CFC28A74886C6676F4FDE110E710D11@officeserver.xxxxx.local,autolearn=no
Sep 6 16:56:17 babyandtoddlerworld postfix/local[9943]: D7AA3130600: to=marketing.btw@babyandtoddlerworld.co.uk, orig_to=marketing@babyandtoddlerworld.co.uk, relay=local, delay=1.1, delays=0.06/0.01/0/1.1, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Sep 6 16:56:17 babyandtoddlerworld postfix/qmgr[13177]: D7AA3130600: removed
Sep 6 16:56:17 babyandtoddlerworld spamd[1143]: prefork: child states: II

Well, it looks like it’s being delivered… the next step would be to look at /var/log/procmail.log to see where exactly procmail is delivering it.

-Eric

Says…

User:marketing.btw Size:2904 Dest:/var/mail/marketing.btw Mode:None

I can actually see test messages I’ve sent to the email address using the ‘Read User Mail’ in Virtualmin however Outlook isn’t collecting it now for some reason. There are no errors Outlook seems to check the mailbox OK however no mail is actually being downloaded.

This is odd as tests I ran much earlier prior to getting the outgoing SMTP working were collected by Outlook so something must have changed/be different now.

How can I fix/troubleshoot this?

So, your email is being delivered, but to the wrong place.

Virtualmin will read email from anywhere, but since it’s being delivered incorrectly, it’s not accessible from Outlook.

What does your /etc/procmailrc file contain?

Also, to fix the “fatal: open database /etc/aliases.db: No such file or directory” error, you can run the command “newaliases”.

-Eric

Here’s the contents of /etc/procmailrc…

LOGFILE=/var/log/procmail.log
TRAP=/etc/webmin/virtual-server/procmail-logger.pl
:0wi
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME
EXITCODE=$?
:0

  • ?/usr/bin/test “$EXITCODE” = “73”
    /dev/null
    EXITCODE=0
    :0
  • ?/usr/bin/test “$VIRTUALMIN” != “”
    {
    INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN
    }
    DEFAULT=/var/mail/$LOGNAME
    ORGMAIL=/var/mail/$LOGNAME
    DROPPRIVS=yes
    :0
    $DEFAULT

I did add a new mail user so do I have to run the newaliases command everytime I add an alias?

It looks like some incorrect lines got in there somehow… try replacing these 5 lines at the end:

DEFAULT=/var/mail/$LOGNAME ORGMAIL=/var/mail/$LOGNAME DROPPRIVS=yes :0 $DEFAULT

With these 3 lines:

ORGMAIL=$HOME/Maildir/ DEFAULT=$HOME/Maildir/ DROPPRIVS=yes

And no, you don’t need to run newaliases each time.

-Eric

Thanks Eric, just sent a test and received it from the pop box so I think that this has solved it! Thank you very much for the help you have given me.

Further to this old issue I have just seen this reoccur again we updated packages on the server and procmailrc was overwritten again as described above, what can I do to stop this from happening in the future?

Howdy,

Do you happen to know what package caused the update?

Or do you have a list of packages that were updated recently?

And can you remind me what distro you’re using?

-Eric

Is there a log somewhere I can view showing packages that have been updated?

Operating system CentOS Linux 5.6
Virtualmin version 3.96.gpl GPL
Webmin version 1.600
Kernel and CPU Linux 2.6.35.4-rscloud on x86_64

You can see the packages updated on a CentOS system by looking in /var/log/yum.log.

-Eric