PHPlist -- not receiving bounced emails - email

I am running a Centos 6 VPS and Plesk 11. I am sending a test campaign to my own address and to a fictitious nonsense address and I am receiving the email at my account but I am not receiving any bounces from the nonsense address. My settings in the config.php file are:
$message_envelope = 'bounces#mydomain.com';
$bounce_protocol = 'pop';
$bounce_mailbox_host = 'localhost';
$bounce_mailbox_user = 'bounces#mydomain.com';
$bounce_mailbox_password = 'XXXXXX';
What's the next step in figuring out the problem? I also tried both variations of the following:
$bounce_mailbox_port = "110/pop3/notls";
#$bounce_mailbox_port = "110/pop3";
Configuration appears to be correct?

Figured this out -- after contacting my ISP I discovered I had exceeded my limit on SMTP relays. The bounces are working now -- they're just in the queue.

Related

ASP Classic Email '80040213' The transport failed to connect to the server

I know there are plenty of questions out there with this but none seem to have an answer which works for me.
My application is ASP Classic, the server it is running on is Windows Server 2000 (very old I know), I am using an Office365 server and I'm using the information provided by the Office365 when I login to the email (Port 587, correct username and password, correct smtp server, TLS set to true).
I always get "CDO.Message.1 error '80040213' The transport failed to connect to the server." as an error message, the line it errors on is the .Send command.
Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort = 2
Const cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort = "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout = "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthenticate = "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic = 1
Const cdoSendUserName = "http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword = "http://schemas.microsoft.com/cdo/configuration/sendpassword"
'Use SSL for the connection (False or True)
Const cdoSendTLS = "http://schemas.microsoft.com/cdo/configuration/smtpusessl"
' create CDOSYS objects
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
'Set our smtp server
objCDOSYSCon.Fields.Item(cdoSMTPServer) = "smtp.office365.com"
objCDOSYSCon.Fields.Item(cdoSMTPAuthenticate) = cdoBasic
objCDOSYSCon.Fields.Item(cdoSendUserName) = "my.email#email.com"
objCDOSYSCon.Fields.Item(cdoSendPassword) = "password"
'objCDOSYSCon.Fields.Item(cdoSMTPServerPort) = 587
objCDOSYSCon.Fields.Item(cdoSendUsingMethod) = cdoSendUsingPort
objCDOSYSCon.Fields.Item(cdoSendTLS) = True
objCDOSYSCon.Fields.Item(cdoSMTPConnectionTimeout) = 30
objCDOSYSCon.Fields.Update
'Use our new configurations for our mailer
Set objCDOSYSMail.Configuration = objCDOSYSCon
strSpecFile = Application("px683_network_downloads_specs") & strSpecFileName
objCDOSYSMail.From = "to.email#email.com"
objCDOSYSMail.To = "my.email#email.com"
objCDOSYSMail.Subject = "A subject"
objCDOSYSMail.HTMLBody = "Some text for the body"
'Normal level of importance
objCDOSYSMail.Send
set objCDOSYSMail = nothing
set objCDOSYSCon = nothing
I have tried with port 25 without any luck as well. If I use another email service which doesn't use SSL at all (local service, not Office365) I have no issue (I comment out usessl and change the port to 25). Additionally if I try to use a different email service which I have running flawlessly in an ASP.Net application I get the same issues, this other email service uses port 25 and SSL and is not an Office365 service.
I have had this issue before. Basically you're not being authenticated to use the mail transport on the server.
Either your SMTP server isn't allowed to send outbound mail (e.g. to stop mail relay), you're username and password are incorrect or the port you are using needs a higher security level to send the mail. In the later instance it could be that Office365 requires SSL auth...maybe worth looking there.
If all else fails you can try using a 3rd party provider. We use SendInBlue on their £4.35 package. You're allowed to send up to 40,000 emails through their system. We found that sending the mail to a 3rd party totally removes issues over server settings stopping the mail transport function. We use this for both Classic ASP and PHP sites now.
Hope that helps.
I was finally able to get this working by moving the application to a Windows Server 2012 machine. I had to jump through a couple of loops which come with moving something that old between servers but I was able to get it working.
I was only able to use Port 25, 587 doesn't work. Keep in mind I tried port 25 on the original server and that didn't work there either.
With Office 365 and CDO you have to use port 25, even if you're using authenication. Looking at your code I think the port is the only thing to change, but here's a tried and tested configuration.
Set iConfg = Server.CreateObject("CDO.Configuration")
Set Flds = iConfg.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.office365.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "myaccount#mydomain.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"
.Update
End With
objMail.Configuration = iConfg

How to sent postfix bounce to another SMTP server

How do I send postfix bounce to another SMTP server?
I have 2 postfix server (server_A and server_B).
I need the bounce generated from server_A sent to Internet by server_B.
Half a year late... You should try adding this into your main.cf file located in your postfix directory:
notify_classes = bounce, 2bounce
bounce_notice_recipient = <server_B mail address>
2bounce_notice_recipient = <server_B mail address>
*Feel free to include other options in your notify_classes (eg. delay, policy, protocol, resource, software, data) if needed
Addition info: http://www.postfix.org/postconf.5.html#notify_classes

The transport error code was 0x80040217 - cannot send using asp.classic and CDO

According to the many posts on the web, the error message
The message could not be sent to the smtp server. The transport error code was 0x80040217. The server response was not available
Basically means it doesn't authenticate because of a faulty user name/password
The problem I have is I run the mail server. I push emails on my .net websites fine, this issue only exists when using CDO
The email, username and password are correct, it's stored in plain text in the .asp file
Set MyMail = Server.CreateObject("CDO.Message")
Set MyConfig = Server.CreateObject ("CDO.Configuration")
'MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "name#example.co.uk"
'MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "passwordIsHere"
MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1" 'also tried with localhost, the actual IP of server and mail.example.co.uk (which is set up correctly)
MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587 ' also tried 25
MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
MyConfig.Fields.Update
Any ideas why, on my W2012 server, I can run my asp.classic website, but cannot send the email?
The email account works fine when I send mail from MS outlook. The fault is only here, in the script.
So after a weird conversion in the comments
The issue is likely because (with correct syntax highlighting) the sendusername and sendpassword CDO.Configuration properties are commented out, so it is likely the mail server is failing to authenticate.
Just remove the comments and you should be good to go.
Set MyMail = Server.CreateObject("CDO.Message")
Set MyConfig = Server.CreateObject ("CDO.Configuration")
MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "name#example.co.uk"
MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "passwordIsHere"
MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1" 'also tried with localhost, the actual IP of server and mail.example.co.uk (which is set up correctly)
MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587 ' also tried 25
MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
MyConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
MyConfig.Fields.Update

Fail2ban not sending email notifications

My CentOS server has postfix as MTA and it’s working.
When I type the command mail -s "testing" <my gmail address>, I receive the email.
However, Fail2ban is unable to send emails to my gmail address when an IP gets banned. I’m probably missing some configuration in jail.conf.
Here is part of my jail.conf file:
destemail = myaddress#gmail.com
sendername = fail2ban
mta = sendmail
protocol = tcp
action = %(action_mwl)s
I already tried mta = postfix and it didn’t work.
Thanks in advance for your help.
EDIT: I was able to make it work. None of the configuration above is correct for my fail2ban v0.8.10 and my linux CentOS 6. In fact, I removed all the lines above (garbage).
I found a pre-defined action in /etc/fail2ban/action.d/mail.conf file.
I noticed this action uses "mail -s" command which works on my server.
So, I decided to use this action in my jail.conf file as such:
[ssh-iptables]
enabled = true
filter = sshd
action = iptables[name=SSH, port=ssh, protocol=tcp]
mail[name=ssh, dest=my-address#gmail.com]
logpath = /var/log/secure
maxretry = 5
The only thing that needs to be change to get an email from fail2ban is to add that line below “action” that starts with “mail.” Very simple and easy.
You should change mta = sendmail to:
mta = mail
if you want email notifications with whois i found this solution
[sshd]
enabled = true
logpath = %(sshd_log)s
action = iptables-ipset-proto6[name=ssh, port=ssh, protocol=tcp, bantime=0]
mail-whois[name=sshd, dest=my-email#something.com]
findtime = 3600
bantime = -1
maxretry = 3
All of the above did not work for me.
What worked for me was adding second line under action =....
to be:
sendmail[mailcmd='/usr/sbin/sendmail -f "<sender>" "<dest>"', dest="email#recipient.com", sender="fail2ban", sendername="Fail2Ban", name="jail_name"]
Note: You may do so for various jails.
Also note, that if you would like to get an email notification for ModSecurity, you can do so, by setting a Fail2Ban jail for ModSecurity, and then get the email notifications.

How configure roundcube to work with imaps?

I recently installed Postfix, Dovecot to setup a mail server on my own VPS ( using this tutorial: Email with Postfix, Dovecot, Mysql)
Imaps server uses port 993 for Authentication, and Postfix uses port 25 to send mails.
In this tutorial, users stored in a Database ( so imaps use mysql to authenticate users).
i'm sure every thing works fine with imaps and postfix , because few days ago i installed Kmail client (on my linux) and receive mails from my server. sending mails also works fine, i sent a mail to Gmail and google received it without a problem (in my "Gmail inbox" not spam folder)
So to get to my Emails from a web mail client, i installed Roundcube on /var/www/mail directory.
I configured Roundcube many times. but each time it gives me this Error:
IMAP Error: Login failed for [me#mydomain] from X.x.X.x . Empty
startup greeting (localhost:993) in
/var/www/mm/program/lib/Roundcube/rcube_imap.php on line 184 (POST
/mm/?_task=login?_task=login&_action=login)
When i do log in from roundcube, imap server says ( in /var/log/mail.log ):
May 20 07:05:16 my-server dovecot: imap-login: Disconnected (no auth
attempts): rip=::1, lip=::1, TLS handshaking: Disconnected
Here is my roundcube config file :
$config['db_dsnw'] = 'mysql://roundcubeuser:myPassword#localhost/roundcubemail';
// ----------------------------------
// IMAP
// ----------------------------------
$config['debug_level'] = 13;
$config['default_host'] = 'ssl://127.0.0.1';
$config['default_port'] = 993;
// ----------------------------------
// SMTP
// ----------------------------------
$config['smtp_server'] = 'ssl://localhost';
What's the problem? i really have no idea what is happening !
Thank you.
I'm using postfix + dovecot + roundcube a few months now and it's working for me. In my configuration, postfix rejects plaintext sessions, so roundcube has to connect with ssl - and it's working.
This is from my main.inc.php. I don't remember editing anything here, it's just the initial config created during the installation.
Now that I'm looking at it, default_port doesn't make any sense, I think it's just ignored.
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// Supported replacement variables:
// %n - http hostname ($_SERVER['SERVER_NAME'])
// %d - domain (http hostname without the first part)
// %s - domain name after the '#' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %d = domain.tld
// TCP port used for IMAP connections
$rcmail_config['default_port'] = 143;
$rcmail_config['default_host'] = array("ssl://localhost:993");
// TCP port used for IMAP connections
$rcmail_config['default_port'] = 143;
In case the other answer does not work, this is what worked for me. My config.inc.php now contains:
$config['default_host'] = 'ssl://localhost';
$config['default_port'] = 993;
NOTE: using tls://localhost did not work for me. I had to specify ssl:// as the URI scheme.
Via PhpMyAdmin, I also ran this SQL command (all my user accounts are on the same machine that runs RoundCube):
UPDATE `rc_users` SET `mail_host`='ssl://localhost'
I got the port number 993 from running sudo netstat -tulnp in order to determine the port on which Dovecot was listening.