SMPT server available ?

Hi,

I am wanting to make use of "swift mail server" as if is supposed to be better than sendmail.

In the SWIFT docs it says this:

"The SMTP connection is probably the most heavily used connection, and almost certainly the most consistent and portable. This connection opens up a socket with TCP and speaks â

Postfix is the SMTP server on your system. Configure it to connect to localhost on port 25, and everything should be fine. Local connections do not need to authenticate.

Actually, I should mention that my previous comment assumes you have a system installed using our automated installer (install.sh). If you installed Virtualmin manually, you may have used any of four mail servers (Postfix, qmail, Sendmail, or exim). But, in pretty much all cases, assuming your mail server is correctly configured, you would configure any local clients to connect in the same way (SWIFT is no different than any other SMTP client).

The server was set up by yourselves for me, so I don’t know what is the default mail server. How do I check ?

Maybe I am set up to use Sendmail ?

Under the Postfix Mail Server, General Options,
I have this config:

Should the receiving emails not be set fot the whole machine ?
Why is it set for:
$myhostname, localhost.$mydomain, localhost, rm-1003-06

Thanks

On my dedicated server, I have about 20 virtual servers.

I would like to allow all these virtual servers to be able to use Swift to send emails butI don want to have 20 different copies of the swift directory under each of the virtual servers home directory.

Do you know where I should place the Swift dir. and if I need to configure Swift so that it is available to all the virtual servers?

Thanks

With Postfix, domains that are allowed to send emails are added to the /etc/postfix/virtual file – that is done automatically by Virtualmin anyone a new domain is added. Virtualmin also handles setting up aliases and forwards by adding them to that file.

I’m not familiar with Swift, so I can’t speak to how you’d use it. However, Postfix is the recommended (and easiest!) mail server software to use with Virtualmin. Using it means that all the email details will be handled for you – email accounts, aliases, and forwards are all added by Virtualmin, you don’t have to deal with any of that.

You can see what mail server your system is configured to use by going into System Settings -> Module Config and then looking at the "Mail server to configure" option – which by default is Postfix.
-Eric

OK

I checked the Module Config, and yes I am running Postfix.

Does that mean that that there is no need (or value) in looking at the sendmail settings ?

I will have to asl Swift if there is any benefit in running their module "through" Postfix.

One other question:
Does that mean that when I use the php command mail
i.e.:
mail($to, $subject, $message, $headers) ;

this actually will use Postfix to send the mail ?

Thanks for helping me to understand this :slight_smile:

Does that mean that that there is no need (or value) in looking at the sendmail settings ?

Don’t confuse the MTA (mail transfer agent) Sendmail with the command line tool sendmail. They are historically related, but not in modern systems…most MTAs on UNIX provide a “sendmail” command line tool, and most are compatible with the original sendmail command of old. sendmail, in this context, is almost certainly a command that injects mail into an SMTP server of some sort…and will behave the same whether you use Postfix or Sendmail as your MTA.

I suspect you’re making this too complicated. Stop thinking so hard about it…mail is easy. :wink:

I also have no experience with SWIFT, but I know that every mail sending library I’ve ever seen provides a few basic settings that relate to the SMTP server: hostname or address, port number, and optionally authentication details. Some also allow selection of using some other command to inject the mail, such as sendmail. However, you’ve already expressed concerns over performance, and seemingly you’re using this new library explicitly to avoid using sendmail (I really doubt you need to go to this trouble…I always suggest people take the easiest path first, and if things turn out to be too slow, or not do something you need later, then worry about complexifying your architecture…I kinda suspect you’re making your life more complicated than it needs to be by introducing a new library in place of existing tools), so I’m guessing you don’t want to configure SWIFT to use sendmail.

Don’t confuse yourself worrying about what SMTP server is in use–it doesn’t matter. They all speak the same protocol, and only one of them will ever be running on port 25 on localhost…so, if the one running is Postfix, and you configure your mail client library to talk to localhost on port 25, you can’t possibly get it wrong.

Thanks very much for the time you took out to write that reply.

I don’t think I was mixing up the sendmails. But it is my fault for not capitalizing the “s”. I should have written:

"Does that mean that that there is no need (or value) in looking at the Sendmail settings ?" ( instead of sendmail settings)

I meant that if I am using Postfix thenI should look at Postfix control panel and ignore all settings in the Sendmail control panel.

I think you have confirmed that when you wrote: "They all speak the same protocol, and only one of them will ever be running on port 25 on localhost…"

I assume that my php script that uses mail() function to send the email will send it via my chosen mail server - ie Postfix. And therefore the config I do on the Postfix control panel will effect all my mail scripts ( I have about 30 virtual servers that will send email from time to time)

Hope I have got that correct.

As you say - I will drop the use of Swift for a while and I’ll test it later on (if I ever get time to do so) Swift is supposed to do a lot of checlig to prevent mail injection and to allow better control of multiple email sending.

Thanks

Indeed, any configuration you do within Postfix will affect all email coming from PHP’s mail() function.

So yeah, it’s either Postfix or Sendmail – and since Postfix is what you have running on your machine now (which is good!), any configuration you do in the Sendmail module would go unused.
-Eric

Great - thats what I thought :slight_smile:

I just read this in the documentation for Swift.

Upload the lib directory via FTP or whatever facility your web host provides to upload files and rename it if you desire to do so. Swift does not need to be inside the web root, but it does need to be in a location which you are able to refer to in your PHP scripts which will use it (i.e. PHP needs to be able to see it, but your end-users donâ