On my last server i could send smtp automatic emails on port 25 but after migrating the server on virtualmin install, i can't make it work
Here's the old working postfix config
myhostname = ##REVERSE_DNS_IPV4##
myorigin = ##REVERSE_DNS_IPV4##
mydestination = localhost.localdomain, localhost, ##REVERSE_DNS_IPV4##
relayhost =
mynetworks = 127.0.0.0/8, ##IPV4_PUBLIQUE_SERVEUR##
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_aliases.cf,mysql:/etc/postfix/mysql-virtual_aliases_comptes.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domaines.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_comptes.cf
virtual_mailbox_base = /var/spool/vmail/
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql-virtual_quotas.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "La boite mail de votre destinataire est pleine, merci de reessayez plus tard."
virtual_overquota_bounce = yes
# adresses d'expedition
smtpd_sender_restrictions =
permit_mynetworks,
warn_if_reject reject_unverified_sender
# adresses de destination
smtpd_recipient_restrictions =
permit_mynetworks,
reject_unauth_destination,
reject_non_fqdn_recipient
# client
smtpd_client_restrictions =
permit_mynetworks
Here is the current not working configuration
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
append_dot_mydomain = no
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
myhostname = vsweb03.help-amor.be
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = 7dd18f2b56a5, vsweb03.help-amor.be, localhost.help-amor.be, loc$
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_alias_maps = hash:/etc/postfix/virtual
sender_bcc_maps = hash:/etc/postfix/bcc
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reje$
allow_percent_hack = no
sender_dependent_default_transport_maps = hash:/etc/postfix/dependent
inet_protocols = ipv4
I must that the old configuration allowed php mail function, impa/pop/smtp emails and django with no user smtp automatic emails
The new one allow everything except django with no user on port 25 automatic smtp emails.
DOes somebody know which directive i need to modify?
Un big thank you to any help
Ok i found the problem,
I just add this and it works with smtp non auth user on port 25
smtpd_sender_restrictions =
permit_mynetworks,
warn_if_reject
Related
My script is working so far to open a remote FTP connection, change directory, and download a file. My last two steps would be to delete the remove file once it's fully downloaded and then close the connection. ACF documentation (and cfdocs) seems to have very little information on this. Here's what I have so far:
ftpConnection = ftpService.open(
action = 'open',
connection = variables.ftpConnectionName,
server = variables.ftpServerName,
username = '***************',
password = '***************',
secure='true');
if( ftpConnection.getPrefix().succeeded ){
fileList = ftpService.listdir(directory = variables.ftpPath, connection= variables.ftpConnectionName, name='pendingFiles', stopOnError='true').getResult();
if( fileList.recordCount ){
changeFtpConnectionDir = ftpService.changeDir(
connection = variables.ftpConnectionName,
directory = variables.ftpPath);
getFtpConnection = ftpService.getFile(
connection = variables.ftpConnectionName,
remoteFile = fileList.name,
localFile = local.localPath & fileList.name,
failIfExists = false,
timeout = 3000
);
deleteRemoteFile = ftpService.remove(
connection = variables.ftpConnectionName,
remoteFile = fileList.name
};
closeFtp = ftpService.close(
connection = variables.ftpConnectionName
);
};
};
Error is thrown on the remoteFile = fileList.name. Since I already changed directory I don't think I need to put the full path here.
I put the entire script up since there doesn't seem to be many resources out there about using the newer ftpServer() functions.
D'oh - my issue was a typo:
deleteRemoteFile = ftpService.remove(
connection = variables.ftpConnectionName,
remoteFile = fileList.name
);// had } instead of )
I'll still leave this up as a resource for ftpService()
i had built django server to handle some work.And when i sent 10000 requests to django,django will became slow after 4000th requests,it will report socket timeout randomly.And i take this one data to test it alone,it is ok.So,how can i fix this bug?
i have no idea to fix it
def handle(request) :
sys.stderr.write( "[info]request come in {} \n".format(sys._getframe().f_code.co_name))
ret_dict = dict()
ret_str = ""
if ("vid" in request.GET) and ("title" in request.GET):
id = request.GET["id"]
title = urllib.parse.unquote(request.GET["title"],encoding ='utf-8')
title = request.GET["title"]
req_video = dict()
req_video["vid"] = vid
req_video["title"] = title
tags = handle_function(req_video)
ret_dict["vid"] = vid
ret_dict["tags"] = tags
ret_str = json.dumps(ret_dict)
return HttpResponse(ret_str)
client codes:
for line in sys.stdin:
line = line.rstrip('\n')
fields = line.split("\t")
vid = fields[0]
title = fields[1]
page_params_mq = {'vid':vid,'title':title}
try :
rec_mq_res = get_rec_mingqiang(server_ip_mq, server_port_mq, web_page_mq, page_params_mq)
except:
print (line)
continue
vid = rec_mq_res["vid"]
tags = rec_mq_res["tags"]
fo.write(vid+"\t"+tags+"\n")
cat test_data|python client.py, there are 10000 rows in test_data,and it send request sequentially,and will be hunt randomly after 4000.
django can handle these requests quickly
I have a VMWare system. I want to run a python script which shall access the VMWare system via IP and want to create a New Disk.
dev_changes = []
new_disk_kb = int(disk_size) * 1024 * 1024
disk_spec = vim.vm.device.VirtualDeviceSpec()
disk_spec.fileOperation = "create"
disk_spec.operation = vim.vm.device.VirtualDeviceSpec.Operation.add
disk_spec.device = vim.vm.device.VirtualDisk()
disk_spec.device.backing = \
vim.vm.device.VirtualDisk.FlatVer2BackingInfo()
if disk_type == 'thin':
disk_spec.device.backing.thinProvisioned = True
disk_spec.device.backing.diskMode = 'persistent'
disk_spec.device.unitNumber = unit_number
disk_spec.device.capacityInKB = new_disk_kb
disk_spec.device.controllerKey = controller.key
dev_changes.append(disk_spec)
spec.deviceChange = dev_changes
vm.ReconfigVM_Task(spec=spec)
print "%sGB disk added to %s" % (disk_size, vm.config.name)
Hope this helps
I'm working on a little e-cards project.
I have to send emails from my remote server with PHPMailer.
localy I'm using this configuration (with my own Gmail email adress) and it works perfectly.
/ssi/mail.config.php
<?php
$mail = new PHPMailer(true);
$mail->CharSet = 'utf-8';
$mail->SMTPDebug = 2;
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->Port = '587';
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->Username = 'private#gmail.com';
$mail->Password = '***secret***';
$mail->SMTPSecure = 'tls';
?>
On my remote server (hosted on one.com) I have created an email account for the domain.
I changed the host and the port like the helpdesk said ... but I don't get it to work remotly.
<?php
'ssi/mail.config.php'
$mail = new PHPMailer(true);
$mail->CharSet = 'utf-8';
$mail->SMTPDebug = 2;
$mail->isSMTP();
$mail->Host = 'send.one.com';
$mail->Port = '25';
$mail->SMTPSecure = 'none';
$mail->SMTPAuth = true;
$mail->Username = 'ecards#iveweygers.be';
$mail->Password = '***secret***';
$mail->SMTPSecure = 'none';
?>
Thanks again!
Looking at the one.com page, there are a few things wrong with this. For smtp they say to use Port 465 with SSL encryption. So, your code should be:
$mail = new PHPMailer(true);
$mail->CharSet = 'utf-8'; // You can remove this line, utf-8 is the default.
$mail->SMTPDebug = 2;
$mail->isSMTP();
$mail->Host = 'send.one.com';
$mail->Port = 465;
$mail->SMTPSecure = 'ssl';
$mail->SMTPAuth = true;
$mail->Username = 'ecards#iveweygers.be';
$mail->Password = '***secret***';
Also worth noting -- and something that it took me a LONG time to find: My SMTP server required authentication to send an email. I assumed that the SMTPAuth = true; took care of that but it did not. I noticed that one.com does as well -- i.e. they tell you to click the button in Outlook that says that your outgoing server requires authentication.
I finally got it to work by putting this at the top of my file:
$pop = new POP3();
$pop->Authorise("send.one.com", 465, 30, "ecards#iveweygers.be", "***secret_password***", 1);
That takes care of the authentication. Then you can jump into the $mail = new PHPMailer(true) and setting all of your parameters and sending the mail.
So your entire file should look like this:
$pop = new POP3();
$pop->Authorise("send.one.com", 465, 30, "ecards#iveweygers.be", "***secret_password***", 1);
$mail = new PHPMailer(true);
$mail->CharSet = 'utf-8'; // You can remove this line, utf-8 is the default.
$mail->SMTPDebug = 2;
$mail->isSMTP();
$mail->Host = 'send.one.com';
$mail->Port = 465;
$mail->SMTPSecure = 'ssl';
$mail->SMTPAuth = true;
$mail->Username = 'ecards#iveweygers.be';
$mail->Password = '***secret***';
You have not said how it's failing, which makes diagnosis difficult.
I really wouldn't recommend any service that uses authentication without encryption. There is no meaning to setting SMTPSecure to 'none' - just set it to an empty string (or don't set it at all) if you don't want SSL or TLS, and you only need to do that once (not twice as in your code).
The other solutions did not work for me; this one did:
$mail->isSMTP();
$mail->Host = 'mailout.one.com';
$mail->SMTPAuth = false; // disable SMTP authentication
$mail->Username = '[your one.com-email]';
$mail->Password = '[your one.com-email password]';
$mail->SMTPSecure = ''; // leave this blank!
$mail->Port = 25;
Let me know if it helped you, too!
I am trying to setup my environment to make Doctrine 2.1 + ZF 1 work together. My take is try to use Bisna but I could not find info about setting the download packages for ORM/DBAL in the /library folder of my app.
What should I put there? (the entire tar.gz from doctrine-orm/doctrine-dbal?)
Regards.
Look for MyNamespace and replace with yours.
The .ini assumes that the doctrine and symfiny libraries are located under library folder.
; ------------------------------------------------------------------------------
; Doctrine Class Loader Configuration
; ------------------------------------------------------------------------------
resources.doctrine.classLoader.loaderClass = "Doctrine\Common\ClassLoader"
resources.doctrine.classLoader.loaderFile = APPLICATION_PATH "/../library/Doctrine/Common/ClassLoader.php"
resources.doctrine.classLoader.loaders.doctrine_common.namespace = "Doctrine\Common"
resources.doctrine.classLoader.loaders.doctrine_common.includePath = APPLICATION_PATH "/../library"
resources.doctrine.classLoader.loaders.doctrine_dbal.namespace = "Doctrine\DBAL"
resources.doctrine.classLoader.loaders.doctrine_dbal.includePath = APPLICATION_PATH "/../library"
resources.doctrine.classLoader.loaders.doctrine_orm.namespace = "Doctrine\ORM"
resources.doctrine.classLoader.loaders.doctrine_orm.includePath = APPLICATION_PATH "/../library"
resources.doctrine.classLoader.loaders.symfony_console.namespace = "Symfony\Component\Console"
resources.doctrine.classLoader.loaders.symfony_console.includePath = APPLICATION_PATH "/../library/Doctrine"
resources.doctrine.classLoader.loaders.symfony_yaml.namespace = "Symfony\Component\Yaml"
resources.doctrine.classLoader.loaders.symfony_yaml.includePath = APPLICATION_PATH "/../library/Doctrine"
; ------------------------------------------------------------------------------
; Doctrine Cache Configuration
; ------------------------------------------------------------------------------
; Points to default cache instance to be used. Optional is only one cache is defined
resources.doctrine.cache.defaultCacheInstance = default
; Cache Instance configuration for "default" cache
;resources.doctrine.cache.instances.default.id = default
resources.doctrine.cache.instances.default.adapterClass = "Doctrine\Common\Cache\ApcCache"
resources.doctrine.cache.instances.default.namespace = "MyNamespace_"
;resources.doctrine.cache.instances.default.options.servers.0.host = localhost
;resources.doctrine.cache.instances.default.options.servers.0.port = 11211
;resources.doctrine.cache.instances.default.options.servers.0.persistent = true
;resources.doctrine.cache.instances.default.options.servers.0.weight = 1
;resources.doctrine.cache.instances.default.options.servers.0.timeout = 1
;resources.doctrine.cache.instances.default.options.servers.0.retryInterval = 15
;resources.doctrine.cache.instances.default.options.servers.0.status = true
; ------------------------------------------------------------------------------
; Doctrine DBAL Configuration
; ------------------------------------------------------------------------------
; Points to default connection to be used. Optional if only one connection is defined
resources.doctrine.dbal.defaultConnection = default
; DBAL Connection configuration for "default" connection
;resources.doctrine.dbal.connections.default.id = default
;resources.doctrine.dbal.connections.default.eventManagerClass = "Doctrine\Common\EventManager"
;resources.doctrine.dbal.connections.default.eventSubscribers[] = "DoctrineExtensions\Sluggable\SluggableSubscriber"
;resources.doctrine.dbal.connections.default.configurationClass = "Doctrine\DBAL\Configuration"
;resources.doctrine.dbal.connections.default.sqlLoggerClass = "Doctrine\DBAL\Logging\EchoSQLLogger"
;resources.doctrine.dbal.connections.default.types.my_type = "Application\DBAL\Type\MyType"
; Database configuration
;resources.doctrine.dbal.connections.default.parameters.wrapperClass = ""
resources.doctrine.dbal.connections.default.parameters.driver = "pdo_mysql"
resources.doctrine.dbal.connections.default.parameters.dbname = "dbname"
resources.doctrine.dbal.connections.default.parameters.host = "dbhosr"
resources.doctrine.dbal.connections.default.parameters.port = 3306
resources.doctrine.dbal.connections.default.parameters.user = "dbuser"
resources.doctrine.dbal.connections.default.parameters.password = "dbpassword"
;resources.doctrine.dbal.connections.default.parameters.driverOptions.ATTR_USE_BUFFERED_QUERIES = true
; ------------------------------------------------------------------------------
; Doctrine ORM Configuration
; ------------------------------------------------------------------------------
; Points to default EntityManager to be used. Optional if only one EntityManager is defined
resources.doctrine.orm.defaultEntityManager = default
; EntityManager configuration for "default" manager
;resources.doctrine.orm.entityManagers.default.id = default
;resources.doctrine.orm.entityManagers.default.entityManagerClass = "Doctrine\ORM\EntityManager"
;resources.doctrine.orm.entityManagers.default.configurationClass = "Doctrine\ORM\Configuration"
;resources.doctrine.orm.entityManagers.default.entityNamespaces.app = "Application\Entity"
resources.doctrine.orm.entityManagers.default.connection = default
resources.doctrine.orm.entityManagers.default.proxy.autoGenerateClasses = true
resources.doctrine.orm.entityManagers.default.proxy.namespace = "MyNamespace\Entity\Proxy"
resources.doctrine.orm.entityManagers.default.proxy.dir = APPLICATION_PATH "/../library/Argo/Entity/Proxy"
;resources.doctrine.orm.entityManagers.default.metadataCache = default
;resources.doctrine.orm.entityManagers.default.queryCache = default
;resources.doctrine.orm.entityManagers.default.resultCache = default
;resources.doctrine.orm.entityManagers.default.DQLFunctions.numeric.PI = "DoctrineExtensions\ORM\Query\Functions\Numeric\PiFunction"
resources.doctrine.orm.entityManagers.default.metadataDrivers.annotationRegistry.annotationFiles[] = APPLICATION_PATH "/../library/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php"
;resources.doctrine.orm.entityManagers.default.metadataDrivers.annotationRegistry.annotationNamespaces.0.namespace = "Gedmo"
;resources.doctrine.orm.entityManagers.default.metadataDrivers.annotationRegistry.annotationNamespaces.0.includePath = APPLICATION_PATH "/../library/vendor"
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.adapterClass = "Doctrine\ORM\Mapping\Driver\AnnotationDriver"
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.mappingNamespace = "MyNamespace\Entity"
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.mappingDirs[] = APPLICATION_PATH "/../library/MyNamespace/Entity"
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.annotationReaderClass = "Doctrine\Common\Annotations\AnnotationReader"
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.annotationReaderCache = default
;resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.annotationReaderNamespaces.App = "Application\DoctrineExtensions\ORM\Mapping"
Bisna's configuration is agnostic about where Doctrine has been installed in your environment. It doesn't actually need to be in your /library. What Bisna does expect, is that your /path/to/Doctrine/ folder has the following structure:
/path/to/Doctrine/ORM
/path/to/Doctrine/DBAL
/path/to/Doctrine/Common
I generally keep Doctrine in /usr/share/php/Doctrine, and tell Bisna where to find it by adding this line to the application.ini
resources.doctrine.includePath = "/usr/share/php/Doctrine"
If Doctrine is in your application's library, then your configuration might look something like this:
resources.doctrine.includePath = APPLICATION_PATH "/../library/Doctrine"