Inbound mail and IPtables

cancel
Showing results for 
Search instead for 
Did you mean: 
opsys
Active Member II

Inbound mail and IPtables

Jump to solution

Hello everybody

Excuse me if it is a dumb question but I'm new in this forum.

I'm setting a Alfresco community server with Ubuntu 18.4 for testing and so far so good.

I have a problem for inbound mail (outbound is fine). The inbound is working BUT only via telnet and with a specific  port (2525).

I configured the inbound like that :

#Inbound
email.server.enabled=true
email.inbound.enabled=true
email.server.port=2525
email.server.domain= mydomain.com
#email.inbound.unknownUser=anonymous

I then tested with :

telnet mydomain.com 2525 
ehlo mydomain.com
mail from: <testuser@anotherdomain.com> 
rcpt to: <aliasoffolder@mydomain.com>
data
this is a test
.
quit

I can find the test email delivered in the proper folder 

But it is just impossible to do the same with port 25 (thus with a standard email client going thru a normal SMTP server)

So far there are no firewalls in the server or router.

I understand that Tomcat cannot bind to port 25 and consquently a NAT redirection is needed.

The problem seems to come from the command :

sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 25 -j REDIRECT --to-port 2525

I wonder if this is enough ?

Alternatively can Tomcat use port 25 ?

 

Thanks a lot in advance for some help, I'm getting mad with that problem...

1 Solution

Accepted Solutions
opsys
Active Member II

Re: Inbound mail and IPtables

Jump to solution

I found the solution of my problem

sudo iptables -t nat -A PREROUTING -p tcp --dport 25 -j REDIRECT --to-port 2525

View solution in original post

3 Replies
opsys
Active Member II

Re: Inbound mail and IPtables

Jump to solution

I found the problem. The right command is :

sudo iptables -t nat -A PREROUTING -p tcp --dport 25 -j REDIRECT --to-port 2525

I use the inbound as such :

I created a folder with email alias "dropbox" 

I have a regular mail server and standard email. I created a rule in the mailbox that says :

if object contain "dropbox" then transfer to  dropbox@mydomain.com

So when somenone needs to send some files by email, he just put the word "dropbox" in the object and it's automatically received in my dropbox folder.

The body of the mail is in another document but is not very useful. 

opsys
Active Member II

Re: Inbound mail and IPtables

Jump to solution

I found the solution of my problem

sudo iptables -t nat -A PREROUTING -p tcp --dport 25 -j REDIRECT --to-port 2525
EddieMay
Alfresco Employee

Re: Inbound mail and IPtables

Jump to solution

Hi @opsys,

So glad you solved your problem. Thanks also for posting your solution - helpful to other users.

Cheers, 

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!